mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Adds N V for variable creation as a keyboard shortcut (#17932)
This commit is contained in:
3
.changelog/17932.txt
Normal file
3
.changelog/17932.txt
Normal file
@@ -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);
|
||||
}
|
||||
|
||||
@action goToNewVariable() {
|
||||
this.router.transitionTo('variables.new');
|
||||
}
|
||||
|
||||
@controller variables;
|
||||
|
||||
@action
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
*/
|
||||
|
||||
import Controller, { inject as controller } from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
|
||||
const ALL_NAMESPACE_WILDCARD = '*';
|
||||
|
||||
export default class VariablesPathController extends Controller {
|
||||
@service router;
|
||||
|
||||
get 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;
|
||||
|
||||
@action
|
||||
|
||||
@@ -22,6 +22,11 @@
|
||||
@route="variables.new"
|
||||
class="button is-primary"
|
||||
data-test-create-var
|
||||
{{keyboard-shortcut
|
||||
pattern=(array "n" "v")
|
||||
action=(action this.goToNewVariable)
|
||||
label="Create Variable"
|
||||
}}
|
||||
>
|
||||
Create Variable
|
||||
</LinkTo>
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
@route="variables.new"
|
||||
@query={{hash path=(concat this.absolutePath "/")}}
|
||||
class="button is-primary"
|
||||
{{keyboard-shortcut
|
||||
pattern=(array "n" "v")
|
||||
action=(action this.goToNewVariable)
|
||||
label="Create Variable"
|
||||
}}
|
||||
>
|
||||
Create Variable
|
||||
</LinkTo>
|
||||
|
||||
Reference in New Issue
Block a user