diff --git a/ui/app/components/secure-variable-form/input-group.hbs b/ui/app/components/secure-variable-form/input-group.hbs index 431c167fd..acc5fbf4d 100644 --- a/ui/app/components/secure-variable-form/input-group.hbs +++ b/ui/app/components/secure-variable-form/input-group.hbs @@ -18,7 +18,7 @@ > \ No newline at end of file diff --git a/ui/app/controllers/variables/variable/index.js b/ui/app/controllers/variables/variable/index.js index d8f22ffb7..0cfbfa86e 100644 --- a/ui/app/controllers/variables/variable/index.js +++ b/ui/app/controllers/variables/variable/index.js @@ -1,5 +1,5 @@ import Controller from '@ember/controller'; -import { action } from '@ember/object'; +import { set, action } from '@ember/object'; import { task } from 'ember-concurrency'; import messageForError from '../../../utils/message-from-adapter-error'; import { inject as service } from '@ember/service'; @@ -9,6 +9,15 @@ export default class VariablesVariableIndexController extends Controller { queryParams = ['view']; @service router; + queryParams = ['sortProperty', 'sortDescending']; + + @tracked sortProperty = 'key'; + @tracked sortDescending = true; + + get sortedKeyValues() { + const sorted = this.model.keyValues.sortBy(this.sortProperty); + return this.sortDescending ? sorted : sorted.reverse(); + } @tracked error = null; @@ -62,7 +71,6 @@ export default class VariablesVariableIndexController extends Controller { this.view = 'table'; } } - //#endregion Code View get shouldShowLinkedEntities() { @@ -72,4 +80,8 @@ export default class VariablesVariableIndexController extends Controller { this.model.pathLinkedEntities?.task ); } + + toggleRowVisibility(kv) { + set(kv, 'isVisible', !kv.isVisible); + } } diff --git a/ui/app/styles/components/secure-variables.scss b/ui/app/styles/components/secure-variables.scss index 3a8eb0991..de2b17a0e 100644 --- a/ui/app/styles/components/secure-variables.scss +++ b/ui/app/styles/components/secure-variables.scss @@ -132,6 +132,18 @@ table.path-tree { } } +table.variable-items { + // table-layout: fixed; + td.value-cell { + width: 80%; + & > div { + display: grid; + grid-template-columns: auto auto 1fr; + gap: 0.5rem; + } + } +} + @keyframes slide-in { 0% { top: 10px; diff --git a/ui/app/templates/variables/variable/index.hbs b/ui/app/templates/variables/variable/index.hbs index f83777991..0dd0e58b5 100644 --- a/ui/app/templates/variables/variable/index.hbs +++ b/ui/app/templates/variables/variable/index.hbs @@ -92,14 +92,39 @@ {{else}} - + + + Key + Value + {{row.model.key}} - - {{row.model.value}} + +
+ + + + {{#if row.model.isVisible}} + {{row.model.value}} + {{else}} + ******** + {{/if}} +