Skip to content

Commit

Permalink
filled empty methods (#91) (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesheucher-gip committed Nov 23, 2023
1 parent c9b5225 commit 41efe36
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ export class XcTablePanelDefinitionComponent extends XcFormPanelDefinitionCompon
this.detailsDefinition = definitionBundle.definition;

// get notified when details close
const observerSubscription = this.detailsDefinition.observerChange
let observerSubscription: Subscription;
// eslint-disable-next-line prefer-const
observerSubscription = this.detailsDefinition.observerChange
.pipe(filter(observer => !!observer))
.subscribe(observer => {
observer.definitionClosed().pipe(first()).subscribe(data => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { AfterViewInit, Component, Injector, OnDestroy } from '@angular/core';
import { environment } from '@environments/environment';
import { XcStackItemComponent, XcStackItemComponentData } from '../../../../xc-stack/xc-stack-item/xc-stack-item.component';

import { Observable, of, Subject, Subscription } from 'rxjs';
import { map, switchMap, tap } from 'rxjs/operators';
import { Observable, of, Subject, Subscription, throwError } from 'rxjs';
import { filter, map, switchMap, tap } from 'rxjs/operators';
import { XoFormDefinition } from '../../xo/containers.model';
import { ApiService, StartOrderOptionsBuilder, Xo, XoXPRCRuntimeContext, XoXPRCRuntimeContextFromRuntimeContext } from '../../../../../api';
import { XcStackItem, XcStackItemInterface, XcStackItemObserver } from '../../../../xc-stack/xc-stack-item/xc-stack-item';
Expand Down Expand Up @@ -131,14 +131,33 @@ export class XcDefinitionStackItemComponent extends XcStackItemComponent<Definit


definitionClosed(): Observable<XoCloseDefinitionData> {
this.dialogs.info('Definition Closed', 'not implemented yet in DefinitionObserver');
return of();
return of(<XoCloseDefinitionData>{
definition: this.injectedData.definition,
data: this.injectedData.data
});
}


resolveDefinition(definitionWorkflowRTC: XoXPRCRuntimeContext, definitionWorkflowFQN: string, data: Xo[]): Observable<XoDefinitionBundle> {
this.dialogs.info('Resolve Definition from Workflow', 'not implemented yet in DefinitionObserver');
return of();
return this.api.startOrder(
definitionWorkflowRTC.toRuntimeContext(),
definitionWorkflowFQN,
data, null,
new StartOrderOptionsBuilder().withErrorMessage(true).options
).pipe(
filter(result => {
if (result.errorMessage || result.output?.length === 0) {
throwError(() => new Error('no definition found'));
this.dialogs.error('No definition found in resolved definition-Workflow');
return false;
}
return true;
}),
map(result => <XoDefinitionBundle>{
definition: result.output[0],
data: result.output.slice(1)
})
);
}


Expand Down

0 comments on commit 41efe36

Please sign in to comment.