From 203a4b3a555f2eeb0ddd68694f792fb772be478c Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 8 Feb 2022 19:37:21 -0800 Subject: [PATCH 01/10] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20host=20typed=20for?= =?UTF-8?q?ms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 3 + ui/admin/app/components/form/host/index.hbs | 64 +++++++++++++------ 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 27e3497c0..c9186a3f9 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -155,6 +155,9 @@ host: unknown: Unknown aws: AWS azure: Azure + form: + provider: + label: Provider Details session: title: Session title_plural: Sessions diff --git a/ui/admin/app/components/form/host/index.hbs b/ui/admin/app/components/form/host/index.hbs index 9b39cdb26..0045a8362 100644 --- a/ui/admin/app/components/form/host/index.hbs +++ b/ui/admin/app/components/form/host/index.hbs @@ -53,24 +53,52 @@ {{/if}} - - {{#if @model.errors.name}} - - {{#each @model.errors.name as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - + {{#if @model.isPlugin}} + + <:title>{{t 'resources.host.form.provider.label'}} + <:body> + + + + + + + {{else}} + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + {{/if}} {{#if (can 'save model' @model)}} Date: Wed, 9 Feb 2022 09:59:44 -0800 Subject: [PATCH 02/10] =?UTF-8?q?fix:=20=F0=9F=90=9B=20show=20latest=20add?= =?UTF-8?q?ress=20in=20azure=20and=20aws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host/index.hbs | 40 ++++++++++----------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/ui/admin/app/components/form/host/index.hbs b/ui/admin/app/components/form/host/index.hbs index 0045a8362..842fff694 100644 --- a/ui/admin/app/components/form/host/index.hbs +++ b/ui/admin/app/components/form/host/index.hbs @@ -76,29 +76,25 @@ - - {{else}} - - - {{#if @model.errors.name}} - - {{#each @model.errors.name as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - {{/if}} + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + {{#if (can 'save model' @model)}} Date: Wed, 9 Feb 2022 16:55:27 -0800 Subject: [PATCH 03/10] fix translations, split into three components --- addons/core/translations/resources/en-us.yaml | 13 +- .../app/components/form/host/aws/index.hbs | 83 +++++++++++++ .../app/components/form/host/azure/index.hbs | 83 +++++++++++++ ui/admin/app/components/form/host/index.hbs | 112 +----------------- .../app/components/form/host/static/index.hbs | 82 +++++++++++++ .../host-catalog/hosts/index.hbs | 8 +- 6 files changed, 269 insertions(+), 112 deletions(-) create mode 100644 ui/admin/app/components/form/host/aws/index.hbs create mode 100644 ui/admin/app/components/form/host/azure/index.hbs create mode 100644 ui/admin/app/components/form/host/static/index.hbs diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index c9186a3f9..161e6ef86 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -151,10 +151,15 @@ host: create: New Host delete: Delete Host types: - static: Static - unknown: Unknown - aws: AWS - azure: Azure + static: + label: Static + help: Provide a list of hosts and host sets with static addresses + unknown: + label: Unknown + aws: + label: AWS + azure: + label: Azure form: provider: label: Provider Details diff --git a/ui/admin/app/components/form/host/aws/index.hbs b/ui/admin/app/components/form/host/aws/index.hbs new file mode 100644 index 000000000..d3536d065 --- /dev/null +++ b/ui/admin/app/components/form/host/aws/index.hbs @@ -0,0 +1,83 @@ + + + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + <:title>{{t 'resources.host.form.provider.label'}} + <:body> + + + + + + + {{#if (can 'save model' @model)}} + + {{/if}} + \ No newline at end of file diff --git a/ui/admin/app/components/form/host/azure/index.hbs b/ui/admin/app/components/form/host/azure/index.hbs new file mode 100644 index 000000000..caaed3d99 --- /dev/null +++ b/ui/admin/app/components/form/host/azure/index.hbs @@ -0,0 +1,83 @@ + + + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + <:title>{{t 'resources.host.form.provider.label'}} + <:body> + + + + + + + {{#if (can 'save model' @model)}} + + {{/if}} + \ No newline at end of file diff --git a/ui/admin/app/components/form/host/index.hbs b/ui/admin/app/components/form/host/index.hbs index 842fff694..088f5a33c 100644 --- a/ui/admin/app/components/form/host/index.hbs +++ b/ui/admin/app/components/form/host/index.hbs @@ -1,106 +1,6 @@ - - - - - - {{#if @model.errors.name}} - - {{#each @model.errors.name as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - - - {{#if @model.errors.description}} - - {{#each @model.errors.description as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - - {{#if @model.isPlugin}} - - <:title>{{t 'resources.host.form.provider.label'}} - <:body> - - - - - - {{/if}} - - {{#if @model.errors.name}} - - {{#each @model.errors.name as |error|}} - {{error.message}} - {{/each}} - - {{/if}} - - {{#if (can 'save model' @model)}} - - {{/if}} - \ No newline at end of file +{{component + (concat 'form/host/' @model.compositeType) + model=@model + submit=@submit + cancel=@cancel +}} \ No newline at end of file diff --git a/ui/admin/app/components/form/host/static/index.hbs b/ui/admin/app/components/form/host/static/index.hbs new file mode 100644 index 000000000..9b39cdb26 --- /dev/null +++ b/ui/admin/app/components/form/host/static/index.hbs @@ -0,0 +1,82 @@ + + + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.description}} + + {{#each @model.errors.description as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + + + {{#if @model.errors.name}} + + {{#each @model.errors.name as |error|}} + {{error.message}} + {{/each}} + + {{/if}} + + {{#if (can 'save model' @model)}} + + {{/if}} + \ No newline at end of file diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs index e6bc38f72..ee8f060cd 100644 --- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs +++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/index.hbs @@ -29,7 +29,9 @@ {{#if host.isStatic}} - {{t (concat 'resources.host.types.' host.compositeType)}} + {{t + (concat 'resources.host.types.' host.compositeType '.label') + }} {{else}} - {{t (concat 'resources.host.types.' host.compositeType)}} + {{t + (concat 'resources.host.types.' host.compositeType '.label') + }} {{/if}} From 7e731a8008c34f3bd5fb02de615582753f5ff1a2 Mon Sep 17 00:00:00 2001 From: dharini Date: Thu, 10 Feb 2022 17:57:19 -0800 Subject: [PATCH 04/10] =?UTF-8?q?fix:=20=F0=9F=90=9B=20render=20static?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host/index.hbs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ui/admin/app/components/form/host/index.hbs b/ui/admin/app/components/form/host/index.hbs index 088f5a33c..a4544c976 100644 --- a/ui/admin/app/components/form/host/index.hbs +++ b/ui/admin/app/components/form/host/index.hbs @@ -1,6 +1,15 @@ -{{component - (concat 'form/host/' @model.compositeType) - model=@model - submit=@submit - cancel=@cancel -}} \ No newline at end of file +{{#if @model.compositeType}} + {{component + (concat 'form/host/' @model.compositeType) + model=@model + submit=@submit + cancel=@cancel + }} +{{else}} + {{component + (concat 'form/host/' 'static') + model=@model + submit=@submit + cancel=@cancel + }} +{{/if}} \ No newline at end of file From 445e98d45566d1ecf929632d7d749c854ab3469f Mon Sep 17 00:00:00 2001 From: dharini Date: Thu, 10 Feb 2022 18:07:52 -0800 Subject: [PATCH 05/10] updates --- ui/admin/app/components/form/host/index.hbs | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/admin/app/components/form/host/index.hbs b/ui/admin/app/components/form/host/index.hbs index a4544c976..114bf331b 100644 --- a/ui/admin/app/components/form/host/index.hbs +++ b/ui/admin/app/components/form/host/index.hbs @@ -6,6 +6,7 @@ cancel=@cancel }} {{else}} +{{{log @model}}} modellllll {{component (concat 'form/host/' 'static') model=@model From 3ff51b30f06ffcb113251af2e677f6c11cccb593 Mon Sep 17 00:00:00 2001 From: dharini Date: Fri, 11 Feb 2022 11:26:22 -0800 Subject: [PATCH 06/10] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20a=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host/index.hbs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/admin/app/components/form/host/index.hbs b/ui/admin/app/components/form/host/index.hbs index 114bf331b..a3c879913 100644 --- a/ui/admin/app/components/form/host/index.hbs +++ b/ui/admin/app/components/form/host/index.hbs @@ -6,7 +6,9 @@ cancel=@cancel }} {{else}} -{{{log @model}}} modellllll + {{! create-and-add-host cancel route doesn't +have a model and this else part is required to prevent +erroring out here. This has been noted in the tech debt doc to further investigate }} {{component (concat 'form/host/' 'static') model=@model From 3693829e962f2a602588ec36b9062a36fa454c70 Mon Sep 17 00:00:00 2001 From: dharini Date: Fri, 11 Feb 2022 11:44:55 -0800 Subject: [PATCH 07/10] =?UTF-8?q?chore:=20=F0=9F=A4=96=20translation=20upd?= =?UTF-8?q?at4e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host/aws/index.hbs | 2 +- ui/admin/app/components/form/host/azure/index.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/admin/app/components/form/host/aws/index.hbs b/ui/admin/app/components/form/host/aws/index.hbs index d3536d065..9f6351ab7 100644 --- a/ui/admin/app/components/form/host/aws/index.hbs +++ b/ui/admin/app/components/form/host/aws/index.hbs @@ -54,7 +54,7 @@ - <:title>{{t 'resources.host.form.provider.label'}} + <:title>{{t 'form.provider.label'}} <:body> - <:title>{{t 'resources.host.form.provider.label'}} + <:title>{{t 'form.provider.label'}} <:body> Date: Fri, 11 Feb 2022 12:04:25 -0800 Subject: [PATCH 08/10] =?UTF-8?q?chore:=20=F0=9F=A4=96=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 10 ---------- ui/admin/app/components/form/host-set/aws/index.hbs | 6 ++---- ui/admin/app/components/form/host-set/azure/index.hbs | 6 ++---- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 59bb25b2f..dacd49846 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -97,13 +97,6 @@ host-catalog: dynamic: label: Dynamic help: Automate discovery of target hosts and services on Azure or AWS - form: - provider: - label: Provider Details - description: This is the provider for this host catalog. The format of the host set filters are specific to each provider. - choose_a_provider: - label: Choose a provider - description: There are several built-in plugins for the most common providers. You can choose from on of the included plugins or use a custom plugin. host-set: title: Host Set title_plural: Host Sets @@ -165,9 +158,6 @@ host: label: AWS azure: label: Azure - form: - provider: - label: Provider Details session: title: Session title_plural: Sessions diff --git a/ui/admin/app/components/form/host-set/aws/index.hbs b/ui/admin/app/components/form/host-set/aws/index.hbs index f800e9d53..6e2529a60 100644 --- a/ui/admin/app/components/form/host-set/aws/index.hbs +++ b/ui/admin/app/components/form/host-set/aws/index.hbs @@ -54,10 +54,8 @@ /> - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + <:title>{{t 'form.provider.label'}} + <:description>{{t 'form.provider.description'}} <:body> - <:title>{{t 'resources.host-catalog.form.provider.label'}} - <:description>{{t - 'resources.host-catalog.form.provider.description' - }} + <:title>{{t 'form.provider.label'}} + <:description>{{t 'form.provider.description'}} <:body> Date: Mon, 14 Feb 2022 12:34:05 -0800 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20address?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host/static/index.hbs | 2 +- .../scopes/scope/host-catalogs/host-catalog/hosts/index.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/admin/app/components/form/host/static/index.hbs b/ui/admin/app/components/form/host/static/index.hbs index 9b39cdb26..352cf1089 100644 --- a/ui/admin/app/components/form/host/static/index.hbs +++ b/ui/admin/app/components/form/host/static/index.hbs @@ -56,7 +56,7 @@ - {{host.attributes.address}} + {{host.address}} {{/each}} From b15c8b056f7a1ab8a2a0fff57c34620013e64571 Mon Sep 17 00:00:00 2001 From: dharini Date: Mon, 14 Feb 2022 12:55:07 -0800 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20=F0=9F=90=9B=20error=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/components/form/host/static/index.hbs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/admin/app/components/form/host/static/index.hbs b/ui/admin/app/components/form/host/static/index.hbs index 352cf1089..d86c04f1c 100644 --- a/ui/admin/app/components/form/host/static/index.hbs +++ b/ui/admin/app/components/form/host/static/index.hbs @@ -58,14 +58,14 @@ @type='text' @value={{@model.address}} @label={{t 'form.address.label'}} - @error={{@model.errors.name}} + @error={{@model.errors.address}} @helperText={{t 'form.address.help'}} readonly={{false}} as |field| > - {{#if @model.errors.name}} + {{#if @model.errors.address}} - {{#each @model.errors.name as |error|}} + {{#each @model.errors.address as |error|}} {{error.message}} {{/each}}