chore: add host catalog edit

This commit is contained in:
Randall Morey committed 2020-07-28 12:17:30 -04:00
1 parent 6fd8106d06
commit 234dc2a746
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}}
@@ -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);
});
});
@@ -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);
});
});
+1
View File
@@ -59,6 +59,7 @@ states:
error: Error
form:
label:
id: ID
name: Name
description: Description
type: Type