backport of commit 715764bfe448fc6a80ca3858377b4f760d39c611 (#18010)
This pull request was automerged via backport-assistant
This commit is contained in:
parent
963b2d97b2
commit
d3b1d58c4d
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:improvement
|
||||||
|
ui: adds a keyboard shortcut for Create Variable
|
||||||
|
```
|
|
@ -20,6 +20,10 @@ export default class VariablesIndexController extends Controller {
|
||||||
this.router.transitionTo('variables.variable', variable.path);
|
this.router.transitionTo('variables.variable', variable.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action goToNewVariable() {
|
||||||
|
this.router.transitionTo('variables.new');
|
||||||
|
}
|
||||||
|
|
||||||
@controller variables;
|
@controller variables;
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
@ -4,11 +4,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Controller, { inject as controller } from '@ember/controller';
|
import Controller, { inject as controller } from '@ember/controller';
|
||||||
|
import { inject as service } from '@ember/service';
|
||||||
import { action } from '@ember/object';
|
import { action } from '@ember/object';
|
||||||
|
|
||||||
const ALL_NAMESPACE_WILDCARD = '*';
|
const ALL_NAMESPACE_WILDCARD = '*';
|
||||||
|
|
||||||
export default class VariablesPathController extends Controller {
|
export default class VariablesPathController extends Controller {
|
||||||
|
@service router;
|
||||||
|
|
||||||
get absolutePath() {
|
get absolutePath() {
|
||||||
return this.model?.absolutePath || '';
|
return this.model?.absolutePath || '';
|
||||||
}
|
}
|
||||||
|
@ -28,6 +31,12 @@ export default class VariablesPathController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action goToNewVariable() {
|
||||||
|
this.router.transitionTo('variables.new', {
|
||||||
|
queryParams: { path: `${this.absolutePath}/` },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@controller variables;
|
@controller variables;
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
@ -22,6 +22,11 @@
|
||||||
@route="variables.new"
|
@route="variables.new"
|
||||||
class="button is-primary"
|
class="button is-primary"
|
||||||
data-test-create-var
|
data-test-create-var
|
||||||
|
{{keyboard-shortcut
|
||||||
|
pattern=(array "n" "v")
|
||||||
|
action=(action this.goToNewVariable)
|
||||||
|
label="Create Variable"
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Create Variable
|
Create Variable
|
||||||
</LinkTo>
|
</LinkTo>
|
||||||
|
|
|
@ -25,6 +25,11 @@
|
||||||
@route="variables.new"
|
@route="variables.new"
|
||||||
@query={{hash path=(concat this.absolutePath "/")}}
|
@query={{hash path=(concat this.absolutePath "/")}}
|
||||||
class="button is-primary"
|
class="button is-primary"
|
||||||
|
{{keyboard-shortcut
|
||||||
|
pattern=(array "n" "v")
|
||||||
|
action=(action this.goToNewVariable)
|
||||||
|
label="Create Variable"
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Create Variable
|
Create Variable
|
||||||
</LinkTo>
|
</LinkTo>
|
||||||
|
|
Loading…
Reference in New Issue