From 3a32820cbb146431b9d0ba43c48b30512f998991 Mon Sep 17 00:00:00 2001 From: nt Date: Wed, 8 May 2024 16:13:39 +0200 Subject: [PATCH] Removed the rest of doop --- package-lock.json | 11 ----- package.json | 1 - src/model/NameEntity.ts | 40 ++++++++++--------- src/model/metadata/MetaDataStore.ts | 1 - .../notification-dialog_module.tsx | 2 +- .../consultant-skill-search_module..tsx | 2 - 6 files changed, 22 insertions(+), 35 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a1b356b..068b618a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "@successtar/cogo-toast": "^5.0.6", "autosuggest-highlight": "^3.1.1", "axios": "0.19.0", - "doop": "2.2.1", "es6-promise": "4.2.8", "history": "4.10.1", "immutable": "3.8.2", @@ -4439,11 +4438,6 @@ "domelementtype": "1" } }, - "node_modules/doop": { - "version": "2.2.1", - "resolved": "http://registry.npmjs.org/doop/-/doop-2.2.1.tgz", - "integrity": "sha1-2wyQqfGAt44m0SPn7u/ysb26KhU=" - }, "node_modules/dot-prop": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", @@ -22072,11 +22066,6 @@ "domelementtype": "1" } }, - "doop": { - "version": "2.2.1", - "resolved": "http://registry.npmjs.org/doop/-/doop-2.2.1.tgz", - "integrity": "sha1-2wyQqfGAt44m0SPn7u/ysb26KhU=" - }, "dot-prop": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", diff --git a/package.json b/package.json index e2a912a7..44b2665d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "autosuggest-highlight": "^3.1.1", "axios": "0.19.0", "@successtar/cogo-toast": "^5.0.6", - "doop": "2.2.1", "es6-promise": "4.2.8", "history": "4.10.1", "immutable": "3.8.2", diff --git a/src/model/NameEntity.ts b/src/model/NameEntity.ts index 9388f1ae..7cace64b 100644 --- a/src/model/NameEntity.ts +++ b/src/model/NameEntity.ts @@ -1,6 +1,5 @@ import {NEW_ENTITY_PREFIX} from './PwrConstants'; import {APINameEntity} from './APIProfile'; -import {doop} from 'doop'; /** * Describes an unique name/qualifier. @@ -21,15 +20,18 @@ import {doop} from 'doop'; * {@link NameEntity} to choose from, and, as the {@link NameEntity.name} can be considered as identification, no two * {@link NameEntity} objects with the same name should exists. */ -@doop export class NameEntity { + private readonly _id: string; + private readonly _name: string; + private readonly _isNew: boolean; + private readonly _type: string; + /** * ID of this {@NameEntity}. Represents identity throughout the whole API enviroment. A null ID sent * to the API represents a new {@link NameEntity} */ - @doop - public get id() { - return doop(); + public id() { + return this._id; } /** @@ -43,9 +45,12 @@ export class NameEntity { * the same class in this client. This has practical reasons: The signatures are identical on each {@link NameEntity}, * which reduces cluttering of classes. */ - @doop - public get name() { - return doop(); + public name() { + return this._name; + } + + public setName(name: string): NameEntity { + return new NameEntity(this._id, name, this._isNew, this._type); } /** @@ -54,18 +59,12 @@ export class NameEntity { * * New {@link NameEntity} objects need their ID set to null before persisiting them against the API. */ - @doop - public get isNew() { - return doop(); + public isNew() { + return this._isNew; } - /** - * "API-Transient", has to be kept the same. On new entites, this is set by the API based on occurrence - * @returns {Doop} - */ - @doop - public get type() { - return doop(); + public type() { + return this._type; } /** @@ -76,7 +75,10 @@ export class NameEntity { private static CURRENT_LOCAL_ID: number = 0; protected constructor(id: string, name: string, isNew: boolean, type: string) { - return this.id(id).name(name).isNew(isNew).type(type); + this._id = id; + this._name = name; + this._isNew = isNew; + this._type = type; } diff --git a/src/model/metadata/MetaDataStore.ts b/src/model/metadata/MetaDataStore.ts index 5ced3420..196efd71 100644 --- a/src/model/metadata/MetaDataStore.ts +++ b/src/model/metadata/MetaDataStore.ts @@ -1,4 +1,3 @@ -import {doop} from 'doop'; import {BuildInfo} from './BuildInfo'; import * as Immutable from 'immutable'; import {ClientBuildInfo} from './ClientBuildInfo'; diff --git a/src/modules/admin/notification/notification-dialog_module.tsx b/src/modules/admin/notification/notification-dialog_module.tsx index b9e14d46..ec29b869 100644 --- a/src/modules/admin/notification/notification-dialog_module.tsx +++ b/src/modules/admin/notification/notification-dialog_module.tsx @@ -135,7 +135,7 @@ class NotificationDialogModule extends React.Component