-
-
-
- {{t 'form.label.name'}}
- {{t 'form.label.type'}}
- {{t 'form.label.description'}}
-
-
-
- {{#each @model as |hostCatalog|}}
-
-
-
- {{hostCatalog.name}}
-
-
- {{hostCatalog.type}}
- {{hostCatalog.description}}
-
- {{/each}}
-
-
+ {{#if @model}}
+
+
+
+
+ {{t 'form.label.name'}}
+ {{t 'form.label.type'}}
+ {{t 'form.label.description'}}
+
+
+
+ {{#each @model as |hostCatalog|}}
+
+
+
+ {{hostCatalog.name}}
+
+
+ {{hostCatalog.type}}
+ {{hostCatalog.description}}
+
+ {{/each}}
+
+
+
+ {{else}}
+
+
+
+
+ {{t 'descriptions.host-catalogs-welcome'}}
+
+
+
+ {{t 'titles.new'}}
+
+
+
+
+ {{/if}}
+
diff --git a/ui/core/mirage/config.js b/ui/core/mirage/config.js
index b81ef488f..247fc6f36 100644
--- a/ui/core/mirage/config.js
+++ b/ui/core/mirage/config.js
@@ -1,5 +1,5 @@
import config from '../config/environment';
-//import { Response } from 'miragejs';
+// import { Response } from 'miragejs';
export default function() {
@@ -48,4 +48,16 @@ export default function() {
this.get('/orgs/:org_id/projects/:project_id/host-catalogs/:id');
this.patch('/orgs/:org_id/projects/:project_id/host-catalogs/:id');
this.del('/orgs/:org_id/projects/:project_id/host-catalogs/:id');
+
+ // Uncomment the following line and the Response import above
+ // Then change the response code to simulate error responses.
+ // this.get('/orgs/:org_id/projects', () => new Response(505));
+
+ // Update error payload to simulate specific error responses.
+ // this.get('/orgs/:org_id/projects', () => new Response(505, {}, {
+ // errors: [{
+ // status: 505,
+ // message: 'HTTP version not supported.',
+ // }]
+ // }));
}
diff --git a/ui/core/mirage/serializers/application.js b/ui/core/mirage/serializers/application.js
index bed25389e..1c3821b4b 100644
--- a/ui/core/mirage/serializers/application.js
+++ b/ui/core/mirage/serializers/application.js
@@ -1,5 +1,6 @@
import { RestSerializer } from 'ember-cli-mirage';
import { underscore } from '@ember/string';
+import { isArray } from '@ember/array';
/**
* Manages serialization/normalization of data into and out of the mock API.
@@ -38,7 +39,7 @@ export default RestSerializer.extend({
serialize() {
let json = RestSerializer.prototype.serialize.apply(this, arguments);
// If array, root it under a standard `items` key
- if (json.length) json = {items: json};
+ if (isArray(json)) json = {items: json};
return json;
},
diff --git a/ui/core/translations/en-us.yaml b/ui/core/translations/en-us.yaml
index 4b51a1dc2..29ba0c47f 100644
--- a/ui/core/translations/en-us.yaml
+++ b/ui/core/translations/en-us.yaml
@@ -3,6 +3,7 @@ actions:
delete: Delete
dismiss: Dismiss
save: Save
+ help: Need help?
resources:
projects: Projects
project: Project
@@ -12,8 +13,14 @@ titles:
new: New
overview: Overview
settings: Settings
+ empty-set: No Items Yet
+ projects-welcome: Welcome to Projects
+ host-catalogs-welcome: Welcome to Host Catalogs
descriptions:
host-catalogs: Overview of collections of hosts and host sets.
+ empty-set: There are no items to display yet. You may be able to add items or try back later.
+ projects-welcome: Projects allow you to create and manage host catalogs. To start, create a project.
+ host-catalogs-welcome: Host catalogs allow you to configure to collect and create hosts and host sets. To start, create a host catalog.
states:
info: Info
success: Success
@@ -24,6 +31,19 @@ form:
name: Name
description: Description
type: Type
+errors:
+ titles:
+ unauthenticated-error: You are not signed in
+ forbidden-error: You are not authorized
+ notfound-error: Resource not found
+ server-error: Server error
+ unknown-error: Something went wrong
+ descriptions:
+ unauthenticated-error: You are not authenticated. Please authenticate and try again later.
+ forbidden-error: You must be granted permissions to view this data. Ask your administrator if you think you should have access.
+ notfound-error: We could not find the requested resource. You can ask your administrator or try again later.
+ server-error: We ran into a problem and could not continue. You can ask your administrator or try again later.
+ unknown-error: Please contact your administrator or try again later.
dev:
default-org: Default Org
menu-item: Menu item