diff --git a/ui-v2/app/controllers/settings.js b/ui-v2/app/controllers/settings.js index 91771e0f94..8bb96673cd 100644 --- a/ui-v2/app/controllers/settings.js +++ b/ui-v2/app/controllers/settings.js @@ -5,8 +5,18 @@ import { inject as service } from '@ember/service'; export default Controller.extend({ repo: service('settings'), dom: service('dom'), + timeout: service('timeout'), + confirming: false, + applyTransition: function() { + const tick = get(this, 'timeout').tick; + set(this, 'confirming', true); + tick().then(() => { + set(this, 'confirming', false); + }); + }, actions: { key: function(e) { + this.applyTransition(); switch (true) { case e.keyCode === 13: // disable ENTER diff --git a/ui-v2/app/services/timeout.js b/ui-v2/app/services/timeout.js index 833bf1b492..bb15f85f3d 100644 --- a/ui-v2/app/services/timeout.js +++ b/ui-v2/app/services/timeout.js @@ -1,9 +1,19 @@ import Service from '@ember/service'; import promisedTimeoutFactory from 'consul-ui/utils/promisedTimeout'; import { Promise } from 'rsvp'; +import { next } from '@ember/runloop'; + const promisedTimeout = promisedTimeoutFactory(Promise); export default Service.extend({ + // TODO: milliseconds should default to 0 or potentially just null + // if it is 0/null use tick/next instead + // if Octane eliminates the runloop things, look to use raf here instead execute: function(milliseconds, cb) { return promisedTimeout(milliseconds, cb); }, + tick: function() { + return new Promise(function(resolve, reject) { + next(resolve); + }); + }, }); diff --git a/ui-v2/app/styles/app.scss b/ui-v2/app/styles/app.scss index 7617caf8a4..e0d0d98037 100644 --- a/ui-v2/app/styles/app.scss +++ b/ui-v2/app/styles/app.scss @@ -16,6 +16,7 @@ @import 'core/typography'; @import 'core/layout'; +@import 'routes/dc/settings/index'; @import 'routes/dc/service/index'; @import 'routes/dc/nodes/index'; @import 'routes/dc/intention/index'; diff --git a/ui-v2/app/styles/base/animation/index.scss b/ui-v2/app/styles/base/animation/index.scss index ca83a13556..61fd122b2a 100644 --- a/ui-v2/app/styles/base/animation/index.scss +++ b/ui-v2/app/styles/base/animation/index.scss @@ -8,6 +8,8 @@ %blink-in-fade-out-active { transition-duration: 0; transition-duration: unset; + transition-delay: 0; + transition-delay: unset; opacity: 1; pointer-events: auto; } diff --git a/ui-v2/app/styles/routes/dc/settings/index.scss b/ui-v2/app/styles/routes/dc/settings/index.scss new file mode 100644 index 0000000000..f239fc0c84 --- /dev/null +++ b/ui-v2/app/styles/routes/dc/settings/index.scss @@ -0,0 +1,17 @@ +#urls_service span { + position: relative; +} +#urls_service span::after { + @extend %with-tick; + background-color: $green-500; + border-radius: 100%; + top: 13px; + right: 0; +} +#urls_service span::after { + @extend %blink-in-fade-out; + transition-delay: 3s; +} +#urls_service.confirming span::after { + @extend %blink-in-fade-out-active; +} diff --git a/ui-v2/app/templates/settings.hbs b/ui-v2/app/templates/settings.hbs index 7215c9f96c..64a25c3bc4 100644 --- a/ui-v2/app/templates/settings.hbs +++ b/ui-v2/app/templates/settings.hbs @@ -18,7 +18,7 @@
Add a link to the service detail page in the UI to get quick access to a service-wide metrics dashboard. Enter the dashboard URL into the field below. You can use the placeholders {{'{{Datacenter}}'}}
and {{'{{Service.Name}}'}}
which will be replaced with the name of the datacenter/service currently being viewed.