-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidebranch: UI transform create and edit clean up #9778
Changes from all commits
ffad004
62051f1
5713153
93f67f7
3b40eba
ae6e14f
100a8d2
7997a50
26b839b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import RoleEdit from './role-edit'; | ||
|
||
export default RoleEdit.extend({ | ||
init() { | ||
this._super(...arguments); | ||
this.set('backendType', 'transform'); | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<form onsubmit={{action "createOrUpdate" "create"}}> | ||
<div class="box is-sideless is-fullwidth is-marginless"> | ||
{{message-error model=model}} | ||
{{!-- TODO: figure out what this ?? --}} | ||
{{!-- <NamespaceReminder @mode={{mode}} @noun="SSH role" /> --}} | ||
{{#each model.transformFieldAttrs as |attr|}} | ||
{{#if (eq attr.name 'templates')}} | ||
{{!-- TODO: for now don't show until backend makes api changes. --}} | ||
{{else if (eq attr.name 'template')}} | ||
<FormField | ||
data-test-field | ||
@attr={{attr}} | ||
@model={{model}} | ||
@selectLimit={{selectLimit}} | ||
/> | ||
{{else}} | ||
<FormField | ||
data-test-field | ||
@attr={{attr}} | ||
@model={{model}} | ||
/> | ||
{{/if}} | ||
{{/each}} | ||
</div> | ||
<div class="field is-grouped-split box is-fullwidth is-bottomless"> | ||
<div class="control"> | ||
<button | ||
type="submit" | ||
disabled={{buttonDisabled}} | ||
class="button is-primary" | ||
data-test-role-ssh-create=true | ||
> | ||
{{#if (eq mode 'create')}} | ||
Create transformation | ||
{{else if (eq mode 'edit')}} | ||
Save | ||
{{/if}} | ||
</button> | ||
{{#secret-link | ||
mode=(if (eq mode "create") "list" "show") | ||
class="button" | ||
secret=model.id | ||
}} | ||
Cancel | ||
{{/secret-link}} | ||
</div> | ||
</div> | ||
</form> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,10 @@ | |
@onChange={{action (action "setAndBroadcast" valuePath)}} @inputValue={{get model valuePath}} | ||
@helpText={{attr.options.helpText}} @subText={{attr.options.subText}} @label={{labelString}} | ||
@subLabel={{attr.options.subLabel}} | ||
@fallbackComponent={{attr.options.fallbackComponent}} /> | ||
@fallbackComponent={{attr.options.fallbackComponent}} | ||
@initialSelected={{initialSelected}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should pass the initialSelected and selectLimit on the attr so it follows convention for how this component is used. Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with that is initialSelected isn't known on the model (which is where attr.options comes from). SelectLimit can be though. |
||
@selectLimit={{attr.options.selectLimit}} | ||
/> | ||
</div> | ||
{{else if (eq attr.options.editType "mountAccessor")}} | ||
{{mount-accessor-select | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not waiting on two promises this can probably be simplified to returning the single promise above (this.ajax)