Skip to content

Commit

Permalink
removed obsolete coded
Browse files Browse the repository at this point in the history
  • Loading branch information
hofstef committed Nov 29, 2024
1 parent 91dbce3 commit 0ffa5cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 45 deletions.
4 changes: 1 addition & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ function initialize(
return () => {
initializeContextPadProvider(dirtyFlagService, iconDictionaryService);

/** The Palette and the Context Menu need the Icons present in the Domain,
* so the IconDictionaryService and the IconSetConfigurationService needs to be given to the Palette **/
initializePalette(iconDictionaryService, configurationService);
initializePalette(iconDictionaryService);
initializeRenderer(
iconDictionaryService,
elementRegistryService,
Expand Down
43 changes: 1 addition & 42 deletions src/app/tools/modeler/bpmn/modeler/palette/domainStoryPalette.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
"use strict";

import { assign } from "min-dash";
import { Dictionary } from "src/app/domain/entities/dictionary";
import { ElementTypes } from "src/app/domain/entities/elementTypes";

let iconDictionary;
let configuration;

export function initializePalette(iconDictionaryService, configurationService) {
export function initializePalette(iconDictionaryService) {
iconDictionary = iconDictionaryService;
configuration = configurationService;
}

export default function PaletteProvider(
Expand Down Expand Up @@ -74,33 +71,6 @@ PaletteProvider.prototype.getPaletteEntries = function () {
return initPalette(actions, spaceTool, lassoTool, createAction);
};

function appendCSSStyleCheat(customIcons) {
const sheetEl = document.createElement("style");
document.head.appendChild(sheetEl);

let customIconDict = new Dictionary();

customIconDict.appendDict(customIcons);
let customIconDictKeys = customIconDict.keysArray();

customIconDictKeys.forEach((name) => {
if (iconDictionary.getCustomIconsDictionary().has(name)) {
let src = customIconDict.get(name);

const iconStyle =
".icon-domain-story-" +
name.toLowerCase() +
"::before{" +
" display: block;" +
' content: url("data:image/svg+xml;utf8,' +
wrapSRCInSVG(src) +
'");' +
" margin: 3px;}";
sheetEl.sheet.insertRule(iconStyle, sheetEl.sheet.cssRules.length);
}
});
}

function initPalette(actions, spaceTool, lassoTool, createAction) {
let config = iconDictionary?.getCurrentIconConfigurationForBPMN();

Expand Down Expand Up @@ -197,14 +167,3 @@ function addCanvasObjectTypes(
);
assign(actions, action);
}

// For some reason its important to use ' in the content for the Palette and ContextPad
// Do not change!
function wrapSRCInSVG(src) {
return (
"<svg viewBox='0 0 22 22' width='22' height='22' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>" +
"<image width='22' height='22' xlink:href='" +
src +
"'/></svg>"
);
}

0 comments on commit 0ffa5cb

Please sign in to comment.