From a6b2acc14d0de00ff5b8aa2a3568f1d57db99393 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Wed, 18 Jan 2023 20:26:28 -0800 Subject: [PATCH] Oss workflow target egress filter (#1590) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 🤖 add egress filters to target --- addons/core/translations/resources/en-us.yaml | 7 ++ .../components/form/target/details/index.hbs | 108 ++++++++++++------ .../components/form/target/details/index.js | 34 +++++- .../form/target/worker-filter/index.hbs | 37 ++++++ ui/admin/app/styles/app.scss | 14 +++ 5 files changed, 163 insertions(+), 37 deletions(-) create mode 100644 ui/admin/app/components/form/target/worker-filter/index.hbs diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 59989c95e..21d4af19e 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -379,6 +379,13 @@ target: ingress-worker: Ingress worker host: Host network: Private network + egress_worker_filter: + title: Egress worker filter + description: Optional. Specify workers that have access to the target (such as within a private network). + filter: + title: Filter + description: Boolean expression. + update_filter: Update Filter credential-store: title: Credential Store title_plural: Credential Stores diff --git a/ui/admin/app/components/form/target/details/index.hbs b/ui/admin/app/components/form/target/details/index.hbs index 74ec6d202..888c1691e 100644 --- a/ui/admin/app/components/form/target/details/index.hbs +++ b/ui/admin/app/components/form/target/details/index.hbs @@ -67,7 +67,7 @@ {{/each}} -
+ {{else}} {{t 'resources.target.workers.title'}} {{t 'resources.target.workers.description'}} - {{#if this.showDeprecationMessage}} - - - {{t - 'resources.target.workers.deprecation_message.title' - }} - {{t - 'resources.target.workers.deprecation_message.description' - }} - - - {{/if}} - - - {{t 'form.worker_filter.label'}} - {{t 'form.worker_filter.help'}} - {{#if @model.errors.worker_filter}} - - {{#each @model.errors.worker_filter as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - + {{#unless this.migrateWorkerFilter}} + {{#if this.showDeprecationMessage}} + + + {{t + 'resources.target.workers.deprecation_message.title' + }} + {{t + 'resources.target.workers.deprecation_message.description' + }} + + + + + {{t 'form.worker_filter.label'}} + {{t 'form.worker_filter.help'}} + + + {{/if}} + {{/unless}} + + {{#if this.showUpdateWorkerFilterButton}} + {{#if form.isEditable}} + + {{/if}} + {{else}} + + + + {{#if @model.errors.egress_worker_filter}} + + {{#each @model.errors.egress_worker_filter as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{/if}} {{else}} message) diff --git a/ui/admin/app/components/form/target/worker-filter/index.hbs b/ui/admin/app/components/form/target/worker-filter/index.hbs new file mode 100644 index 000000000..256cd582a --- /dev/null +++ b/ui/admin/app/components/form/target/worker-filter/index.hbs @@ -0,0 +1,37 @@ +
+ + {{t (concat 'resources.target.workers.' @name '.title')}} + {{t + (concat 'resources.target.workers.' @name '.description') + }} + + + {{#if @toggleEnabled}} + + {{t + (concat 'resources.target.workers.' @name '.filter.title') + }} + {{t + (concat 'resources.target.workers.' @name '.filter.description') + }} + + {{t 'actions.learn-more'}} + + + {{yield F}} + + {{/if}} +
\ No newline at end of file diff --git a/ui/admin/app/styles/app.scss b/ui/admin/app/styles/app.scss index 36df9ae8b..5382ad5b5 100644 --- a/ui/admin/app/styles/app.scss +++ b/ui/admin/app/styles/app.scss @@ -493,6 +493,20 @@ } } +// target worker filters +// note re Button margin: this is a temp solution, +// when we migrate buttons to HDS, we will analyze the spacing +// issue in all scenarios to come up with an efficient solution +.update-filter-button { + margin-bottom: 1.5rem; +} + +.target-worker-filter { + .hds-form-field--layout-vertical { + margin-left: 2.5rem; + } +} + // json secret editor .secret-editor { // Secret Editor body and gutter colors are based on the Monokai color template