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 7b147c7b64
commit 6537fabd89
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 @type 'create')}}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Your ACL token has been added. Your ACL token has been added.
{{else}} {{else}}
There was an error adding your ACL token. There was an error adding your ACL token.
{{/if}} {{/if}}
{{else if (eq type 'update') }} {{else if (eq @type 'update') }}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Your ACL token has been saved. Your ACL token has been saved.
{{else}} {{else}}
There was an error saving your ACL token. There was an error saving your ACL token.
{{/if}} {{/if}}
{{ else if (eq type 'delete')}} {{ else if (eq @type 'delete')}}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Your ACL token was deleted. Your ACL token was deleted.
{{else}} {{else}}
There was an error deleting your ACL token. There was an error deleting your ACL token.
{{/if}} {{/if}}
{{ else if (eq type 'use')}} {{ else if (eq @type 'use')}}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Now using new ACL token. Now using new ACL token.
{{else}} {{else}}
There was an error using that ACL token. There was an error using that ACL token.
{{/if}} {{/if}}
{{ else if (eq type 'clone')}} {{ else if (eq @type 'clone')}}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Your ACL token was cloned. Your ACL token was cloned.
{{else}} {{else}}
There was an error cloning your ACL token. There was an error cloning your ACL token.
{{/if}} {{/if}}
{{/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 @type 'create')}}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Your namespace has been added. Your namespace has been added.
{{else}} {{else}}
There was an error adding your namespace. There was an error adding your namespace.
{{/if}} {{/if}}
{{else if (eq type 'update') }} {{else if (eq @type 'update') }}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Your namespace has been saved. Your namespace has been saved.
{{else}} {{else}}
There was an error saving your namespace. There was an error saving your namespace.
{{/if}} {{/if}}
{{ else if (eq type 'delete')}} {{ else if (eq @type 'delete')}}
{{#if (eq status 'success') }} {{#if (eq @status 'success') }}
Your namespace has been marked for deletion. Your namespace has been marked for deletion.
{{else}} {{else}}
There was an error deleting your namespace. There was an error deleting your namespace.
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#let error.errors.firstObject as |error|}} {{#let @error.errors.firstObject as |error|}}
{{#if error.detail }} {{#if error.detail }}
<br />{{concat '(' (if error.status (concat error.status ': ')) error.detail ')'}} <br />{{concat '(' (if error.status (concat error.status ': ')) error.detail ')'}}
{{/if}} {{/if}}
{{/let}} {{/let}}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,10 @@
<AppView> <AppView>
<BlockSlot @name="notification" as |status type|> <BlockSlot @name="notification" as |status type item error|>
{{partial 'dc/acls/notifications'}} <Consul::Acl::Notifications
@status={{status}}
@type={{type}}
@error={{error}}
/>
</BlockSlot> </BlockSlot>
<BlockSlot @name="breadcrumbs"> <BlockSlot @name="breadcrumbs">
<ol> <ol>

View File

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

View File

@ -12,7 +12,12 @@
@enabled={{isEnabled}} @enabled={{isEnabled}}
> >
<BlockSlot @name="notification" as |status type item error|> <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>
<BlockSlot @name="breadcrumbs"> <BlockSlot @name="breadcrumbs">
<ol> <ol>

View File

@ -12,8 +12,13 @@
@authorized={{isAuthorized}} @authorized={{isAuthorized}}
@enabled={{isEnabled}} @enabled={{isEnabled}}
> >
<BlockSlot @name="notification" as |status type|> <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>
<BlockSlot @name="header"> <BlockSlot @name="header">
<h1> <h1>

View File

@ -12,7 +12,12 @@
@enabled={{isEnabled}} @enabled={{isEnabled}}
> >
<BlockSlot @name="notification" as |status type item error|> <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>
<BlockSlot @name="breadcrumbs"> <BlockSlot @name="breadcrumbs">
<ol> <ol>

View File

@ -9,8 +9,13 @@
@authorized={{isAuthorized}} @authorized={{isAuthorized}}
@enabled={{isEnabled}} @enabled={{isEnabled}}
> >
<BlockSlot @name="notification" as |status type|> <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>
<BlockSlot @name="header"> <BlockSlot @name="header">
<h1> <h1>

View File

@ -12,7 +12,12 @@
@enabled={{isEnabled}} @enabled={{isEnabled}}
> >
<BlockSlot @name="notification" as |status type item error|> <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>
<BlockSlot @name="breadcrumbs"> <BlockSlot @name="breadcrumbs">
<ol> <ol>

View File

@ -12,8 +12,13 @@
@authorized={{isAuthorized}} @authorized={{isAuthorized}}
@enabled={{isEnabled}} @enabled={{isEnabled}}
> >
<BlockSlot @name="notification" as |status type subject|> <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>
<BlockSlot @name="header"> <BlockSlot @name="header">
<h1> <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"> <BlockSlot @name="loaded">
<AppView> <AppView>
<BlockSlot @name="notification" as |status type|> <BlockSlot @name="notification" as |status type|>
{{!TODO: Move sessions to its own folder within nodes }} <Consul::LockSession::Notifications
{{partial 'dc/nodes/notifications'}} @type={{type}}
@status={{status}}
/>
</BlockSlot> </BlockSlot>
<BlockSlot @name="breadcrumbs"> <BlockSlot @name="breadcrumbs">
<ol> <ol>

View File

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

View File

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

View File

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

View File

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

View File

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