chore: add host catalog edit
This commit is contained in:
8 files changed
+102
-5
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsController extends Controller {
|
||||
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.host-catalogs');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogController extends Controller {
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.model.displayName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
{{outlet}}
|
||||
{{title @model.displayName}}
|
||||
|
||||
{{outlet}}
|
||||
+35
-1
@@ -1 +1,35 @@
|
||||
{{outlet}}
|
||||
<Rose::Layout::Page as |page|>
|
||||
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
<h2>{{t "resources.host-catalog"}}</h2>
|
||||
</page.header>
|
||||
|
||||
<page.navigation>
|
||||
<Rose::Nav::Tabs as |nav|>
|
||||
<nav.link @route='scopes.scope.projects.project.host-catalogs.host-catalog'>
|
||||
{{t 'titles.details'}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Tabs>
|
||||
</page.navigation>
|
||||
|
||||
<page.body>
|
||||
<Form::HostCatalog
|
||||
@model={{@model}}
|
||||
@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>
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
@@ -24,24 +24,27 @@
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.cell>{{t "form.label.id"}}</row.cell>
|
||||
<row.cell>{{t "form.label.name"}}</row.cell>
|
||||
<row.cell>{{t "form.label.type"}}</row.cell>
|
||||
<row.cell>{{t "form.label.description"}}</row.cell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model as |hostCatalog|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<code>{{hostCatalog.id}}</code>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<LinkTo
|
||||
@route="scopes.scope.projects.project.host-catalogs.host-catalog"
|
||||
@model={{hostCatalog}}
|
||||
>
|
||||
{{hostCatalog.name}}
|
||||
{{hostCatalog.displayName}}
|
||||
</LinkTo>
|
||||
<p>{{hostCatalog.description}}</p>
|
||||
</row.cell>
|
||||
<row.cell>{{hostCatalog.type}}</row.cell>
|
||||
<row.cell>{{hostCatalog.description}}</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/projects/project/host-catalogs', function(hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/projects/project/host-catalogs');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/projects/project/host-catalogs/host-catalog', function(hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let controller = this.owner.lookup('controller:scopes/scope/projects/project/host-catalogs/host-catalog');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
@@ -59,6 +59,7 @@ states:
|
||||
error: Error
|
||||
form:
|
||||
label:
|
||||
id: ID
|
||||
name: Name
|
||||
description: Description
|
||||
type: Type
|
||||
|
||||
Reference in new issue
Block a user