Skip to content

Commit

Permalink
Removed the rest of doop
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas345 committed May 8, 2024
1 parent 6768668 commit 3a32820
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 35 deletions.
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
40 changes: 21 additions & 19 deletions src/model/NameEntity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {NEW_ENTITY_PREFIX} from './PwrConstants';
import {APINameEntity} from './APIProfile';
import {doop} from 'doop';

/**
* Describes an unique name/qualifier.
Expand All @@ -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<string, this>();
public id() {
return this._id;
}

/**
Expand All @@ -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<string, this>();
public name() {
return this._name;
}

public setName(name: string): NameEntity {
return new NameEntity(this._id, name, this._isNew, this._type);
}

/**
Expand All @@ -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<boolean, this>();
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<string, this>}
*/
@doop
public get type() {
return doop<string, this>();
public type() {
return this._type;
}

/**
Expand All @@ -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;
}


Expand Down
1 change: 0 additions & 1 deletion src/model/metadata/MetaDataStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {doop} from 'doop';
import {BuildInfo} from './BuildInfo';
import * as Immutable from 'immutable';
import {ClientBuildInfo} from './ClientBuildInfo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class NotificationDialogModule extends React.Component<NotificationDialogProps
case 'edit':
let notification = this.props.notification;
let nameEntity = notification.nameEntity;
nameEntity = nameEntity.name(this.state.nameEntityName);
nameEntity = nameEntity.setName(this.state.nameEntityName);
notification = notification.setNameEntity(nameEntity);
this.props.executePatchAction(notification);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {APISkill} from '../../../model/APIProfile';
import {PwrAutoComplete} from '../pwr-auto-complete';
import {StatisticsServiceClient} from '../../../clients/StatisticsServiceClient';
import {SkillServiceClient} from '../../../clients/SkillServiceClient';
// Documentation: https://github.com/TeamWertarbyte/material-ui-chip-input
const ChipInput = require('material-ui-chip-input').default;


interface ConsultantSkillInfo {
Expand Down

0 comments on commit 3a32820

Please sign in to comment.