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);
|
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>
|
||||||
|
|||||||
Reference in New Issue
Block a user