ui: Move all our notification partials to components (#8968)

This commit is contained in:
John Cowen 2020-10-19 17:31:01 +01:00 committed by GitHub
parent 28a116b049
commit 2773daedc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 131 additions and 85 deletions

View File

@ -1,32 +1,31 @@
{{#if (eq type 'create')}}
{{#if (eq status 'success') }}
{{#if (eq @type 'create')}}
{{#if (eq @status 'success') }}
Your ACL token has been added.
{{else}}
There was an error adding your ACL token.
{{/if}}
{{else if (eq type 'update') }}
{{#if (eq status 'success') }}
{{else if (eq @type 'update') }}
{{#if (eq @status 'success') }}
Your ACL token has been saved.
{{else}}
There was an error saving your ACL token.
{{/if}}
{{ else if (eq type 'delete')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'delete')}}
{{#if (eq @status 'success') }}
Your ACL token was deleted.
{{else}}
There was an error deleting your ACL token.
{{/if}}
{{ else if (eq type 'use')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'use')}}
{{#if (eq @status 'success') }}
Now using new ACL token.
{{else}}
There was an error using that ACL token.
{{/if}}
{{ else if (eq type 'clone')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'clone')}}
{{#if (eq @status 'success') }}
Your ACL token was cloned.
{{else}}
There was an error cloning your ACL token.
{{/if}}
{{/if}}

View File

@ -0,0 +1,7 @@
{{#if (eq @type 'delete')}}
{{#if (eq @status 'success') }}
The session was invalidated.
{{else}}
There was an error invalidating the session.
{{/if}}
{{/if}}

View File

@ -1,25 +1,24 @@
{{#if (eq type 'create')}}
{{#if (eq status 'success') }}
{{#if (eq @type 'create')}}
{{#if (eq @status 'success') }}
Your namespace has been added.
{{else}}
There was an error adding your namespace.
{{/if}}
{{else if (eq type 'update') }}
{{#if (eq status 'success') }}
{{else if (eq @type 'update') }}
{{#if (eq @status 'success') }}
Your namespace has been saved.
{{else}}
There was an error saving your namespace.
{{/if}}
{{ else if (eq type 'delete')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'delete')}}
{{#if (eq @status 'success') }}
Your namespace has been marked for deletion.
{{else}}
There was an error deleting your namespace.
{{/if}}
{{/if}}
{{#let error.errors.firstObject as |error|}}
{{#let @error.errors.firstObject as |error|}}
{{#if error.detail }}
<br />{{concat '(' (if error.status (concat error.status ': ')) error.detail ')'}}
{{/if}}
{{/let}}

View File

@ -1,25 +1,24 @@
{{#if (eq type 'create')}}
{{#if (eq status 'success') }}
{{#if (eq @type 'create')}}
{{#if (eq @status 'success') }}
Your policy has been added.
{{else}}
There was an error adding your policy.
{{/if}}
{{else if (eq type 'update') }}
{{#if (eq status 'success') }}
{{else if (eq @type 'update') }}
{{#if (eq @status 'success') }}
Your policy has been saved.
{{else}}
There was an error saving your policy.
{{/if}}
{{ else if (eq type 'delete')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'delete')}}
{{#if (eq @status 'success') }}
Your policy was deleted.
{{else}}
There was an error deleting your policy.
{{/if}}
{{/if}}
{{#let error.errors.firstObject as |error|}}
{{#let @error.errors.firstObject as |error|}}
{{#if error.detail }}
<br />{{concat '(' (if error.status (concat error.status ': ')) error.detail ')'}}
{{/if}}
{{/let}}

View File

@ -1,25 +1,24 @@
{{#if (eq type 'create')}}
{{#if (eq status 'success') }}
{{#if (eq @type 'create')}}
{{#if (eq @status 'success') }}
Your role has been added.
{{else}}
There was an error adding your role.
{{/if}}
{{else if (eq type 'update') }}
{{#if (eq status 'success') }}
{{else if (eq @type 'update') }}
{{#if (eq @status 'success') }}
Your role has been saved.
{{else}}
There was an error saving your role.
{{/if}}
{{ else if (eq type 'delete')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'delete')}}
{{#if (eq @status 'success') }}
Your role was deleted.
{{else}}
There was an error deleting your role.
{{/if}}
{{/if}}
{{#let error.errors.firstObject as |error|}}
{{#let @error.errors.firstObject as |error|}}
{{#if error.detail }}
<br />{{concat '(' (if error.status (concat error.status ': ')) error.detail ')'}}
{{/if}}
{{/let}}

View File

@ -1,7 +1,6 @@
{{#if (eq type 'update')}}
{{#if (eq status 'warning') }}
{{#if (eq @type 'update')}}
{{#if (eq @status 'warning') }}
This service has been deregistered and no longer exists in the catalog.
{{else}}
{{/if}}
{{/if}}

View File

@ -1,37 +1,36 @@
{{#if (eq type 'create')}}
{{#if (eq status 'success') }}
{{#if (eq @type 'create')}}
{{#if (eq @status 'success') }}
The token has been added.
{{else}}
There was an error adding the token.
{{/if}}
{{else if (eq type 'update') }}
{{#if (eq status 'success') }}
{{else if (eq @type 'update') }}
{{#if (eq @status 'success') }}
The token has been saved.
{{else}}
There was an error saving the token.
{{/if}}
{{ else if (eq type 'delete')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'delete')}}
{{#if (eq @status 'success') }}
The token was deleted.
{{else}}
There was an error deleting the token.
{{/if}}
{{ else if (eq type 'clone')}}
{{#if (eq status 'success') }}
The token has been cloned as {{truncate subject.AccessorID 8 false}}
{{ else if (eq @type 'clone')}}
{{#if (eq @status 'success') }}
The token has been cloned as {{truncate @item.AccessorID 8 false}}
{{else}}
There was an error cloning the token.
{{/if}}
{{ else if (eq type 'use')}}
{{#if (eq status 'success') }}
{{ else if (eq @type 'use')}}
{{#if (eq @status 'success') }}
You are now using the new ACL token
{{else}}
There was an error using that ACL token.
{{/if}}
{{/if}}
{{#let error.errors.firstObject as |error|}}
{{#let @error.errors.firstObject as |error|}}
{{#if error.detail }}
<br />{{concat '(' (if error.status (concat error.status ': ')) error.detail ')'}}
{{/if}}
{{/let}}

View File

@ -1,7 +1,11 @@
<AppView>
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/notifications'}}
</BlockSlot>
<BlockSlot @name="notification" as |status type item error|>
<Consul::Acl::Notifications
@status={{status}}
@type={{type}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>
<li><a data-test-back href={{href-to 'dc.acls'}}>All Tokens</a></li>

View File

@ -8,8 +8,12 @@
as |filter|
}}
<AppView>
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/notifications'}}
<BlockSlot @name="notification" as |status type item error|>
<Consul::Acl::Notifications
@status={{status}}
@type={{type}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="header">
<h1>

View File

@ -12,7 +12,12 @@
@enabled={{isEnabled}}
>
<BlockSlot @name="notification" as |status type item error|>
{{partial 'dc/acls/policies/notifications'}}
<Consul::Policy::Notifications
@type={{type}}
@status={{status}}
@item={{item}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>

View File

@ -12,8 +12,13 @@
@authorized={{isAuthorized}}
@enabled={{isEnabled}}
>
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/policies/notifications'}}
<BlockSlot @name="notification" as |status type item error|>
<Consul::Policy::Notifications
@type={{type}}
@status={{status}}
@item={{item}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="header">
<h1>

View File

@ -12,7 +12,12 @@
@enabled={{isEnabled}}
>
<BlockSlot @name="notification" as |status type item error|>
{{partial 'dc/acls/roles/notifications'}}
<Consul::Role::Notifications
@type={{type}}
@status={{status}}
@item={{item}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>

View File

@ -9,8 +9,13 @@
@authorized={{isAuthorized}}
@enabled={{isEnabled}}
>
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/acls/roles/notifications'}}
<BlockSlot @name="notification" as |status type item error|>
<Consul::Role::Notifications
@type={{type}}
@status={{status}}
@item={{item}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="header">
<h1>

View File

@ -12,7 +12,12 @@
@enabled={{isEnabled}}
>
<BlockSlot @name="notification" as |status type item error|>
{{partial 'dc/acls/tokens/notifications'}}
<Consul::Token::Notifications
@type={{type}}
@status={{status}}
@item={{item}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>

View File

@ -12,8 +12,13 @@
@authorized={{isAuthorized}}
@enabled={{isEnabled}}
>
<BlockSlot @name="notification" as |status type subject|>
{{partial 'dc/acls/tokens/notifications'}}
<BlockSlot @name="notification" as |status type item error|>
<Consul::Token::Notifications
@type={{type}}
@status={{status}}
@item={{item}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="header">
<h1>

View File

@ -1,12 +0,0 @@
{{#if (eq type 'delete')}}
{{#if (eq status 'success') }}
The session was invalidated.
{{else}}
There was an error invalidating the session.
{{/if}}
{{else if (eq type 'update')}}
{{#if (eq status 'warning') }}
This node no longer exists in the catalog.
{{else}}
{{/if}}
{{/if}}

View File

@ -31,8 +31,10 @@
<BlockSlot @name="loaded">
<AppView>
<BlockSlot @name="notification" as |status type|>
{{!TODO: Move sessions to its own folder within nodes }}
{{partial 'dc/nodes/notifications'}}
<Consul::LockSession::Notifications
@type={{type}}
@status={{status}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>

View File

@ -5,7 +5,11 @@
{{/if}}
<AppView>
<BlockSlot @name="notification" as |status type item error|>
{{partial 'dc/nspaces/notifications'}}
<Consul::Nspace::Notifications
@type={{type}}
@status={{status}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>

View File

@ -2,8 +2,12 @@
{{#let (or sortBy "Name:asc") as |sort|}}
<EventSource @src={{items}} />
<AppView>
<BlockSlot @name="notification" as |status type subject|>
{{partial 'dc/nspaces/notifications'}}
<BlockSlot @name="notification" as |status type item error|>
<Consul::Nspace::Notifications
@type={{type}}
@status={{status}}
@error={{error}}
/>
</BlockSlot>
<BlockSlot @name="header">
<h1>

View File

@ -8,7 +8,10 @@
{{#let (or sortBy "Name:asc") as |sort|}}
<AppView>
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/services/notifications'}}
<Consul::Service::Notifications
@type={{type}}
@status={{status}}
/>
</BlockSlot>
<BlockSlot @name="header">
<h1>

View File

@ -4,7 +4,10 @@
<EventSource @src={{proxyMeta}} />
<AppView>
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/services/notifications'}}
<Consul::Service::Notifications
@type={{type}}
@status={{status}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>

View File

@ -7,7 +7,10 @@
{{title item.Service.Service}}
<AppView>
<BlockSlot @name="notification" as |status type|>
{{partial 'dc/services/notifications'}}
<Consul::Service::Notifications
@type={{type}}
@status={{status}}
/>
</BlockSlot>
<BlockSlot @name="breadcrumbs">
<ol>