chore: Add Manage>delete dropdown to host-catalog & host-set
This commit is contained in:
7 files changed
+39
-14
No files matched your search
@@ -6,6 +6,7 @@ export default class ScopesScopeProjectsProjectHostCatalogsRoute extends Route {
|
||||
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
@@ -40,11 +41,13 @@ export default class ScopesScopeProjectsProjectHostCatalogsRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
async save(hostCatalog) {
|
||||
const { isNew } = hostCatalog;
|
||||
try {
|
||||
await hostCatalog.save();
|
||||
this.refresh();
|
||||
// TODO: replace with translated strings
|
||||
this.notify.success('Save succeeded.');
|
||||
this.notify.success(
|
||||
this.intl.t(isNew ? 'notify.create-success' : 'notify.save-success')
|
||||
);
|
||||
this.transitionTo('scopes.scope.projects.project.host-catalogs.host-catalog', hostCatalog);
|
||||
} catch (error) {
|
||||
// TODO: replace with translated strings
|
||||
@@ -61,9 +64,8 @@ export default class ScopesScopeProjectsProjectHostCatalogsRoute extends Route {
|
||||
try {
|
||||
await project.destroyRecord();
|
||||
this.refresh();
|
||||
this.notify.success(this.intl.t('notify.delete-success'));
|
||||
this.transitionTo('scopes.scope.projects.project.host-catalogs');
|
||||
// TODO: replace with translated strings
|
||||
this.notify.success('Deleted host catalog succesfully.');
|
||||
} catch (error) {
|
||||
// TODO: replace with translated strings
|
||||
this.notify.error(error.message, { closeAfter: null });
|
||||
|
||||
@@ -18,7 +18,7 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogRoute exte
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the host-catalog specific templates for header and navigation page sections.
|
||||
* Renders the host-catalog specific templates for header, navigation, and actions page sections.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
@@ -37,5 +37,11 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogRoute exte
|
||||
outlet: 'navigation',
|
||||
model: model
|
||||
});
|
||||
|
||||
this.render('scopes/scope/projects/project/host-catalogs/host-catalog/-actions', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model
|
||||
});
|
||||
}
|
||||
}
|
||||
+7
-1
@@ -18,7 +18,7 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHo
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the host-set specific templates for header and navigation page sections.
|
||||
* Renders the host-set specific templates for header, navigation, and action page sections.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
@@ -37,5 +37,11 @@ export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHo
|
||||
outlet: 'navigation',
|
||||
model: model
|
||||
});
|
||||
|
||||
this.render('scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/-actions', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model
|
||||
});
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<Rose::Dropdown @text="{{t 'form.label.manage'}}" @dropdownRight={{true}} as |dropdown|>
|
||||
<dropdown.button
|
||||
@style="danger"
|
||||
@disabled={{@model.canSave}}
|
||||
{{on "click" (route-action "delete" @model)}}
|
||||
>
|
||||
{{t 'actions.delete-host-catalog'}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<Rose::Dropdown @text="{{t 'form.label.manage'}}" @dropdownRight={{true}} as |dropdown|>
|
||||
<dropdown.button
|
||||
@style="danger"
|
||||
@disabled={{@model.canSave}}
|
||||
{{on "click" (route-action "delete" @model)}}
|
||||
>
|
||||
{{t 'actions.delete-host-set'}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
-8
@@ -3,11 +3,3 @@
|
||||
@submit={{route-action "save" @model}}
|
||||
@cancel={{route-action "cancel" @model}}
|
||||
/>
|
||||
<Rose::Separator />
|
||||
<Rose::Button
|
||||
@style="warning"
|
||||
@disabled={{@model.canSave}}
|
||||
{{on "click" (route-action "delete" @model)}}
|
||||
>
|
||||
{{t 'actions.delete'}}
|
||||
</Rose::Button>
|
||||
@@ -14,6 +14,7 @@ actions:
|
||||
delete-role: Delete role
|
||||
delete-project: Delete project
|
||||
delete-host-catalog: Delete host catalog
|
||||
delete-host-set: Delete host set
|
||||
auth:
|
||||
titles:
|
||||
no-scopes: No Scopes Available
|
||||
|
||||
Reference in new issue
Block a user