Merge branch 'main' into chore-argument-less-helper-paren-less-invocation
This commit is contained in:
67 files changed
+2031
-482
No files matched your search
@@ -0,0 +1,171 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<form.fieldset>
|
||||
<:title>{{t 'form.type.label'}}</:title>
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='types'
|
||||
@selectedValue={{@model.type}}
|
||||
@changed={{@changeType}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.static'}}
|
||||
@value='static'
|
||||
@helperText={{t 'resources.host-catalog.help.static'}}
|
||||
@layout='wide'
|
||||
/>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.dynamic'}}
|
||||
@value='plugin'
|
||||
@helperText={{t 'resources.host-catalog.help.dynamic'}}
|
||||
@layout='wide'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
<Rose::Separator />
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
</form.fieldset>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.choose-a-provider'}}</:title>
|
||||
<:description>{{t 'descriptions.choose-a-provider'}}</:description>
|
||||
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@changed={{@changeType}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.aws'}}
|
||||
@value='aws'
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/aws-color-16'
|
||||
/>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.azure'}}
|
||||
@value='azure'
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/azure-color-16'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
{{else}}
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
<:description>{{t 'descriptions.provider'}}</:description>
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@disabled={{true}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.aws'}}
|
||||
@value='aws'
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/aws-color-16'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
{{/if}}
|
||||
|
||||
<form.input
|
||||
@name='region'
|
||||
@type='region'
|
||||
@value={{@model.region}}
|
||||
@label={{t 'form.region.label'}}
|
||||
readonly={{false}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='access_key_id'
|
||||
@type='access_key_id'
|
||||
@value={{@model.access_key_id}}
|
||||
@label={{t 'form.access_key_id.label'}}
|
||||
@helperText={{t 'form.access_key_id.help'}}
|
||||
@linkText={{t 'actions.learn-more'}}
|
||||
readonly={{false}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='secret_access_key'
|
||||
@type='secret_access_key'
|
||||
@value={{@model.secret_access_key}}
|
||||
@label={{t 'form.secret_access_key.label'}}
|
||||
@helperText={{t 'form.secret_access_key.help'}}
|
||||
@linkText={{t 'actions.learn-more'}}
|
||||
readonly={{false}}
|
||||
/>
|
||||
|
||||
<form.checkbox
|
||||
@name='disable_credential_rotation'
|
||||
@checked={{@model.disable_credential_rotation}}
|
||||
@label={{t 'form.disable_credential_rotation.label'}}
|
||||
@onChange={{fn this.toggleDisableCredentialRotation @model}}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -0,0 +1,11 @@
|
||||
import Component from '@glimmer/component';
|
||||
import { action } from '@ember/object';
|
||||
|
||||
export default class FormHostCatalogAwsComponent extends Component {
|
||||
// =actions
|
||||
|
||||
@action
|
||||
toggleDisableCredentialRotation(model) {
|
||||
model.disable_credential_rotation = !model.disable_credential_rotation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<form.fieldset>
|
||||
<:title>{{t 'form.type.label'}}</:title>
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='types'
|
||||
@selectedValue={{@model.type}}
|
||||
@changed={{@changeType}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.static'}}
|
||||
@value='static'
|
||||
@helperText={{t 'resources.host-catalog.help.static'}}
|
||||
@layout='wide'
|
||||
/>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.dynamic'}}
|
||||
@value='plugin'
|
||||
@helperText={{t 'resources.host-catalog.help.dynamic'}}
|
||||
@layout='wide'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
<Rose::Separator />
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
</form.fieldset>
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.choose-a-provider'}}</:title>
|
||||
<:description>{{t 'descriptions.choose-a-provider'}}</:description>
|
||||
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@changed={{@changeType}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.aws'}}
|
||||
@value='aws'
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/aws-color-16'
|
||||
/>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.azure'}}
|
||||
@value='azure'
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/azure-color-16'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
{{else}}
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
<:description>{{t 'descriptions.provider'}}</:description>
|
||||
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@disabled={{true}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.azure'}}
|
||||
@value='azure'
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/azure-color-16'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
{{/if}}
|
||||
|
||||
<form.input
|
||||
@name='tenant_id'
|
||||
@type='tenant_id'
|
||||
@value={{@model.tenant_id}}
|
||||
@label={{t 'form.tenant_id.label'}}
|
||||
@helperText={{t 'form.tenant_id.help'}}
|
||||
@linkText={{t 'actions.learn-more'}}
|
||||
@link={{doc-url @doc}}
|
||||
readonly={{false}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='subscription_id'
|
||||
@type='subscription_id'
|
||||
@value={{@model.subscription_id}}
|
||||
@label={{t 'form.subscription_id.label'}}
|
||||
@helperText={{t 'form.subscription_id.help'}}
|
||||
@linkText={{t 'actions.learn-more'}}
|
||||
@link={{doc-url @doc}}
|
||||
readonly={{false}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='client_id'
|
||||
@type='client_id'
|
||||
@value={{@model.client_id}}
|
||||
@label={{t 'resources.host-catalog.form.azure_client_id.label'}}
|
||||
@helperText={{t 'resources.host-catalog.form.azure_client_id.help'}}
|
||||
@linkText={{t 'actions.learn-more'}}
|
||||
@link={{doc-url @doc}}
|
||||
readonly={{false}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='secret_value'
|
||||
@type='secret_value'
|
||||
@value={{@model.secret_value}}
|
||||
@label={{t 'form.secret.label'}}
|
||||
@helperText={{t 'form.secret.help'}}
|
||||
@linkText={{t 'actions.learn-more'}}
|
||||
@link={{doc-url @doc}}
|
||||
readonly={{false}}
|
||||
/>
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,56 +1,8 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
{{component
|
||||
(concat 'form/host-catalog/' @model.compositeType)
|
||||
model=@model
|
||||
submit=@submit
|
||||
cancel=@cancel
|
||||
changeType=@changeType
|
||||
doc=@doc
|
||||
}}
|
||||
@@ -0,0 +1,115 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
{{#if @model.isNew}}
|
||||
<form.fieldset>
|
||||
<:title>{{t 'form.type.label'}}</:title>
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='types'
|
||||
@selectedValue={{@model.type}}
|
||||
@changed={{@changeType}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.static'}}
|
||||
@value='static'
|
||||
@helperText={{t 'resources.host-catalog.help.static'}}
|
||||
@layout='wide'
|
||||
/>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.dynamic'}}
|
||||
@value='plugin'
|
||||
@helperText={{t 'resources.host-catalog.help.dynamic'}}
|
||||
@layout='wide'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
{{#if @model.isPlugin}}
|
||||
<Rose::Separator />
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
</form.fieldset>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.choose-a-provider'}}</:title>
|
||||
<:description>{{t 'descriptions.choose-a-provider'}}</:description>
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@changed={{@changeType}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.aws'}}
|
||||
@value='aws'
|
||||
@layout='tile'
|
||||
/>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.azure'}}
|
||||
@value='azure'
|
||||
@layout='tile'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -0,0 +1,247 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
<:description>{{t 'descriptions.provider'}}</:description>
|
||||
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@disabled={{true}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.aws'}}
|
||||
@value={{@model.compositeType}}
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/aws-color-16'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
<Rose::Form::Fieldset>
|
||||
<:title>{{t 'resources.host-set.form.preferred_endpoints.label'}}</:title>
|
||||
<:description>{{t
|
||||
'resources.host-set.form.preferred_endpoints.help'
|
||||
}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.preferred_endpoints}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.preferred_endpoints as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
{{/if}}
|
||||
<Rose::Table @style='condensed' as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row @hidden={{true}} as |row|>
|
||||
<row.headerCell>{{t 'titles.value'}}</row.headerCell>
|
||||
<row.headerCell />
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.preferred_endpoints as |endpoint i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@value={{endpoint.value}}
|
||||
@error={{@model.errors.preferred_endpoints}}
|
||||
@contextual={{true}}
|
||||
placeholder='cidr:2001:4860:4860::8888/32'
|
||||
as |field|
|
||||
>
|
||||
<field.field />
|
||||
</form.input>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@style='warning'
|
||||
@iconOnly='flight-icons/svg/trash-16'
|
||||
title={{t 'actions.remove'}}
|
||||
@disabled={{if
|
||||
@model.isNew
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'preferred_endpoints' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@value={{@model.preferred_endpoint}}
|
||||
placeholder='cidr:2001:4860:4860::8888/32'
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@style='secondary'
|
||||
title={{t 'actions.add'}}
|
||||
@disabled={{if
|
||||
@model.isNew
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn
|
||||
@addStringItem
|
||||
'preferred_endpoints'
|
||||
@model.preferred_endpoint
|
||||
)
|
||||
}}
|
||||
>
|
||||
{{t 'actions.add'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
</:body>
|
||||
</Rose::Form::Fieldset>
|
||||
|
||||
<Rose::Form::Fieldset>
|
||||
<:title>{{t 'resources.host-set.form.filter.label'}}</:title>
|
||||
<:description>{{t 'resources.host-set.form.filter.help'}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.filters}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.filters as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
{{/if}}
|
||||
<Rose::Table @style='condensed' as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row @hidden={{true}} as |row|>
|
||||
<row.headerCell>{{t 'titles.value'}}</row.headerCell>
|
||||
<row.headerCell />
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.filters as |filter i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@value={{filter.value}}
|
||||
@error={{@model.errors.filters}}
|
||||
@contextual={{true}}
|
||||
as |field|
|
||||
>
|
||||
<field.field />
|
||||
</form.input>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@style='warning'
|
||||
@iconOnly='flight-icons/svg/trash-16'
|
||||
title={{t 'actions.remove'}}
|
||||
@disabled={{if
|
||||
@model.isNew
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'filters' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input @type='text' @value={{@model.filter}} />
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@style='secondary'
|
||||
title={{t 'actions.add'}}
|
||||
@disabled={{if
|
||||
@model.isNew
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on 'click' (fn @addStringItem 'filters' @model.filter)}}
|
||||
>
|
||||
{{t 'actions.add'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
</:body>
|
||||
</Rose::Form::Fieldset>
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -0,0 +1,194 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
<:description>{{t 'descriptions.provider'}}</:description>
|
||||
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@disabled={{true}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.azure'}}
|
||||
@value={{@model.compositeType}}
|
||||
@layout='tile'
|
||||
@icon='flight-icons/svg/azure-color-16'
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
<Rose::Form::Fieldset>
|
||||
<:title>{{t 'resources.host-set.form.preferred_endpoints.label'}}</:title>
|
||||
<:description>{{t
|
||||
'resources.host-set.form.preferred_endpoints.help'
|
||||
}}</:description>
|
||||
<:body>
|
||||
{{#if @model.errors.preferred_endpoints}}
|
||||
<Rose::Form::Errors as |errors|>
|
||||
{{#each @model.errors.preferred_endpoints as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</Rose::Form::Errors>
|
||||
{{/if}}
|
||||
<Rose::Table @style='condensed' as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row @hidden={{true}} as |row|>
|
||||
<row.headerCell>{{t 'titles.value'}}</row.headerCell>
|
||||
<row.headerCell />
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.preferred_endpoints as |endpoint i|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@value={{endpoint.value}}
|
||||
@error={{@model.errors.preferred_endpoints}}
|
||||
@contextual={{true}}
|
||||
placeholder='cidr:2001:4860:4860::8888/32'
|
||||
as |field|
|
||||
>
|
||||
<field.field />
|
||||
</form.input>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@style='warning'
|
||||
@iconOnly='flight-icons/svg/trash-16'
|
||||
title={{t 'actions.remove'}}
|
||||
@disabled={{if
|
||||
@model.isNew
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on 'click' (fn @removeItemByIndex 'preferred_endpoints' i)}}
|
||||
>
|
||||
{{t 'actions.remove'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.input
|
||||
@type='text'
|
||||
@value={{@model.preferred_endpoint}}
|
||||
placeholder='cidr:2001:4860:4860::8888/32'
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button
|
||||
@style='secondary'
|
||||
title={{t 'actions.add'}}
|
||||
@disabled={{if
|
||||
@model.isNew
|
||||
false
|
||||
(if form.isEditable false true)
|
||||
}}
|
||||
{{on
|
||||
'click'
|
||||
(fn
|
||||
@addStringItem
|
||||
'preferred_endpoints'
|
||||
@model.preferred_endpoint
|
||||
)
|
||||
}}
|
||||
>
|
||||
{{t 'actions.add'}}
|
||||
</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
</:body>
|
||||
</Rose::Form::Fieldset>
|
||||
|
||||
<form.textarea
|
||||
@name='filter'
|
||||
@type='filter'
|
||||
@value={{@model.filter}}
|
||||
@label={{t 'resources.host-set.form.filter.label'}}
|
||||
@helperText={{t 'resources.host-set.form.filter.help'}}
|
||||
@linkText={{t 'form. tiltes.learn-more'}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.filter}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.filter as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -1,63 +1,8 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
{{component
|
||||
(concat 'form/host-set/' @model.compositeType)
|
||||
model=@model
|
||||
submit=@submit
|
||||
cancel=@cancel
|
||||
removeItemByIndex=@removeItemByIndex
|
||||
addStringItem=@addStringItem
|
||||
}}
|
||||
@@ -0,0 +1,57 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -0,0 +1,97 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@error={{@model.errors.name}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@error={{@model.errors.description}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@disabled={{true}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.aws'}}
|
||||
@value={{@model.compositeType}}
|
||||
@layout='tile'
|
||||
@icon={{concat 'flight-icons/svg/' @model.compositeType '-color-16'}}
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.ip-addresses'}}</:title>
|
||||
<:body>
|
||||
{{#each @model.ip_addresses as |ip_address|}}
|
||||
|
||||
<form.input
|
||||
@value={{ip_address}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
{{/each}}
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -0,0 +1,97 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@error={{@model.errors.name}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@error={{@model.errors.description}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.provider'}}</:title>
|
||||
<:body>
|
||||
<form.radioGroup
|
||||
@name='provider'
|
||||
@selectedValue={{@model.compositeType}}
|
||||
@disabled={{true}}
|
||||
as |radioGroup|
|
||||
>
|
||||
<radioGroup.card
|
||||
@label={{t 'resources.host-catalog.types.azure'}}
|
||||
@value={{@model.compositeType}}
|
||||
@layout='tile'
|
||||
@icon={{concat 'flight-icons/svg/' @model.compositeType '-color-16'}}
|
||||
/>
|
||||
</form.radioGroup>
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
<form.fieldset>
|
||||
<:title>{{t 'titles.ip-addresses'}}</:title>
|
||||
<:body>
|
||||
{{#each @model.ip_addresses as |ip_address|}}
|
||||
|
||||
<form.input
|
||||
@value={{ip_address}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
{{/each}}
|
||||
</:body>
|
||||
</form.fieldset>
|
||||
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -1,82 +1,18 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@error={{@model.errors.name}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@error={{@model.errors.description}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.input
|
||||
@name='address'
|
||||
@type='text'
|
||||
@value={{@model.attributes.address}}
|
||||
@label={{t 'form.address.label'}}
|
||||
@error={{@model.errors.name}}
|
||||
@helperText={{t 'form.address.help'}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
{{#if @model.compositeType}}
|
||||
{{component
|
||||
(concat 'form/host/' @model.compositeType)
|
||||
model=@model
|
||||
submit=@submit
|
||||
cancel=@cancel
|
||||
}}
|
||||
{{else}}
|
||||
{{! 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
|
||||
submit=@submit
|
||||
cancel=@cancel
|
||||
}}
|
||||
{{/if}}
|
||||
@@ -0,0 +1,82 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t 'form.type.label'}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}}
|
||||
/>
|
||||
|
||||
<form.input
|
||||
@name='name'
|
||||
@type='name'
|
||||
@value={{@model.name}}
|
||||
@label={{t 'form.name.label'}}
|
||||
@error={{@model.errors.name}}
|
||||
@helperText={{t 'form.name.help'}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name='description'
|
||||
@type='description'
|
||||
@value={{@model.description}}
|
||||
@label={{t 'form.description.label'}}
|
||||
@error={{@model.errors.description}}
|
||||
@helperText={{t 'form.description.help'}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.input
|
||||
@name='address'
|
||||
@type='text'
|
||||
@value={{@model.address}}
|
||||
@label={{t 'form.address.label'}}
|
||||
@error={{@model.errors.address}}
|
||||
@helperText={{t 'form.address.help'}}
|
||||
readonly={{false}}
|
||||
as |field|
|
||||
>
|
||||
{{#if @model.errors.address}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.address as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
{{#if (can 'save model' @model)}}
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t 'actions.edit-form'}}
|
||||
@submitText={{t 'actions.save'}}
|
||||
@cancelText={{t 'actions.cancel'}}
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Form>
|
||||
@@ -34,9 +34,7 @@
|
||||
</row.cell>
|
||||
<row.cell>{{hostSet.name}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t
|
||||
(concat 'resources.host-set.types.' hostSet.type)
|
||||
}}</Rose::Badge>
|
||||
<HostCatalogTypeBadge @model={{hostSet}} />
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<code>{{hostSet.host_catalog_id}}</code>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{{#if @model.isStatic}}
|
||||
<Rose::Badge>
|
||||
{{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{else if @model.isUnknown}}
|
||||
<Rose::Badge>
|
||||
{{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{else}}
|
||||
<Rose::Badge
|
||||
@icon={{concat 'flight-icons/svg/' @model.compositeType '-color-16'}}
|
||||
>
|
||||
{{t (concat 'resources.host-catalog.types.' @model.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
@@ -0,0 +1,7 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeHostCatalogsNewController extends Controller {
|
||||
// =attributes
|
||||
|
||||
queryParams = ['type'];
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { action } from '@ember/object';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetRoute extends Route {
|
||||
// =methods
|
||||
@@ -49,4 +50,30 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetRoute exte
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a string item to array `property` on the passed `filter`.
|
||||
|
||||
* @param {hostSetModel} hostSet
|
||||
* @param {string} property
|
||||
* @param {string} value
|
||||
*/
|
||||
@action
|
||||
async addStringItem(hostSet, property, value) {
|
||||
const array = hostSet.get(property);
|
||||
array.addObject({ value });
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an item from array `property` at `index` on the
|
||||
* passed `hostSet`.
|
||||
* @param {hostSetModel} hostSet
|
||||
* @param {string} property
|
||||
* @param {number} index
|
||||
*/
|
||||
@action
|
||||
async removeItemByIndex(hostSet, property, index) {
|
||||
const array = hostSet.get(property);
|
||||
array.removeAt(index);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,22 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends Route {
|
||||
// =methods
|
||||
// =services
|
||||
@service router;
|
||||
|
||||
// =methods
|
||||
/**
|
||||
* Creates a new unsaved host set in current host catalog scope.
|
||||
* @return {HostSetModel}
|
||||
*/
|
||||
model() {
|
||||
const { id: host_catalog_id } = this.modelFor(
|
||||
const { id: host_catalog_id, compositeType } = this.modelFor(
|
||||
'scopes.scope.host-catalogs.host-catalog'
|
||||
);
|
||||
return this.store.createRecord('host-set', {
|
||||
type: 'static',
|
||||
compositeType,
|
||||
host_catalog_id,
|
||||
});
|
||||
}
|
||||
@@ -47,4 +51,29 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends
|
||||
model: model,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a string item to array `property` on the passed `filter`.
|
||||
|
||||
* @param {hostSetModel} hostSet
|
||||
* @param {string} property
|
||||
* @param {string} value
|
||||
*/
|
||||
@action
|
||||
async addStringItem(hostSet, property, value) {
|
||||
const array = hostSet.get(property);
|
||||
array.addObject({ value });
|
||||
}
|
||||
/**
|
||||
* Removes an item from array `property` at `index` on the
|
||||
* passed `hostSet`.
|
||||
* @param {hostSetModel} hostSet
|
||||
* @param {string} property
|
||||
* @param {number} index
|
||||
*/
|
||||
@action
|
||||
async removeItemByIndex(hostSet, property, index) {
|
||||
const array = hostSet.get(property);
|
||||
array.removeAt(index);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,54 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeHostCatalogsNewRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service router;
|
||||
|
||||
// =attributes
|
||||
|
||||
queryParams = {
|
||||
type: {
|
||||
refreshModel: true,
|
||||
},
|
||||
};
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved host catalog belonging to the current scope.
|
||||
* Also rollback/destroy any new, unsaved instances from this route before
|
||||
* creating another, but reuse name/description if available.
|
||||
* @return {HostCatalogModel}
|
||||
*/
|
||||
model() {
|
||||
model({ type: compositeType = 'static' }) {
|
||||
const scopeModel = this.modelFor('scopes.scope');
|
||||
let name, description, disable_credential_rotation;
|
||||
if (this.currentModel?.isNew) {
|
||||
({ name, description } = this.currentModel);
|
||||
this.currentModel.rollbackAttributes();
|
||||
}
|
||||
if (compositeType === 'azure') {
|
||||
disable_credential_rotation = true;
|
||||
}
|
||||
return this.store.createRecord('host-catalog', {
|
||||
type: 'static',
|
||||
scopeModel,
|
||||
compositeType,
|
||||
name,
|
||||
description,
|
||||
disable_credential_rotation,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update type of host catalog
|
||||
* @param {string} type
|
||||
*/
|
||||
@action
|
||||
changeType(type) {
|
||||
if (type === 'plugin') type = 'aws';
|
||||
this.router.replaceWith({ queryParams: { type } });
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -14,9 +14,9 @@
|
||||
>
|
||||
{{t 'resources.host-set.actions.add-hosts'}}
|
||||
</dropdown.link>
|
||||
<dropdown.separator />
|
||||
{{/if}}
|
||||
{{#if (can 'delete model' @model)}}
|
||||
<dropdown.separator />
|
||||
<dropdown.button
|
||||
@style='danger'
|
||||
@disabled={{@model.canSave}}
|
||||
|
||||
+4
-2
@@ -8,7 +8,9 @@
|
||||
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'titles.actions'}}</row.headerCell>
|
||||
{{#if @model.isStatic}}
|
||||
<row.headerCell>{{t 'titles.actions'}}</row.headerCell>
|
||||
{{/if}}
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
@@ -24,7 +26,7 @@
|
||||
<p>{{host.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{host.type}}</Rose::Badge>
|
||||
<HostCatalogTypeBadge @model={{host}} />
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
|
||||
+2
@@ -2,4 +2,6 @@
|
||||
@model={{@model}}
|
||||
@submit={{route-action 'save' @model}}
|
||||
@cancel={{route-action 'cancel' @model}}
|
||||
@removeItemByIndex={{route-action 'removeItemByIndex' @model}}
|
||||
@addStringItem={{route-action 'addStringItem' @model}}
|
||||
/>
|
||||
@@ -25,21 +25,7 @@
|
||||
<p>{{hostSet.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
{{#if hostSet.isStatic}}
|
||||
<Rose::Badge>
|
||||
{{t (concat 'resources.host-set.types.' hostSet.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{else}}
|
||||
<Rose::Badge
|
||||
@icon={{concat
|
||||
'flight-icons/svg/'
|
||||
hostSet.compositeType
|
||||
'-color-16'
|
||||
}}
|
||||
>
|
||||
{{t (concat 'resources.host-set.types.' hostSet.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
<HostCatalogTypeBadge @model={{hostSet}} />
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
|
||||
@@ -4,4 +4,6 @@
|
||||
@model={{@model}}
|
||||
@submit={{route-action 'save' @model}}
|
||||
@cancel={{route-action 'cancel' @model}}
|
||||
@removeItemByIndex={{route-action 'removeItemByIndex' @model}}
|
||||
@addStringItem={{route-action 'addStringItem' @model}}
|
||||
/>
|
||||
@@ -27,21 +27,7 @@
|
||||
<p>{{host.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
{{#if host.isStatic}}
|
||||
<Rose::Badge>
|
||||
{{t (concat 'resources.host.types.' host.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{else}}
|
||||
<Rose::Badge
|
||||
@icon={{concat
|
||||
'flight-icons/svg/'
|
||||
host.compositeType
|
||||
'-color-16'
|
||||
}}
|
||||
>
|
||||
{{t (concat 'resources.host.types.' host.compositeType)}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
<HostCatalogTypeBadge @model={{host}} />
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@@ -53,7 +39,7 @@
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<code>{{host.attributes.address}}</code>
|
||||
<code>{{host.address}}</code>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
|
||||
@@ -56,40 +56,7 @@
|
||||
<p>{{hostCatalog.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
{{#if hostCatalog.isStatic}}
|
||||
<Rose::Badge>
|
||||
{{t
|
||||
(concat
|
||||
'resources.host-catalog.types.'
|
||||
hostCatalog.compositeType
|
||||
)
|
||||
}}
|
||||
</Rose::Badge>
|
||||
{{else if hostCatalog.isUnknown}}
|
||||
<Rose::Badge>
|
||||
{{t
|
||||
(concat
|
||||
'resources.host-catalog.types.'
|
||||
hostCatalog.compositeType
|
||||
)
|
||||
}}
|
||||
</Rose::Badge>
|
||||
{{else}}
|
||||
<Rose::Badge
|
||||
@icon={{concat
|
||||
'flight-icons/svg/'
|
||||
hostCatalog.compositeType
|
||||
'-color-16'
|
||||
}}
|
||||
>
|
||||
{{t
|
||||
(concat
|
||||
'resources.host-catalog.types.'
|
||||
hostCatalog.compositeType
|
||||
)
|
||||
}}
|
||||
</Rose::Badge>
|
||||
{{/if}}
|
||||
<HostCatalogTypeBadge @model={{hostCatalog}} />
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
@model={{@model}}
|
||||
@submit={{route-action 'save' @model}}
|
||||
@cancel={{route-action 'cancel' @model}}
|
||||
@changeType={{route-action 'changeType'}}
|
||||
@doc='host-catalog.set-up-cloud-hosts'
|
||||
/>
|
||||
</page.body>
|
||||
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
<p>{{hostSet.model.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t
|
||||
(concat 'resources.host-set.types.' hostSet.model.type)
|
||||
}}</Rose::Badge>
|
||||
<HostCatalogTypeBadge @model={{hostSet.model}} />
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
|
||||
@@ -53,6 +53,7 @@ module.exports = function (environment) {
|
||||
'group.add-members': '/groups/add-members',
|
||||
'host-catalog': '/host-catalogs',
|
||||
'host-catalog.new': '/host-catalogs/new',
|
||||
'host-catalog.set-up-cloud-hosts': '/host-catalog-set-up-cloud-hosts',
|
||||
'host-set': '/host-sets',
|
||||
'host-set.new': '/host-sets/new',
|
||||
'host-set.add-hosts': '/host-sets/add-hosts',
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"@babel/core": "^7.16.5",
|
||||
"@ember/optional-features": "^2.0.0",
|
||||
"@ember/render-modifiers": "^2.0.2",
|
||||
"@ember/test-helpers": "^2.4.2",
|
||||
"@ember/test-helpers": "^2.6.0",
|
||||
"@glimmer/component": "^1.0.4",
|
||||
"@glimmer/tracking": "^1.0.4",
|
||||
"babel-eslint": "^10.1.0",
|
||||
@@ -46,7 +46,7 @@
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"clipboard": "^2.0.8",
|
||||
"core": "*",
|
||||
"doctoc": "^2.0.1",
|
||||
"doctoc": "^2.1.0",
|
||||
"ember-a11y-testing": "^4.2.0",
|
||||
"ember-auto-import": "^1.12.0",
|
||||
"ember-breadcrumbs": "^0.2.3",
|
||||
|
||||
@@ -31,6 +31,8 @@ module('Acceptance | host-catalogs | create', function (hooks) {
|
||||
hostCatalogs: null,
|
||||
hostCatalog: null,
|
||||
newHostCatalog: null,
|
||||
newStaticHostCatalog: null,
|
||||
newDynamicHostCatalog: null,
|
||||
};
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
@@ -64,6 +66,8 @@ module('Acceptance | host-catalogs | create', function (hooks) {
|
||||
|
||||
urls.hostCatalog = `${urls.hostCatalogs}/${instances.hostCatalog.id}`;
|
||||
urls.newHostCatalog = `${urls.hostCatalogs}/new`;
|
||||
urls.newStaticHostCatalog = `${urls.newHostCatalog}?type=static`;
|
||||
urls.newDynamicHostCatalog = `${urls.newHostCatalog}?type=aws`;
|
||||
// Generate resource couner
|
||||
gethostCatalogCount = () =>
|
||||
this.server.schema.hostCatalogs.all().models.length;
|
||||
@@ -71,26 +75,49 @@ module('Acceptance | host-catalogs | create', function (hooks) {
|
||||
authenticateSession({});
|
||||
});
|
||||
|
||||
test('Users can create new host catalogs', async function (assert) {
|
||||
test('Users can create new static host catalogs', async function (assert) {
|
||||
assert.expect(1);
|
||||
const count = gethostCatalogCount();
|
||||
await visit(urls.newHostCatalog);
|
||||
await visit(urls.newStaticHostCatalog);
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await fillIn('[name="description"]', 'random string');
|
||||
await fillIn('[name="types"]', 'static');
|
||||
await click('[type="submit"]');
|
||||
assert.equal(gethostCatalogCount(), count + 1);
|
||||
});
|
||||
|
||||
test('Users can cancel create new host catalogs', async function (assert) {
|
||||
test('Users can create new dynamic host catalogs', async function (assert) {
|
||||
assert.expect(1);
|
||||
const count = gethostCatalogCount();
|
||||
await visit(urls.newDynamicHostCatalog);
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await fillIn('[name="description"]', 'random string');
|
||||
await fillIn('[name="types"]', 'aws');
|
||||
await click('[type="submit"]');
|
||||
assert.equal(gethostCatalogCount(), count + 1);
|
||||
});
|
||||
|
||||
test('Users can cancel creation of new static host catalogs', async function (assert) {
|
||||
assert.expect(2);
|
||||
const count = gethostCatalogCount();
|
||||
await visit(urls.newHostCatalog);
|
||||
await visit(urls.newStaticHostCatalog);
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('.rose-form-actions [type="button"]');
|
||||
assert.equal(currentURL(), urls.hostCatalogs);
|
||||
assert.equal(gethostCatalogCount(), count);
|
||||
});
|
||||
|
||||
test('Users can navigate to new host catalogs route with proper authorization', async function (assert) {
|
||||
test('Users can cancel creation of new dynamic host catalogs', async function (assert) {
|
||||
assert.expect(2);
|
||||
const count = gethostCatalogCount();
|
||||
await visit(urls.newDynamicHostCatalog);
|
||||
await fillIn('[name="name"]', 'random string');
|
||||
await click('.rose-form-actions [type="button"]');
|
||||
assert.equal(currentURL(), urls.hostCatalogs);
|
||||
assert.equal(gethostCatalogCount(), count);
|
||||
});
|
||||
|
||||
test('Users can navigate to new static host catalogs route with proper authorization', async function (assert) {
|
||||
assert.expect(2);
|
||||
await visit(urls.hostCatalogs);
|
||||
assert.ok(
|
||||
@@ -101,7 +128,7 @@ module('Acceptance | host-catalogs | create', function (hooks) {
|
||||
assert.ok(find(`[href="${urls.newHostCatalog}"]`));
|
||||
});
|
||||
|
||||
test('Users cannot navigate to new host catalogs route without proper authorization', async function (assert) {
|
||||
test('Users cannot navigate to new static host catalogs route without proper authorization', async function (assert) {
|
||||
assert.expect(2);
|
||||
instances.scopes.project.authorized_collection_actions['host-catalogs'] =
|
||||
[];
|
||||
@@ -111,10 +138,10 @@ module('Acceptance | host-catalogs | create', function (hooks) {
|
||||
'host-catalogs'
|
||||
].includes('create')
|
||||
);
|
||||
assert.notOk(find(`[href="${urls.newHostCatalog}"]`));
|
||||
assert.notOk(find(`[href="${urls.newStaticHostCatalog}"]`));
|
||||
});
|
||||
|
||||
test('saving a new host catalog with invalid fields displays error messages', async function (assert) {
|
||||
test('saving a new static host catalog with invalid fields displays error messages', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.post('/host-catalogs', () => {
|
||||
return new Response(
|
||||
@@ -135,7 +162,7 @@ module('Acceptance | host-catalogs | create', function (hooks) {
|
||||
}
|
||||
);
|
||||
});
|
||||
await visit(urls.newHostCatalog);
|
||||
await visit(urls.newStaticHostCatalog);
|
||||
await click('[type="submit"]');
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/host-catalogs/new', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/host-catalogs/new'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user