Skip to content

Commit

Permalink
refactor to make it a seperate plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
petervanmanenritense committed Aug 21, 2024
1 parent f6d32f1 commit 295a502
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 19 deletions.
9 changes: 8 additions & 1 deletion frontend/projects/valtimo/spotler/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"@mdi/font",
"@ng-bootstrap/ng-bootstrap",
"@ngx-translate/http-loader",
"@valtimo/account:11.1.0",
"@valtimo/access-control",
"@valtimo/account",
"@valtimo/analyse",
"@valtimo/auth0",
"@valtimo/authority",
Expand All @@ -42,6 +43,7 @@
"@valtimo/choicefield",
"@valtimo/components",
"@valtimo/config",
"@valtimo/connector-management",
"@valtimo/contact-moment",
"@valtimo/context",
"@valtimo/dashboard",
Expand All @@ -57,6 +59,7 @@
"@valtimo/management",
"@valtimo/migration",
"@valtimo/milestone",
"@valtimo/object",
"@valtimo/open-zaak",
"@valtimo/plugin",
"@valtimo/plugin-management",
Expand All @@ -75,7 +78,10 @@
"components-jqueryui",
"core-js",
"dmn-js",
"dropzone",
"flatpickr",
"jquery",
"json-server",
"ng-packagr",
"ngx-color-picker",
"ngx-logger",
Expand All @@ -84,6 +90,7 @@
"npm-run-all",
"perfect-scrollbar",
"popper.js",
"rimraf",
"rxjs",
"select2",
"swagger-ui",
Expand Down
133 changes: 129 additions & 4 deletions frontend/projects/valtimo/spotler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,139 @@
},
"peerDependencies": {
"@angular/common": "^16.2.12",
"@angular/core": "^16.2.12"
"@angular/core": "^16.2.12",
"@valtimo/access-control": "11.3.1",
"@valtimo/access-control-management": "11.3.1",
"@valtimo/account": "11.3.1",
"@valtimo/analyse": "11.3.1",
"@valtimo/bootstrap": "11.3.1",
"@valtimo/choice-field": "11.3.1",
"@valtimo/choicefield": "11.3.1",
"@valtimo/components": "11.3.1",
"@valtimo/config": "11.3.1",
"@valtimo/contact-moment": "11.3.1",
"@valtimo/connector-management": "11.3.1",
"@valtimo/dashboard": "11.3.1",
"@valtimo/dashboard-management": "11.3.1",
"@valtimo/decision": "11.3.1",
"@valtimo/document": "11.3.1",
"@valtimo/dossier": "11.3.1",
"@valtimo/dossier-management": "11.3.1",
"@valtimo/form": "11.3.1",
"@valtimo/form-link": "11.3.1",
"@valtimo/form-management": "11.3.1",
"@valtimo/keycloak": "11.3.1",
"@valtimo/layout": "11.3.1",
"@valtimo/migration": "11.3.1",
"@valtimo/milestone": "11.3.1",
"@valtimo/object": "11.3.1",
"@valtimo/object-management": "11.3.1",
"@valtimo/open-zaak": "11.3.1",
"@valtimo/plugin": "11.3.1",
"@valtimo/plugin-management": "11.3.1",
"@valtimo/process": "11.3.1",
"@valtimo/process-management": "11.3.1",
"@valtimo/resource": "11.3.1",
"@valtimo/security": "11.3.1",
"@valtimo/swagger": "11.3.1",
"@valtimo/task": "11.3.1",
"@valtimo/view-configurator": "11.3.1",
"rimraf": "5.0.1"
},
"dependencies": {
"tslib": "^2.6.2",
"@angular/animations": "^16.2.0",
"@angular/cdk": "^16.2.0",
"@angular/common": "^16.2.0",
"@angular/compiler": "^16.2.0",
"@angular/core": "^16.2.0",
"@angular/elements": "^16.2.0",
"@angular/forms": "^16.2.0",
"@angular/localize": "^16.2.0",
"@angular/platform-browser": "^16.2.0",
"@angular/platform-browser-dynamic": "^16.2.0",
"@angular/router": "^16.2.0",
"@mdi/font": "7.2.96",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
"@valtimo/access-control": "11.3.1",
"@valtimo/access-control-management": "11.3.1",
"@valtimo/account": "11.3.1",
"@valtimo/analyse": "11.3.1",
"@valtimo/bootstrap": "11.3.1",
"@valtimo/choice-field": "11.3.1",
"@valtimo/choicefield": "11.3.1",
"@valtimo/components": "11.3.1",
"@valtimo/plugin": "11.3.1"
"@valtimo/config": "11.3.1",
"@valtimo/contact-moment": "11.3.1",
"@valtimo/connector-management": "11.3.1",
"@valtimo/dashboard": "11.3.1",
"@valtimo/dashboard-management": "11.3.1",
"@valtimo/decision": "11.3.1",
"@valtimo/document": "11.3.1",
"@valtimo/dossier": "11.3.1",
"@valtimo/dossier-management": "11.3.1",
"@valtimo/form": "11.3.1",
"@valtimo/form-link": "11.3.1",
"@valtimo/form-management": "11.3.1",
"@valtimo/keycloak": "11.3.1",
"@valtimo/layout": "11.3.1",
"@valtimo/migration": "11.3.1",
"@valtimo/milestone": "11.3.1",
"@valtimo/object": "11.3.1",
"@valtimo/object-management": "11.3.1",
"@valtimo/open-zaak": "11.3.1",
"@valtimo/plugin": "11.3.1",
"@valtimo/plugin-management": "11.3.1",
"@valtimo/process": "11.3.1",
"@valtimo/process-management": "11.3.1",
"@valtimo/resource": "11.3.1",
"@valtimo/security": "11.3.1",
"@valtimo/swagger": "11.3.1",
"@valtimo/task": "11.3.1",
"@valtimo/view-configurator": "11.3.1",
"@webcomponents/custom-elements": "^1.4.3",
"bpmn-js": "6.5.1",
"bpmn-js-properties-panel": "0.46.0",
"core-js": "3.32.0",
"dmn-js": "12.3.0",
"dropzone": "6.0.0-beta.2",
"flatpickr": "4.6.13",
"json-server": "0.17.3",
"ng-packagr": "^16.2.0",
"ngx-color-picker": "14.0.0",
"ngx-logger": "5.0.12",
"ngx-translate-multi-http-loader": "16.0.1",
"popper.js": "1.16.1",
"rimraf": "5.0.1",
"rxjs": "7.8.1",
"swagger-ui": "5.4.2",
"ngx-toastr": "17.0.2",
"tslib": "2.6.2",
"zone.js": "0.13.1"
},
"devDependencies": {
"ng-packagr": "^16.2.3"
"@angular-devkit/build-angular": "^16.2.12",
"@angular/cli": "^16.2.0",
"@angular/compiler-cli": "^16.2.0",
"@angular/language-service": "^16.2.0",
"@cypress/schematic": "^2.5.0",
"@types/jasmine": "4.3.5",
"@types/jasminewd2": "2.0.10",
"@types/node": "20.5.0",
"codelyzer": "6.0.2",
"cypress": "12.17.4",
"deepmerge-ts": "5.1.0",
"jasmine-core": "5.1.0",
"jasmine-spec-reporter": "7.0.0",
"karma": "6.4.2",
"karma-chrome-launcher": "3.2.0",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"npm-run-all": "4.1.5",
"puppeteer": "21.1.0",
"sass": "1.66.1",
"ts-node": "10.9.1",
"typescript": "5.1.6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';
import {PluginConfigurationComponent} from '@valtimo/plugin';
import {FunctionConfigurationData, PluginConfigurationComponent} from '@valtimo/plugin';
import {BehaviorSubject, combineLatest, Observable, Subscription, take} from 'rxjs';
import {SpotlerPluginConfig} from "../../models";

Expand All @@ -40,7 +40,7 @@ export class SpotlerPluginConfigurationComponent

private saveSubscription!: Subscription;

private readonly formValue$ = new BehaviorSubject<SpotlerPluginConfig | null>(null);
private readonly formValue$ = new BehaviorSubject<SpotlerPluginConfig | undefined>(undefined);
private readonly valid$ = new BehaviorSubject<boolean>(false);

ngOnInit(): void {
Expand All @@ -51,9 +51,9 @@ export class SpotlerPluginConfigurationComponent
this.saveSubscription?.unsubscribe();
}

formValueChange(formValue: SpotlerPluginConfig): void {
this.formValue$.next(formValue);
this.handleValid(formValue);
formValueChange(formValue: FunctionConfigurationData): void {
this.formValue$.next(formValue as SpotlerPluginConfig);
this.handleValid(formValue as SpotlerPluginConfig);
}

private handleValid(formValue: SpotlerPluginConfig): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';
import {FunctionConfigurationComponent} from '@valtimo/plugin';
import {FunctionConfigurationComponent, FunctionConfigurationData} from '@valtimo/plugin';
import {BehaviorSubject, combineLatest, Observable, Subscription, take, tap} from 'rxjs';
import {Recipient, SendMailActionConfig} from '../../models';
import {
Expand Down Expand Up @@ -28,8 +28,8 @@ export class SendMailActionConfigurationComponent
@Input() pluginId: string;
@Input() prefillConfiguration$: Observable<SendMailActionConfig>;
@Output() valid: EventEmitter<boolean> = new EventEmitter<boolean>();
@Output() configuration: EventEmitter<SendMailActionConfig> =
new EventEmitter<SendMailActionConfig>();
@Output() configuration: EventEmitter<FunctionConfigurationData> =
new EventEmitter<FunctionConfigurationData>();

private saveSubscription!: Subscription;

Expand Down Expand Up @@ -62,9 +62,9 @@ export class SendMailActionConfigurationComponent
this.saveSubscription?.unsubscribe();
}

formValueChange(formValue: SendMailActionConfig): void {
this.formValue$.next(formValue);
this.handleValid(formValue);
formValueChange(formValue: FunctionConfigurationData): void {
this.formValue$.next(formValue as SendMailActionConfig);
this.handleValid(formValue as SendMailActionConfig);
}

private handleValid(formValue: SendMailActionConfig): void {
Expand All @@ -91,7 +91,7 @@ export class SendMailActionConfigurationComponent
.pipe(take(1))
.subscribe(([formValue, valid]) => {
if (valid) {
this.configuration.emit(formValue);
this.configuration.emit(formValue as FunctionConfigurationData);
}
});
});
Expand Down
4 changes: 2 additions & 2 deletions frontend/projects/valtimo/spotler/src/lib/models/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
*
*/

import {PluginConfigurationData} from '@valtimo/plugin';
import {FunctionConfigurationData, PluginConfigurationData} from '@valtimo/plugin';

interface SpotlerPluginConfig extends PluginConfigurationData {
clientId: string;
accountId: string;
clientSecret: string;
}

interface SendMailActionConfig {
interface SendMailActionConfig extends FunctionConfigurationData {
subject: string;
senderEmail: string;
senderName: string;
Expand Down
2 changes: 2 additions & 0 deletions frontend/projects/valtimo/spotler/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
export * from './lib/models';
export * from './lib/spotler-plugin-module';
export * from './lib/spotler-plugin.specification';
export * from './lib/components/plugin-configuration/spotler-plugin-configuration.component';
export * from './lib/components/send-mail-configuration/send-mail-action-configuration.component';

0 comments on commit 295a502

Please sign in to comment.