Icu 13895 create create new tags route and view (#2368)
* feat: 🎸 create canSetWorkerTags ability for workers ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * feat: 🎸 add create-tags route ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * feat: 🎸 update worker serializer for adding api_tags ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * feat: 🎸 add setApiTags method on worker model ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * style: 💄 update list-wrapper styles after hds upgrade ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * feat: 🎸 add create-tags component for workers ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * feat: 🎸 add creat-tags route and view ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * test: 💍 add acceptance tests for worker create-tags workflow ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * test: 💍 add test for worker tag creation ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * test: 💍 fix test setup for workers ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * test: 💍 add license headers and update setupTest import ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * test: 💍 fix normal serialize test for worker ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 create worker PKI type const ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 add comments to methods and actions ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * feat: 🎸 create Tag class to use in multiple places ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 move apiTags to route controller ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 move routeWillChange logic to route ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 routeWillChange logic updates ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 remove unused services ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * test: 💍 add missing controller tests ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 small update to API tags description ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 add tracked to Tag class ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 use willTransition vs routeWillChange event ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895 * refactor: 💡 use controllerFor in route ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-13895
This commit is contained in:
1 parent
87f84e0c24
commit
4e57c863ab
27 files changed
+741
-32
No files matched your search
@@ -6,6 +6,8 @@
|
||||
import GeneratedWorkerModel from '../generated/models/worker';
|
||||
import { attr } from '@ember-data/model';
|
||||
|
||||
export const TYPE_WORKER_PKI = 'pki';
|
||||
|
||||
export const TAG_TYPE_CONFIG = 'config';
|
||||
export const TAG_TYPE_API = 'api';
|
||||
|
||||
@@ -26,7 +28,7 @@ export default class WorkerModel extends GeneratedWorkerModel {
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isPki() {
|
||||
return this.type === 'pki';
|
||||
return this.type === TYPE_WORKER_PKI;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +98,6 @@ export default class WorkerModel extends GeneratedWorkerModel {
|
||||
|
||||
@attr({
|
||||
description: 'The api tags set for the worker.\nOutput only.',
|
||||
readOnly: true,
|
||||
})
|
||||
api_tags;
|
||||
|
||||
@@ -120,4 +121,15 @@ export default class WorkerModel extends GeneratedWorkerModel {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set api tags on the worker.
|
||||
* @param {object} apiTags
|
||||
* @return {Promise}
|
||||
*/
|
||||
setApiTags(apiTags) {
|
||||
return this.save({
|
||||
adapterOptions: { method: 'set-worker-tags', apiTags },
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user