Revert "[User Attribution] "createdBy" and "modifiedBy" fields for domainObjects (#5741)" (#5826)

This reverts commit 8c92178895.
This commit is contained in:
Jamie V
2022-09-30 16:53:49 -07:00
committed by GitHub
parent 8c92178895
commit 33fd95cb2b
7 changed files with 17 additions and 95 deletions

View File

@@ -96,7 +96,7 @@ export default class ObjectAPI {
this.cache = {};
this.interceptorRegistry = new InterceptorRegistry();
this.SYNCHRONIZED_OBJECT_TYPES = ['notebook', 'restricted-notebook', 'plan', 'annotation'];
this.SYNCHRONIZED_OBJECT_TYPES = ['notebook', 'plan', 'annotation'];
this.errors = {
Conflict: ConflictError
@@ -354,7 +354,7 @@ export default class ObjectAPI {
* @returns {Promise} a promise which will resolve when the domain object
* has been saved, or be rejected if it cannot be saved
*/
async save(domainObject) {
save(domainObject) {
let provider = this.getProvider(domainObject.identifier);
let savedResolve;
let savedReject;
@@ -372,8 +372,6 @@ export default class ObjectAPI {
savedReject = reject;
});
domainObject.persisted = persistedTime;
domainObject.created = persistedTime;
domainObject.createdBy = await this.#getCurrentUsername();
const newObjectPromise = provider.create(domainObject);
if (newObjectPromise) {
newObjectPromise.then(response => {
@@ -387,7 +385,6 @@ export default class ObjectAPI {
}
} else {
domainObject.persisted = persistedTime;
domainObject.modifiedBy = await this.#getCurrentUsername();
this.mutate(domainObject, 'persisted', persistedTime);
result = provider.update(domainObject);
}
@@ -402,17 +399,6 @@ export default class ObjectAPI {
});
}
async #getCurrentUsername() {
const user = await this.openmct.user.getCurrentUser();
let username;
if (user !== undefined) {
username = user.getName();
}
return username;
}
/**
* After entering into edit mode, creates a new instance of Transaction to keep track of changes in Objects
*/