Skip to content

Commit

Permalink
rename icon-set-configuration.service to icon-set-import-export.service
Browse files Browse the repository at this point in the history
  • Loading branch information
hofstef committed Jan 29, 2025
1 parent 28a8321 commit d97e1c0
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 56 deletions.
6 changes: 3 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { AppComponent } from 'src/app/app.component';
import { ImportDomainStoryService } from 'src/app/tools/import/services/import-domain-story.service';
import { LabelDictionaryService } from 'src/app/tools/label-dictionary/services/label-dictionary.service';
import { ElementRegistryService } from 'src/app/domain/services/element-registry.service';
import { IconSetConfigurationService } from 'src/app/tools/icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from 'src/app/tools/icon-set-config/services/icon-set-import-export.service';
import { UntypedFormBuilder } from '@angular/forms';
import { IconDictionaryService } from 'src/app/tools/icon-set-config/services/icon-dictionary.service';
import { AutosaveService } from './tools/autosave/services/autosave.service';
Expand Down Expand Up @@ -72,7 +72,7 @@ import { DragDirective } from './tools/import/directive/dragDrop.directive';
deps: [
DirtyFlagService,
IconDictionaryService,
IconSetConfigurationService,
IconSetImportExportService,
ElementRegistryService,
LabelDictionaryService,
],
Expand All @@ -98,7 +98,7 @@ export class AppModule implements DoBootstrap {
function initialize(
dirtyFlagService: DirtyFlagService,
iconDictionaryService: IconDictionaryService,
configurationService: IconSetConfigurationService,
importExportService: IconSetImportExportService,
elementRegistryService: ElementRegistryService,
labelDictionaryService: LabelDictionaryService,
) {
Expand Down
12 changes: 6 additions & 6 deletions src/app/tools/autosave/services/autosave.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TestBed } from '@angular/core/testing';
import { AutosaveService } from './autosave.service';
import { MockProviders } from 'ng-mocks';
import { RendererService } from '../../modeler/services/renderer.service';
import { IconSetConfigurationService } from '../../icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../icon-set-config/services/icon-set-import-export.service';
import { ExportService } from '../../export/services/export.service';
import { AutosaveConfigurationService } from './autosave-configuration.service';
import { Draft } from '../domain/draft';
Expand All @@ -19,7 +19,7 @@ describe('AutosaveService', () => {
let rendererServiceSpy: jasmine.SpyObj<RendererService>;
let autosaveStateSpy: jasmine.SpyObj<AutosaveConfigurationService>;
let storageServiceSpy: jasmine.SpyObj<StorageService>;
let iconSetConfigurationService: jasmine.SpyObj<IconSetConfigurationService>;
let iconSetConfigurationService: jasmine.SpyObj<IconSetImportExportService>;

beforeEach(() => {
const renderServiceMock = jasmine.createSpyObj(RendererService.name, [
Expand All @@ -36,7 +36,7 @@ describe('AutosaveService', () => {
'set',
]);
const iconSetConfigurationServiceMock = jasmine.createSpyObj(
IconSetConfigurationService.name,
IconSetImportExportService.name,
['createIconSetConfiguration'],
);

Expand All @@ -55,7 +55,7 @@ describe('AutosaveService', () => {
useValue: storageServiceMock,
},
{
priovide: IconSetConfigurationService,
priovide: IconSetImportExportService,
useValue: iconSetConfigurationServiceMock,
},
MockProviders(ExportService, MatSnackBar),
Expand All @@ -71,8 +71,8 @@ describe('AutosaveService', () => {
StorageService,
) as jasmine.SpyObj<StorageService>;
iconSetConfigurationService = TestBed.inject(
IconSetConfigurationService,
) as jasmine.SpyObj<IconSetConfigurationService>;
IconSetImportExportService,
) as jasmine.SpyObj<IconSetImportExportService>;

service = TestBed.inject(AutosaveService);
});
Expand Down
4 changes: 2 additions & 2 deletions src/app/tools/autosave/services/autosave.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
SNACKBAR_INFO,
} from '../../../domain/entities/constants';
import { MatSnackBar } from '@angular/material/snack-bar';
import { IconSetConfigurationService } from '../../icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../icon-set-config/services/icon-set-import-export.service';

@Injectable({
providedIn: 'root',
Expand All @@ -34,7 +34,7 @@ export class AutosaveService {
private snackbar: MatSnackBar,
private storageService: StorageService,
private titleService: TitleService,
private iconSetConfigurationService: IconSetConfigurationService,
private iconSetConfigurationService: IconSetImportExportService,
) {
this.autosaveConfiguration.configuration$.subscribe((configuration) =>
this.updateConfiguration(configuration),
Expand Down
6 changes: 3 additions & 3 deletions src/app/tools/export/services/export.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TestBed } from '@angular/core/testing';
import { ExportService } from 'src/app/tools/export/services/export.service';
import { HtmlPresentationService } from './html-presentation.service';
import { MockModule, MockService } from 'ng-mocks';
import { IconSetConfigurationService } from '../../icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../icon-set-config/services/icon-set-import-export.service';
import { PngService } from './png.service';
import { SvgService } from './svg.service';
import { RendererService } from '../../modeler/services/renderer.service';
Expand All @@ -21,8 +21,8 @@ describe('ExportService', () => {
useValue: MockService(HtmlPresentationService),
},
{
provide: IconSetConfigurationService,
useValue: MockService(IconSetConfigurationService),
provide: IconSetImportExportService,
useValue: MockService(IconSetImportExportService),
},
{
provide: PngService,
Expand Down
6 changes: 3 additions & 3 deletions src/app/tools/export/services/export.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable, OnDestroy } from '@angular/core';
import { IconSetConfigurationService } from 'src/app/tools/icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from 'src/app/tools/icon-set-config/services/icon-set-import-export.service';
import { sanitizeForDesktop } from 'src/app/utils/sanitizer';
import { TitleService } from 'src/app/tools/title/services/title.service';
import { ConfigAndDST } from 'src/app/tools/export/domain/export/configAndDst';
Expand Down Expand Up @@ -37,7 +37,7 @@ export class ExportService implements OnDestroy {
description = '';

constructor(
private configurationService: IconSetConfigurationService,
private importExportService: IconSetImportExportService,
private titleService: TitleService,
private dirtyFlagService: DirtyFlagService,
private pngService: PngService,
Expand Down Expand Up @@ -71,7 +71,7 @@ export class ExportService implements OnDestroy {

createConfigAndDST(DomainStory: any): ConfigAndDST {
return new ConfigAndDST(
this.configurationService.getCurrentConfigurationForExport(),
this.importExportService.getCurrentConfigurationForExport(),
DomainStory,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';

import { IconSetConfigurationComponent } from 'src/app/tools/icon-set-config/presentation/icon-set-configuration/icon-set-configuration.component';
import { MockModule, MockProvider, MockProviders } from 'ng-mocks';
import { IconSetConfigurationService } from '../../services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../services/icon-set-import-export.service';
import { IconDictionaryService } from '../../services/icon-dictionary.service';
import { IconSetCustomizationService } from '../../services/icon-set-customization.service';
import { BehaviorSubject } from 'rxjs';
Expand All @@ -27,7 +27,7 @@ describe(IconSetConfigurationComponent.name, () => {
imports: [MockModule(MaterialModule)],
declarations: [IconSetConfigurationComponent, IconSetDetailsComponent],
providers: [
MockProviders(IconSetConfigurationService),
MockProviders(IconSetImportExportService),
MockProvider(IconDictionaryService, {
getFullDictionary(): Dictionary {
return new Dictionary();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { Dictionary } from 'src/app/domain/entities/dictionary';
import { IconSetConfigurationService } from 'src/app/tools/icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from 'src/app/tools/icon-set-config/services/icon-set-import-export.service';
import {
ICON_PREFIX,
IconDictionaryService,
Expand Down Expand Up @@ -31,7 +31,7 @@ export class IconSetConfigurationComponent implements OnInit {
allFilteredIconNames = new BehaviorSubject<string[]>([]);

constructor(
private iconSetConfigurationService: IconSetConfigurationService,
private iconSetConfigurationService: IconSetImportExportService,
private iconDictionaryService: IconDictionaryService,
private iconSetCustomizationService: IconSetCustomizationService,
private elementRegistryService: ElementRegistryService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { IconSetCustomizationService } from 'src/app/tools/icon-set-config/services/icon-set-customization.service';
import { IconSetConfigurationService } from 'src/app/tools/icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from 'src/app/tools/icon-set-config/services/icon-set-import-export.service';
import { IconListItem } from 'src/app/tools/icon-set-config/domain/iconListItem';

@Component({
Expand All @@ -20,9 +20,9 @@ export class IconSetDetailsComponent implements OnInit {

constructor(
private customizationService: IconSetCustomizationService,
private configurationService: IconSetConfigurationService,
private importExportService: IconSetImportExportService,
) {
this.iconSetName = configurationService.iconSetName$;
this.iconSetName = importExportService.iconSetName$;
}

ngOnInit(): void {}
Expand Down Expand Up @@ -68,6 +68,6 @@ export class IconSetDetailsComponent implements OnInit {
}

exportIconSet(): void {
this.configurationService.exportConfiguration();
this.importExportService.exportConfiguration();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { Dictionary } from '../../../domain/entities/dictionary';
import { ElementTypes } from '../../../domain/entities/elementTypes';
import { IconListItem } from '../domain/iconListItem';
import { IconSetConfigurationService } from './icon-set-configuration.service';
import { IconSetImportExportService } from './icon-set-import-export.service';
import { IconDictionaryService } from './icon-dictionary.service';
import { IconSet } from '../../../domain/entities/iconSet';
import { CustomIconSetConfiguration } from '../../../domain/entities/custom-icon-set-configuration';
Expand Down Expand Up @@ -42,7 +42,7 @@ export class IconSetCustomizationService {
private changedIconSetConfiguration: IconSet | undefined;

constructor(
private iconSetConfigurationService: IconSetConfigurationService,
private iconSetConfigurationService: IconSetImportExportService,
private iconDictionaryService: IconDictionaryService,
iconSetChangedService: IconSetChangedService,
private elementRegistryService: ElementRegistryService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';

import { IconSetImportExportService } from 'src/app/tools/icon-set-config/services/icon-set-import-export.service';

describe(IconSetImportExportService.name, () => {
let service: IconSetImportExportService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(IconSetImportExportService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface FileConfiguration {
@Injectable({
providedIn: 'root',
})
export class IconSetConfigurationService {
export class IconSetImportExportService {
private iconSetNameSubject = new BehaviorSubject<string>(
INITIAL_ICON_SET_NAME,
);
Expand Down
4 changes: 2 additions & 2 deletions src/app/tools/import/services/import-domain-story.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
SNACKBAR_INFO,
SNACKBAR_SUCCESS,
} from '../../../domain/entities/constants';
import { IconSetConfigurationService } from '../../icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../icon-set-config/services/icon-set-import-export.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { IconSet } from '../../../domain/entities/iconSet';
import { IconSetChangedService } from '../../icon-set-config/services/icon-set-customization.service';
Expand Down Expand Up @@ -48,7 +48,7 @@ export class ImportDomainStoryService
private titleService: TitleService,
private rendererService: RendererService,
private dialogService: DialogService,
private iconSetConfigurationService: IconSetConfigurationService,
private iconSetConfigurationService: IconSetImportExportService,
private modelerService: ModelerService,
private snackbar: MatSnackBar,
) {
Expand Down
12 changes: 6 additions & 6 deletions src/app/tools/modeler/services/modeler.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ModelerService } from 'src/app/tools/modeler/services/modeler.service';
import { InitializerService } from './initializer.service';
import { ElementRegistryService } from '../../../domain/services/element-registry.service';
import { IconDictionaryService } from '../../icon-set-config/services/icon-dictionary.service';
import { IconSetConfigurationService } from '../../icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../icon-set-config/services/icon-set-import-export.service';
import { createTestCanvasObjects } from '../../../utils/testHelpers.spec';
import { BusinessObject } from '../../../domain/entities/businessObject';
import { INITIAL_ICON_SET_NAME } from '../../../domain/entities/constants';
Expand All @@ -18,7 +18,7 @@ describe('ModelerService', () => {

let elementRegistrySpy: jasmine.SpyObj<ElementRegistryService>;
let iconDictionarySpy: jasmine.SpyObj<IconDictionaryService>;
let iconSetConfigurationSpy: jasmine.SpyObj<IconSetConfigurationService>;
let iconSetConfigurationSpy: jasmine.SpyObj<IconSetImportExportService>;
let initializerSpy: jasmine.SpyObj<InitializerService>;

let testDomainStory: BusinessObject[] = createTestCanvasObjects(1).map(
Expand Down Expand Up @@ -47,7 +47,7 @@ describe('ModelerService', () => {
['setCustomConfiguration', 'createIconConfiguration'],
);
const iconSetConfigurationMock = jasmine.createSpyObj(
IconSetConfigurationService.name,
IconSetImportExportService.name,
[
'loadConfiguration',
'getStoredIconSetConfiguration',
Expand Down Expand Up @@ -76,7 +76,7 @@ describe('ModelerService', () => {
useValue: iconDictionaryMock,
},
{
provide: IconSetConfigurationService,
provide: IconSetImportExportService,
useValue: iconSetConfigurationMock,
},
],
Expand All @@ -93,8 +93,8 @@ describe('ModelerService', () => {
IconDictionaryService,
) as jasmine.SpyObj<IconDictionaryService>;
iconSetConfigurationSpy = TestBed.inject(
IconSetConfigurationService,
) as jasmine.SpyObj<IconSetConfigurationService>;
IconSetImportExportService,
) as jasmine.SpyObj<IconSetImportExportService>;
initializerSpy = TestBed.inject(
InitializerService,
) as jasmine.SpyObj<InitializerService>;
Expand Down
4 changes: 2 additions & 2 deletions src/app/tools/modeler/services/modeler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DomainStoryModeler from 'src/app/tools/modeler/diagram-js';
import { InitializerService } from './initializer.service';
import { ElementRegistryService } from '../../../domain/services/element-registry.service';
import { IconDictionaryService } from '../../icon-set-config/services/icon-dictionary.service';
import { IconSetConfigurationService } from '../../icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../icon-set-config/services/icon-set-import-export.service';
import { BusinessObject } from '../../../domain/entities/businessObject';
import { ActivityBusinessObject } from '../../../domain/entities/activityBusinessObject';
import { updateMultipleNumberRegistry } from 'src/app/tools/modeler/diagram-js/features/numbering/numbering';
Expand All @@ -26,7 +26,7 @@ export class ModelerService {
private initializerService: InitializerService,
private elementRegistryService: ElementRegistryService,
private iconDictionaryService: IconDictionaryService,
private iconSetConfigurationService: IconSetConfigurationService,
private iconSetConfigurationService: IconSetImportExportService,
private storageService: StorageService,
private snackbar: MatSnackBar,
) {}
Expand Down
4 changes: 2 additions & 2 deletions src/app/tools/modeler/services/renderer.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TestBed } from '@angular/core/testing';
import { RendererService } from './renderer.service';
import { ModelerService } from './modeler.service';
import { ElementRegistryService } from '../../../domain/services/element-registry.service';
import { IconSetConfigurationService } from '../../icon-set-config/services/icon-set-configuration.service';
import { IconSetImportExportService } from '../../icon-set-config/services/icon-set-import-export.service';
import { DirtyFlagService } from '../../../domain/services/dirty-flag.service';
import { Dictionary } from 'src/app/domain/entities/dictionary';
import { IconSet } from '../../../domain/entities/iconSet';
Expand All @@ -29,7 +29,7 @@ describe('RendererService', () => {
'makeClean',
]);
const iconSetConfigurationServiceMock = jasmine.createSpyObj(
IconSetConfigurationService.name,
IconSetImportExportService.name,
['getNewIconConfiguration'],
);

Expand Down

0 comments on commit d97e1c0

Please sign in to comment.