Mostly user-facing renames and a few test renames
This commit is contained in:
parent
2b4996e070
commit
eedee3e53d
|
@ -200,7 +200,7 @@ export default class VariableFormComponent extends Component {
|
|||
await this.args.model.save({ adapterOptions: { overwrite } });
|
||||
|
||||
this.flashMessages.add({
|
||||
title: 'Secure Variable saved',
|
||||
title: 'Variable saved',
|
||||
message: `${this.path} successfully saved`,
|
||||
type: 'success',
|
||||
destroyOnClick: false,
|
||||
|
@ -302,15 +302,13 @@ export default class VariableFormComponent extends Component {
|
|||
throw new Error('Invalid JSON');
|
||||
}
|
||||
|
||||
// "myString" is valid JSON, but it's not a valid Secure Variable.
|
||||
// Ditto for an array of objects. We expect a single object to be a Secure Variable.
|
||||
// "myString" is valid JSON, but it's not a valid Variable.
|
||||
// Ditto for an array of objects. We expect a single object to be a Variable.
|
||||
const hasFormatErrors =
|
||||
JSON.parse(value) instanceof Array ||
|
||||
typeof JSON.parse(value) !== 'object';
|
||||
if (hasFormatErrors) {
|
||||
throw new Error(
|
||||
'A Secure Variable must be formatted as a single JSON object'
|
||||
);
|
||||
throw new Error('A Variable must be formatted as a single JSON object');
|
||||
}
|
||||
|
||||
set(this, 'JSONError', null);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<p class="related-entities notification">
|
||||
<FlightIcon @name="info-fill" @color="var(--blue)" />
|
||||
<span>
|
||||
This secure variable {{#if @new}}will be{{else}}is{{/if}} accessible by
|
||||
This variable {{#if @new}}will be{{else}}is{{/if}} accessible by
|
||||
{{#if @task}}
|
||||
task <strong>{{@task}}</strong> in group <LinkTo @route="jobs.job.task-group" @models={{array (concat @job "@" @namespace) @group}}>{{@group}} <FlightIcon @name="external-link" /></LinkTo>
|
||||
{{else if @group}}
|
||||
|
|
|
@ -40,7 +40,7 @@ export default class VariablesVariableIndexController extends Controller {
|
|||
this.router.transitionTo('variables');
|
||||
}
|
||||
this.flashMessages.add({
|
||||
title: 'Secure Variable deleted',
|
||||
title: 'Variable deleted',
|
||||
message: `${this.model.path} successfully deleted`,
|
||||
type: 'success',
|
||||
destroyOnClick: false,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<Breadcrumb @crumb={{hash label="Secure Variables" args=(array "variables.index")}} />
|
||||
<Breadcrumb @crumb={{hash label="Variables" args=(array "variables.index")}} />
|
||||
<PageLayout>
|
||||
{{outlet}}
|
||||
</PageLayout>
|
|
@ -1,4 +1,4 @@
|
|||
{{page-title "Secure Variables"}}
|
||||
{{page-title "Variables"}}
|
||||
<section class="section">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-item is-right-aligned is-mobile-full-width">
|
||||
|
@ -18,7 +18,7 @@
|
|||
class="button is-primary"
|
||||
data-test-create-var
|
||||
>
|
||||
Create Secure Variable
|
||||
Create Variable
|
||||
</LinkTo>
|
||||
{{else}}
|
||||
<button
|
||||
|
@ -28,7 +28,7 @@
|
|||
type="button"
|
||||
data-test-disabled-create-var
|
||||
>
|
||||
Create Secure Variable
|
||||
Create Variable
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
|
@ -46,11 +46,11 @@
|
|||
<div class="empty-message">
|
||||
{{#if (eq this.namespaceSelection "*")}}
|
||||
<h3 data-test-empty-variables-list-headline class="empty-message-headline">
|
||||
No Secure Variables
|
||||
No Variables
|
||||
</h3>
|
||||
{{#if (can "write variable" path="*" namespace=this.namespaceSelection)}}
|
||||
<p class="empty-message-body">
|
||||
Get started by <LinkTo @route="variables.new">creating a new secure variable</LinkTo>
|
||||
Get started by <LinkTo @route="variables.new">creating a new variable</LinkTo>
|
||||
</p>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{page-title "Secure Variables: " this.absolutePath}}
|
||||
{{page-title "Variables: " this.absolutePath}}
|
||||
{{#each this.breadcrumbs as |crumb|}}
|
||||
<Breadcrumb @crumb={{crumb}} />
|
||||
{{/each}}
|
||||
|
@ -21,7 +21,7 @@
|
|||
@query={{hash path=(concat this.absolutePath "/")}}
|
||||
class="button is-primary"
|
||||
>
|
||||
Create Secure Variable
|
||||
Create Variable
|
||||
</LinkTo>
|
||||
{{else}}
|
||||
<button
|
||||
|
@ -30,7 +30,7 @@
|
|||
disabled
|
||||
type="button"
|
||||
>
|
||||
Create Secure Variable
|
||||
Create Variable
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -50,7 +50,7 @@
|
|||
Path /{{this.absolutePath}} contains no variables
|
||||
</h3>
|
||||
<p class="empty-message-body">
|
||||
To get started, <LinkTo @route="variables.new" @query={{hash path=(concat this.absolutePath "/")}}>create a new secure variable here</LinkTo>, or <LinkTo @route="variables">go back to the Secure Variables root directory</LinkTo>.
|
||||
To get started, <LinkTo @route="variables.new" @query={{hash path=(concat this.absolutePath "/")}}>create a new variable here</LinkTo>, or <LinkTo @route="variables">go back to the Variables root directory</LinkTo>.
|
||||
</p>
|
||||
{{else}}
|
||||
<h3 data-test-no-matching-variables-list-headline class="empty-message-headline">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{page-title "Secure Variables: " this.model.path}}
|
||||
{{page-title "Variables: " this.model.path}}
|
||||
{{#each this.breadcrumbs as |crumb|}}
|
||||
<Breadcrumb @crumb={{crumb}} />
|
||||
{{/each}}
|
||||
|
|
|
@ -10,9 +10,9 @@ import { trimPath } from '../helpers/trim-path';
|
|||
/**
|
||||
* @typedef {Object} VariableFile
|
||||
* @property {string} path - the folder path containing our "file", relative to parent
|
||||
* @property {string} name - the secure variable "file" name
|
||||
* @property {string} name - the variable "file" name
|
||||
* @property {string} absoluteFilePath - the folder path containing our "file", absolute
|
||||
* @property {VariableModel} variable - the secure variable itself
|
||||
* @property {VariableModel} variable - the variable itself
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -837,7 +837,7 @@ export default function () {
|
|||
}
|
||||
);
|
||||
|
||||
//#region Secure Variables
|
||||
//#region Variables
|
||||
|
||||
this.get('/vars', function (schema, { queryParams: { namespace } }) {
|
||||
if (namespace && namespace !== '*') {
|
||||
|
@ -883,7 +883,7 @@ export default function () {
|
|||
return '';
|
||||
});
|
||||
|
||||
//#endregion Secure Variables
|
||||
//#endregion Variables
|
||||
}
|
||||
|
||||
function filterKeys(object, ...keys) {
|
||||
|
|
|
@ -28,7 +28,7 @@ export default Factory.extend({
|
|||
|
||||
token.update({ policyIds });
|
||||
|
||||
// Create a special policy with secure variables rules in place
|
||||
// Create a special policy with variables rules in place
|
||||
if (token.id === '53cur3-v4r14bl35') {
|
||||
const variableMakerPolicy = {
|
||||
id: 'Variable Maker',
|
||||
|
@ -37,8 +37,8 @@ export default Factory.extend({
|
|||
namespace "*" {
|
||||
policy = "read"
|
||||
capabilities = ["list-jobs", "alloc-exec", "read-logs"]
|
||||
secure_variables {
|
||||
# Base access is to all abilities for all secure variables
|
||||
variables {
|
||||
# Base access is to all abilities for all variables
|
||||
path "*" {
|
||||
capabilities = ["list", "read", "destroy", "create"]
|
||||
}
|
||||
|
@ -78,8 +78,8 @@ node {
|
|||
namespace "*" {
|
||||
policy = "read"
|
||||
capabilities = ["list-jobs", "alloc-exec", "read-logs"]
|
||||
secure_variables {
|
||||
# Base access is to all abilities for all secure variables
|
||||
variables {
|
||||
# Base access is to all abilities for all variables
|
||||
path "*" {
|
||||
capabilities = ["list"]
|
||||
}
|
||||
|
@ -89,8 +89,8 @@ namespace "*" {
|
|||
namespace "namespace-1" {
|
||||
policy = "read"
|
||||
capabilities = ["list-jobs", "alloc-exec", "read-logs"]
|
||||
secure_variables {
|
||||
# Base access is to all abilities for all secure variables
|
||||
variables {
|
||||
# Base access is to all abilities for all variables
|
||||
path "*" {
|
||||
capabilities = ["list", "read", "destroy", "create"]
|
||||
}
|
||||
|
@ -100,8 +100,8 @@ namespace "namespace-1" {
|
|||
namespace "namespace-2" {
|
||||
policy = "read"
|
||||
capabilities = ["list-jobs", "alloc-exec", "read-logs"]
|
||||
secure_variables {
|
||||
# Base access is to all abilities for all secure variables
|
||||
variables {
|
||||
# Base access is to all abilities for all variables
|
||||
path "blue/*" {
|
||||
capabilities = ["list", "read", "destroy", "create"]
|
||||
}
|
||||
|
|
|
@ -61,17 +61,17 @@ module('Unit | Utility | path-tree', function () {
|
|||
assert.equal(
|
||||
Object.keys(tree.findPath('a/b').files).length,
|
||||
4,
|
||||
'Multiple files are listed at a found non-terminal compacted path with many secure variables'
|
||||
'Multiple files are listed at a found non-terminal compacted path with many variables'
|
||||
);
|
||||
assert.equal(
|
||||
Object.keys(tree.findPath('a/b/c/doberman').files).length,
|
||||
1,
|
||||
'One file listed at a found compacted path with a single secure variable'
|
||||
'One file listed at a found compacted path with a single variable'
|
||||
);
|
||||
assert.equal(
|
||||
Object.keys(tree.findPath('a/b/c/dachshund').files).length,
|
||||
2,
|
||||
'Multiple files listed at a found terminal compacted path with many secure variables'
|
||||
'Multiple files listed at a found terminal compacted path with many variables'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue