-
+
+
diff --git a/projects/valtimo/process-management/src/lib/components/process-management-upload/process-management-upload.component.ts b/projects/valtimo/process-management/src/lib/components/process-management-upload/process-management-upload.component.ts
index 7a295a75f..5557ba24e 100644
--- a/projects/valtimo/process-management/src/lib/components/process-management-upload/process-management-upload.component.ts
+++ b/projects/valtimo/process-management/src/lib/components/process-management-upload/process-management-upload.component.ts
@@ -14,9 +14,10 @@
* limitations under the License.
*/
-import {Component, ElementRef, EventEmitter, Output, ViewChild} from '@angular/core';
+import {Component, ElementRef, ViewChild} from '@angular/core';
import {ProcessManagementService} from '../../process-management.service';
import {AlertService} from '@valtimo/components';
+import {ProcessManagementStateService} from '../../services';
@Component({
selector: 'valtimo-process-management-upload',
@@ -25,25 +26,32 @@ import {AlertService} from '@valtimo/components';
})
export class ProcessManagementUploadComponent {
public bpmn: File | null = null;
- @Output() reload = new EventEmitter();
@ViewChild('bpmnFile') bpmnFile: ElementRef;
+ public readonly modalOpen$ = this.processManagementStateService.openModal$;
+
constructor(
- private processManagementService: ProcessManagementService,
- private alertService: AlertService
+ private readonly processManagementService: ProcessManagementService,
+ private readonly alertService: AlertService,
+ private readonly processManagementStateService: ProcessManagementStateService
) {}
- onChange(files: FileList): void {
+ public closeModal(): void {
+ this.processManagementStateService.closeModal();
+ }
+
+ public onChange(files: FileList): void {
this.bpmn = files.item(0);
}
- uploadProcessBpmn() {
+ public uploadProcessBpmn() {
this.processManagementService.deployBpmn(this.bpmn).subscribe(
() => {
this.bpmn = null;
this.bpmnFile.nativeElement.value = '';
this.alertService.success('Deployment successful');
- this.reload.emit();
+ this.processManagementStateService.closeModal();
+ this.processManagementStateService.reloadDefinitions();
},
error => {
this.bpmn = null;
diff --git a/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.html b/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.html
index 22b14489a..19668dacf 100644
--- a/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.html
+++ b/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.html
@@ -14,27 +14,6 @@
~ limitations under the License.
-->
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.ts b/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.ts
index a0a57ac4f..85be27e04 100644
--- a/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.ts
+++ b/projects/valtimo/process-management/src/lib/components/process-management/process-management.component.ts
@@ -16,11 +16,13 @@
import {Component, ViewChild} from '@angular/core';
import {ProcessManagementListComponent} from '../process-management-list/process-management-list.component';
+import {ProcessManagementStateService} from '../../services';
@Component({
selector: 'valtimo-process-management',
templateUrl: './process-management.component.html',
styleUrls: ['./process-management.component.scss'],
+ providers: [ProcessManagementStateService],
})
export class ProcessManagementComponent {
@ViewChild('processManagementList') processManagementList: ProcessManagementListComponent;
diff --git a/projects/valtimo/process-management/src/lib/process-management.module.ts b/projects/valtimo/process-management/src/lib/process-management.module.ts
index ee9cf4f7e..c817e9e8c 100644
--- a/projects/valtimo/process-management/src/lib/process-management.module.ts
+++ b/projects/valtimo/process-management/src/lib/process-management.module.ts
@@ -17,8 +17,8 @@
import {NgModule} from '@angular/core';
import {ProcessManagementRoutingModule} from './process-management-routing';
import {CommonModule} from '@angular/common';
-import {ListModule, WidgetModule} from '@valtimo/components';
-import {FormsModule} from '@angular/forms';
+import {CarbonListModule, ListModule, WidgetModule} from '@valtimo/components';
+import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {TranslateModule} from '@ngx-translate/core';
import {ProcessLinkModule} from '@valtimo/process-link';
import {
@@ -28,6 +28,14 @@ import {
ProcessManagementListComponent,
ProcessManagementUploadComponent,
} from './components';
+import {
+ ButtonModule,
+ DropdownModule,
+ IconModule,
+ ModalModule,
+ NotificationModule,
+ RadioModule,
+} from 'carbon-components-angular';
@NgModule({
declarations: [
@@ -45,6 +53,15 @@ import {
TranslateModule,
ProcessLinkModule,
ProcessManagementEditorComponent,
+ CarbonListModule,
+ ButtonModule,
+ IconModule,
+ DropdownModule,
+ ModalModule,
+ NotificationModule,
+ RadioModule,
+ ReactiveFormsModule,
+ ModalModule,
],
exports: [ProcessManagementComponent],
})
diff --git a/projects/valtimo/process-management/src/lib/services/index.ts b/projects/valtimo/process-management/src/lib/services/index.ts
index ad9eeb129..fc19c7beb 100644
--- a/projects/valtimo/process-management/src/lib/services/index.ts
+++ b/projects/valtimo/process-management/src/lib/services/index.ts
@@ -15,3 +15,4 @@
*/
export * from './process-management-editor.service';
+export * from './process-management-state.service';
diff --git a/projects/valtimo/process-management/src/lib/services/process-management-state.service.ts b/projects/valtimo/process-management/src/lib/services/process-management-state.service.ts
new file mode 100644
index 000000000..19d544e32
--- /dev/null
+++ b/projects/valtimo/process-management/src/lib/services/process-management-state.service.ts
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015-2024 Ritense BV, the Netherlands.
+ *
+ * Licensed under EUPL, Version 1.2 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {Injectable} from '@angular/core';
+import {Observable, Subject} from 'rxjs';
+
+@Injectable()
+export class ProcessManagementStateService {
+ private readonly _openModal$ = new Subject
();
+ private readonly _reloadDefinitions$ = new Subject();
+
+ public get openModal$(): Observable {
+ return this._openModal$.asObservable();
+ }
+
+ public get reloadDefinitions$(): Observable {
+ return this._reloadDefinitions$.asObservable();
+ }
+
+ public openModal(): void {
+ this._openModal$.next(true);
+ }
+
+ public closeModal(): void {
+ this._openModal$.next(false);
+ }
+
+ public reloadDefinitions(): void {
+ this._reloadDefinitions$.next(null);
+ }
+}