-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI variables made to be unique by namespace and path (#14072)
* Starting on namespaced id * Traversal for variables uniqued by namespace * Delog * Basic CRUD complete w namespaces included * Correct secvar breadcrumb joining and testfix now that namespaces are included * Testfixes with namespaces in place * Namespace-aware duplicate path warning * Duplicate path warning test additions * Trimpath reimplemented on dupe check * Solves a bug where slash was not being passed to the can write check * PR fixes * variable paths integration test fix now uses store * Seems far less hacky in retrospect * PR feedback addressed * test fixes after inclusion of path as local non-model var * Prevent confusion by dropping namespace from QPs on PUT, since its already in .data * Solves a harsh bug where you have namespace access but no secvars access (#14098) * Solves a harsh bug where you have namespace access but no secvars access * Lint cleanup * Remove unneeded condition
- Loading branch information
1 parent
ed55b97
commit 9f51a5d
Showing
24 changed files
with
289 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import Route from '@ember/routing/route'; | ||
import WithForbiddenState from 'nomad-ui/mixins/with-forbidden-state'; | ||
import notifyForbidden from 'nomad-ui/utils/notify-forbidden'; | ||
|
||
export default class VariablesIndexRoute extends Route { | ||
export default class VariablesIndexRoute extends Route.extend( | ||
WithForbiddenState | ||
) { | ||
model() { | ||
const { variables, pathTree } = this.modelFor('variables'); | ||
return { | ||
variables, | ||
root: pathTree.paths.root, | ||
}; | ||
if (this.modelFor('variables').errors) { | ||
notifyForbidden(this)(this.modelFor('variables')); | ||
} else { | ||
const { variables, pathTree } = this.modelFor('variables'); | ||
return { | ||
variables, | ||
root: pathTree.paths.root, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import Route from '@ember/routing/route'; | ||
export default class VariablesPathRoute extends Route { | ||
import WithForbiddenState from 'nomad-ui/mixins/with-forbidden-state'; | ||
import notifyForbidden from 'nomad-ui/utils/notify-forbidden'; | ||
export default class VariablesPathRoute extends Route.extend( | ||
WithForbiddenState | ||
) { | ||
model({ absolutePath }) { | ||
const treeAtPath = | ||
this.modelFor('variables').pathTree.findPath(absolutePath); | ||
if (treeAtPath) { | ||
return { treeAtPath, absolutePath }; | ||
if (this.modelFor('variables').errors) { | ||
notifyForbidden(this)(this.modelFor('variables')); | ||
} else { | ||
return { absolutePath }; | ||
const treeAtPath = | ||
this.modelFor('variables').pathTree.findPath(absolutePath); | ||
if (treeAtPath) { | ||
return { treeAtPath, absolutePath }; | ||
} else { | ||
return { absolutePath }; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.