mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
* basic-functionality demo for token CRUD * Styling for tokens crud * Tokens crud styles * Expires, not expiry * Mobile styles etc * Refresh and redirect rules for policy save and token creation * Delete method and associated serializer change * Ability-checking for tokens * Update policies acceptance tests to reflect new redirect rules * Token ability unit tests * Mirage config methods for token crud * Token CRUD acceptance tests * A couple visual diff snapshots * Add and Delete abilities referenced for token operations * Changing timeouts and adding a copy to clipboard action * replaced accessor with secret when copying to clipboard * PR comments addressed * Simplified error passing for policy editor
25 lines
736 B
JavaScript
25 lines
736 B
JavaScript
import Route from '@ember/routing/route';
|
|
import withForbiddenState from 'nomad-ui/mixins/with-forbidden-state';
|
|
import WithModelErrorHandling from 'nomad-ui/mixins/with-model-error-handling';
|
|
import { inject as service } from '@ember/service';
|
|
import { hash } from 'rsvp';
|
|
|
|
export default class PoliciesPolicyRoute extends Route.extend(
|
|
withForbiddenState,
|
|
WithModelErrorHandling
|
|
) {
|
|
@service store;
|
|
async model(params) {
|
|
return hash({
|
|
policy: this.store.findRecord('policy', decodeURIComponent(params.name), {
|
|
reload: true,
|
|
}),
|
|
tokens: this.store
|
|
.peekAll('token')
|
|
.filter((token) =>
|
|
token.policyNames?.includes(decodeURIComponent(params.name))
|
|
),
|
|
});
|
|
}
|
|
}
|