Skip to content

Commit

Permalink
fix typos, renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
hofstef committed Dec 6, 2024
1 parent 3157b2a commit f9e748d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/app/domain/entities/dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export class Dictionary {
});
}

addBuildInIcons(buildInIcons: Dictionary): void {
buildInIcons.entries.forEach((entry) => {
addBuiltInIcons(builtInIcons: Dictionary): void {
builtInIcons.entries.forEach((entry) => {
if (!this.has(entry.key)) {
this.entries.push(entry);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,12 @@ describe('IconDictionaryService', () => {
service.updateIconRegistries(actors, workObjects, config);

expect(service.getActorsDictionary().keysArray()).toContain('Person');
expect(service.getCustomIconsDictionary().keysArray()).toContain(
'TestCustomActor',
);
expect(service.getCustomIcons().keysArray()).toContain('TestCustomActor');

expect(service.getWorkObjectsDictionary().keysArray()).toContain(
'Document',
);
expect(service.getCustomIconsDictionary().keysArray()).toContain(
expect(service.getCustomIcons().keysArray()).toContain(
'TestCustomWorkObject',
);
});
Expand Down
20 changes: 10 additions & 10 deletions src/app/tools/icon-set-config/services/icon-dictionary.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class IconDictionaryService {
private readonly iconConfig: IconConfiguration;

constructor() {
this.builtInIconsDictionary.addBuildInIcons(builtInIcons);
this.builtInIconsDictionary.addBuiltInIcons(builtInIcons);
this.iconConfig = new IconConfiguration(this.builtInIconsDictionary);
}

Expand All @@ -45,8 +45,8 @@ export class IconDictionaryService {
}

const allTypes = new Dictionary();
allTypes.addBuildInIcons(builtInIcons);
allTypes.appendDict(this.getCustomIconsDictionary());
allTypes.addBuiltInIcons(builtInIcons);
allTypes.appendDict(this.getCustomIcons());

this.initDictionary(
actors,
Expand All @@ -63,14 +63,14 @@ export class IconDictionaryService {
}

private initDictionary(
keys: string[],
allTypes: Dictionary,
selectedIconNames: string[],
allIcons: Dictionary,
dictionary: Dictionary,
elementType: ElementTypes,
) {
dictionary.clear();
for (const key of keys) {
dictionary.add(allTypes.get(key), key);
for (const key of selectedIconNames) {
dictionary.add(allIcons.get(key), key);
}

dictionary.keysArray().forEach((name) => {
Expand Down Expand Up @@ -123,7 +123,7 @@ export class IconDictionaryService {
}

const allTypes = new Dictionary();
allTypes.addBuildInIcons(builtInIcons);
allTypes.addBuiltInIcons(builtInIcons);
allTypes.appendDict(customIcons);

iconTypes.forEach((name) => {
Expand Down Expand Up @@ -308,11 +308,11 @@ export class IconDictionaryService {
getFullDictionary(): Dictionary {
const fullDictionary = new Dictionary();
fullDictionary.appendDict(this.builtInIconsDictionary);
fullDictionary.appendDict(this.getCustomIconsDictionary());
fullDictionary.appendDict(this.getCustomIcons());
return fullDictionary;
}

getCustomIconsDictionary(): Dictionary {
getCustomIcons(): Dictionary {
const appendedDict = new Dictionary();
customIcons.keysArray().forEach((key) => {
if (!this.builtInIconsDictionary.has(key)) {
Expand Down
10 changes: 4 additions & 6 deletions src/app/tools/modeler/bpmn/modeler/change-icon/replaceOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ export function initializeReplaceOptions(iconDictionary) {
}

export function actorReplaceOptions(name) {
const actorTypes = iconDictionaryService.getIconsAssignedAs(
ElementTypes.ACTOR,
);
const actors = iconDictionaryService.getIconsAssignedAs(ElementTypes.ACTOR);

let replaceOption = {};
let i = 0;

actorTypes.keysArray().forEach((actorType) => {
actors.keysArray().forEach((actorType) => {
if (!name.includes(actorType)) {
const typeName = actorType;
replaceOption[i] = {
Expand All @@ -35,14 +33,14 @@ export function actorReplaceOptions(name) {
}

export function workObjectReplaceOptions(name) {
const workObjectTypes = iconDictionaryService.getIconsAssignedAs(
const workObjects = iconDictionaryService.getIconsAssignedAs(
ElementTypes.WORKOBJECT,
);

let replaceOption = {};
let i = 0;

workObjectTypes.keysArray().forEach((workObjectType) => {
workObjects.keysArray().forEach((workObjectType) => {
if (!name.includes(workObjectType)) {
const typeName = workObjectType;
replaceOption[i] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ export default function DomainStoryContextPadProvider(
}

function addWorkObjects(appendAction, actions) {
let workObjectTypes = iconDictionaryService.getIconsAssignedAs(
let workObjects = iconDictionaryService.getIconsAssignedAs(
ElementTypes.WORKOBJECT,
);
workObjectTypes.keysArray().forEach((workObjectType) => {
workObjects.keysArray().forEach((workObjectType) => {
let name = workObjectType;
let icon = iconDictionaryService.getIconForBPMN(
ElementTypes.WORKOBJECT,
Expand All @@ -225,10 +225,8 @@ export default function DomainStoryContextPadProvider(
}

function addActors(appendAction, actions) {
let actorTypes = iconDictionaryService.getIconsAssignedAs(
ElementTypes.ACTOR,
);
actorTypes.keysArray().forEach((actorType) => {
let actors = iconDictionaryService.getIconsAssignedAs(ElementTypes.ACTOR);
actors.keysArray().forEach((actorType) => {
let name = actorType;
let icon = iconDictionaryService.getIconForBPMN(
ElementTypes.ACTOR,
Expand Down

0 comments on commit f9e748d

Please sign in to comment.