Skip to content

Commit 1c49bec

Browse files
Akanksha	 SinghAkanksha	 Singh
authored andcommitted
feat(core): update workflow for jira action
1 parent d0a1cdb commit 1c49bec

18 files changed

+243
-49
lines changed
Binary file not shown.

projects/workflows-creator/src/lib/builder/group/group.component.html

Lines changed: 71 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@
5050
</span>
5151
</span>
5252
</div>
53-
<span *ngFor="let node of group.children; let i = index">
53+
<div
54+
*ngFor="let node of group.children; let i = index"
55+
[style.margin-bottom.px]="
56+
node.node.noMultiLine ? node.node.noMultiLine * 32 : null
57+
"
58+
>
5459
<workflow-node
5560
[ngClass]="{'last-node': i === group.children.length - 1}"
5661
[node]="node"
@@ -62,7 +67,7 @@
6267
(add)="openPopup(group.nodeType)"
6368
(remove)="onNodeRemove(i)"
6469
></workflow-node>
65-
</span>
70+
</div>
6671

6772
<popper-content #nodePopup>
6873
<div
@@ -81,47 +86,27 @@
8186
<ng-container
8287
*ngIf="!(input.isHidden && input.isHidden(nodeWithInput.node))"
8388
>
84-
{{
85-
(input.prefix.state
86-
? nodeWithInput.node.state.get(input.prefix.state)
87-
: input.prefix) || ''
88-
}}
89-
<div
90-
class="input-text"
91-
[popper]="inputPopper"
92-
[popperShowOnStart]="false"
93-
[popperHideOnClickOutside]="false"
94-
[popperHideOnScroll]="true"
95-
[popperTrigger]="'none'"
96-
[popperPlacement]="'bottom-start'"
97-
[popperApplyClass]="'workflow-popper'"
98-
(click)="onPoperClick($event, inputPopper)"
99-
(mouseover)="showTooltip($event, nodeWithInput, input)"
100-
(mouseout)="hideTooltip()"
101-
>
102-
<span
103-
class="value-text"
104-
*ngIf="input.getValueName(nodeWithInput.node.state)"
105-
title="{{ input.getValueName(nodeWithInput.node.state) }}"
106-
(click)="setInput(input, nodeWithInput)"
107-
>{{ input.getValueName(nodeWithInput.node.state) }}</span
108-
>
109-
<span
110-
class="placeholder-text"
111-
*ngIf="!input.getValueName(nodeWithInput.node.state)"
112-
>
113-
{{
114-
nodeWithInput.node.state.get(input.customPlaceholder?.state) ??
115-
input.placeholder
116-
}}
117-
</span>
118-
</div>
119-
{{
120-
(input.suffix?.state
121-
? nodeWithInput.node.state.get(input.suffix?.state)
122-
: input.suffix) || ''
123-
}}
89+
<ng-container *ngIf="input.nextLine; else defaultInput">
90+
<div class="input-next-line">
91+
<ng-container
92+
*ngTemplateOutlet="
93+
renderInput;
94+
context: {input: input, nodeWithInput: nodeWithInput}
95+
"
96+
></ng-container>
97+
</div>
98+
</ng-container>
99+
100+
<ng-template #defaultInput>
101+
<ng-container
102+
*ngTemplateOutlet="
103+
renderInput;
104+
context: {input: input, nodeWithInput: nodeWithInput}
105+
"
106+
></ng-container>
107+
</ng-template>
124108
</ng-container>
109+
125110
<popper-content #inputPopper>
126111
<ng-container
127112
*ngIf="
@@ -154,6 +139,50 @@
154139
</ng-container>
155140
</ng-template>
156141

142+
<ng-template #renderInput let-input="input" let-nodeWithInput="nodeWithInput">
143+
{{
144+
(input.prefix?.state
145+
? nodeWithInput.node.state.get(input.prefix.state)
146+
: input.prefix) || ''
147+
}}
148+
<div
149+
class="input-text"
150+
[popper]="inputPopper"
151+
[popperShowOnStart]="false"
152+
[popperHideOnClickOutside]="false"
153+
[popperHideOnScroll]="true"
154+
[popperTrigger]="'none'"
155+
[popperPlacement]="'bottom-start'"
156+
[popperApplyClass]="'workflow-popper'"
157+
(click)="onPoperClick($event, inputPopper)"
158+
(mouseover)="showTooltip($event, nodeWithInput, input)"
159+
(mouseout)="hideTooltip()"
160+
>
161+
<span
162+
class="value-text"
163+
*ngIf="input.getValueName(nodeWithInput.node.state)"
164+
title="{{ input.getValueName(nodeWithInput.node.state) }}"
165+
(click)="setInput(input, nodeWithInput)"
166+
>
167+
{{ input.getValueName(nodeWithInput.node.state) }}
168+
</span>
169+
<span
170+
class="placeholder-text"
171+
*ngIf="!input.getValueName(nodeWithInput.node.state)"
172+
>
173+
{{
174+
nodeWithInput.node.state.get(input.customPlaceholder?.state) ??
175+
input.placeholder
176+
}}
177+
</span>
178+
</div>
179+
{{
180+
(input.suffix?.state
181+
? nodeWithInput.node.state.get(input.suffix?.state)
182+
: input.suffix) || ''
183+
}}
184+
</ng-template>
185+
157186
<ng-template
158187
#textTemplate
159188
let-callback="callback"

projects/workflows-creator/src/lib/builder/group/group.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
}
5959
}
6060
}
61+
.input-next-line {
62+
display: block;
63+
height: 5px;
64+
}
6165

6266
.input-text {
6367
cursor: pointer;
@@ -66,7 +70,6 @@
6670
text-decoration: inherit;
6771
.placeholder-text {
6872
color: $placeholder-color;
69-
text-transform: lowercase;
7073
}
7174
.value-text {
7275
display: inline-block;

projects/workflows-creator/src/lib/enum.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export enum EventTypes {
8686

8787
export enum ActionTypes {
8888
ChangeColumnValueAction = 'ChangeColumnValueAction',
89+
CreateJiraIssueAction = 'CreateJiraIssueAction',
8990
SendEmailAction = 'SendEmailAction',
9091
}
9192

@@ -110,6 +111,7 @@ export enum LocalizedStringKeys {
110111
TypeEmail = 'typeEmailLbl',
111112
SelectColumnTooltip = 'selectColumnTooltip',
112113
SetLbl = 'setLbl',
114+
CreateJiraIssue = 'createJiraIssueLbl',
113115
}
114116

115117
export enum IntervalType {
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import {Inject, Injectable} from '@angular/core';
2+
import {ENV} from '../../../../types';
3+
import {CreateStrategy, LinkStrategy} from '../../../../interfaces';
4+
import {ModdleElement} from '../../../../types/bpmn.types';
5+
import {UtilsService} from '../../../utils.service';
6+
import {CREATE_TASK_STRATEGY} from '../../strategies/create';
7+
import {LINK_BASIC_STRATEGY} from '../../strategies/link';
8+
import {ServiceTaskElement} from './service-task.task';
9+
import {ENV_TOKEN} from '../../../../token';
10+
11+
@Injectable()
12+
export class CreateJiraIssue extends ServiceTaskElement {
13+
constructor(
14+
@Inject(CREATE_TASK_STRATEGY)
15+
protected creator: CreateStrategy<ModdleElement>,
16+
@Inject(LINK_BASIC_STRATEGY)
17+
protected linker: LinkStrategy<ModdleElement>,
18+
@Inject(ENV_TOKEN) protected env: ENV,
19+
public utils: UtilsService,
20+
) {
21+
super();
22+
this.attributes = {
23+
...this.attributes,
24+
'camunda:topic': `create-jira-issue-${this.env?.envIdentifier}`,
25+
};
26+
}
27+
name = 'Create a Jira issue';
28+
properties = {};
29+
inputs = {
30+
name: 'jiraConfig',
31+
fields: {
32+
connectAccount: {state: 'jiraAccount'},
33+
selectProject: {state: 'jiraProject'},
34+
selectIssueType: {state: 'jiraIssueType'},
35+
mapFields: {state: 'jiraFieldMapping'},
36+
},
37+
};
38+
outputs = 'jiraIssueOutput';
39+
static identifier = 'CreateJiraIssue';
40+
41+
getIdentifier(): string {
42+
return CreateJiraIssue.identifier;
43+
}
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import {CreateJiraIssue} from '../../bpmn/elements/tasks/create-jira-issue.task';
2+
import {BpmnAction} from '../../../types/bpmn.types';
3+
import {LocalizedStringKeys} from '../../../enum';
4+
import {RecordOfAnyType} from '../../../types';
5+
import {
6+
JiraAccountConnectInput,
7+
JiraProjectSelectInput,
8+
JiraIssueTypeSelectInput,
9+
JiraFieldMappingInput,
10+
} from '..';
11+
12+
export class CreateJiraIssueAction extends BpmnAction {
13+
isElseAction: boolean;
14+
groupType: string;
15+
groupId: string;
16+
elements = [CreateJiraIssue.identifier];
17+
name = 'Create a Jira issue';
18+
statement = '';
19+
noMultiLine = 4;
20+
prompts = [
21+
JiraAccountConnectInput.identifier,
22+
JiraProjectSelectInput.identifier,
23+
JiraIssueTypeSelectInput.identifier,
24+
JiraFieldMappingInput.identifier,
25+
];
26+
static identifier = 'CreateJiraIssueAction';
27+
constructor(
28+
localizedStringMap: RecordOfAnyType,
29+
id: string,
30+
groupType: string,
31+
groupId: string,
32+
isElseAction: boolean,
33+
) {
34+
super();
35+
this.id = id;
36+
this.groupType = groupType;
37+
this.groupId = groupId;
38+
this.isElseAction = isElseAction || false;
39+
this.name =
40+
localizedStringMap[LocalizedStringKeys.CreateJiraIssue] ??
41+
'Create a Jira issue';
42+
}
43+
44+
getIdentifier(): string {
45+
return CreateJiraIssueAction.identifier;
46+
}
47+
}

projects/workflows-creator/src/lib/services/statement/inputs/column.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class ColumnInput extends WorkflowPrompt {
99
inputKey = 'column';
1010
listNameField = 'text';
1111
listValueField = 'value';
12-
placeholder = 'Column';
12+
placeholder = 'column';
1313
options = <S extends RecordOfAnyType>(state: State<S>) =>
1414
state.get('columns');
1515
static identifier = 'ColumnInput';

projects/workflows-creator/src/lib/services/statement/inputs/criteria.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class CriteriaInput extends WorkflowPrompt {
99
inputKey = 'column';
1010
listNameField = 'text';
1111
listValueField = 'value';
12-
placeholder = 'Criteria';
12+
placeholder = 'criteria';
1313
options = <S extends RecordOfAnyType>(state: State<S>) =>
1414
state.get('columns');
1515
static identifier = 'CriteriaInput';

projects/workflows-creator/src/lib/services/statement/inputs/email.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class EmailDataInput extends WorkflowPrompt {
99
suffix = '';
1010
typeFunction = () => InputTypes.Email;
1111
inputKey = 'email';
12-
placeholder = 'Email';
12+
placeholder = 'email';
1313
static identifier = 'EmailDataInput';
1414

1515
getIdentifier(): string {

projects/workflows-creator/src/lib/services/statement/inputs/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
export * from './jira-account-connect.input';
2+
export * from './jira-project-select.input';
3+
export * from './jira-issue-type-select.input';
4+
export * from './jira-field-mapping.input';
15
export * from './column.input';
26
export * from './condition.input';
37
export * from './email.input';

0 commit comments

Comments
 (0)