Skip to content

Commit

Permalink
Merge branch 'master' into GH-78
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepika516 authored Mar 15, 2024
2 parents 1ec3f0f + 015566f commit 310d2a6
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 22 deletions.
11 changes: 11 additions & 0 deletions projects/workflows-creator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.1.9](https://github.com/sourcefuse/workflows-creator/compare/@sourceloop/[email protected]...@sourceloop/[email protected]) (2024-03-04)

### Bug Fixes

- **core:** allow date to be set on enter ([#61](https://github.com/sourcefuse/workflows-creator/issues/61)) ([daf0ab2](https://github.com/sourcefuse/workflows-creator/commit/daf0ab21c0d3632edf2201da80649b18874f67a0)), closes [#56](https://github.com/sourcefuse/workflows-creator/issues/56) [#56](https://github.com/sourcefuse/workflows-creator/issues/56)
- **core:** allow only 4 digits for year in date input ([#64](https://github.com/sourcefuse/workflows-creator/issues/64)) ([34246b2](https://github.com/sourcefuse/workflows-creator/commit/34246b24d6ed308208227ad70ce1e0d4b3bfed3f)), closes [#56](https://github.com/sourcefuse/workflows-creator/issues/56) [#56](https://github.com/sourcefuse/workflows-creator/issues/56) [#56](https://github.com/sourcefuse/workflows-creator/issues/56)
- **core:** fix issue of WF| 'Save' button is not getting enabled when '<Blank>' is selected for any column ([#63](https://github.com/sourcefuse/workflows-creator/issues/63)) ([408534a](https://github.com/sourcefuse/workflows-creator/commit/408534a6b454ab0af044ffa76e7b47f561a77f48)), closes [#62](https://github.com/sourcefuse/workflows-creator/issues/62) [#62](https://github.com/sourcefuse/workflows-creator/issues/62)
- **core:** fix save button ([#66](https://github.com/sourcefuse/workflows-creator/issues/66)) ([4a74954](https://github.com/sourcefuse/workflows-creator/commit/4a749545e936a024fe358ac5235c463350ab7991)), closes [#65](https://github.com/sourcefuse/workflows-creator/issues/65)
- **core:** fix you can add isPastToday in valid WF ([#70](https://github.com/sourcefuse/workflows-creator/issues/70)) ([a91ebd7](https://github.com/sourcefuse/workflows-creator/commit/a91ebd71f9ee66485953f3dc3dbd692b1f9fe2e5)), closes [#68](https://github.com/sourcefuse/workflows-creator/issues/68)
- **core:** WF| Able to enter negative value in 'n' interval of "Every time period" event ([#69](https://github.com/sourcefuse/workflows-creator/issues/69)) ([6a4dad7](https://github.com/sourcefuse/workflows-creator/commit/6a4dad7e9902767c176e3bbb739534e96782943b)), closes [#67](https://github.com/sourcefuse/workflows-creator/issues/67) [#67](https://github.com/sourcefuse/workflows-creator/issues/67)

## [1.1.8](https://github.com/sourcefuse/workflows-creator/compare/@sourceloop/[email protected]...@sourceloop/[email protected]) (2024-02-21)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions projects/workflows-creator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/workflows-creator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sourceloop/workflows-creator",
"version": "1.1.8",
"version": "1.1.9",
"description": "Library for providing a smooth user workflow.",
"keywords": [
"angular-library"
Expand Down
20 changes: 10 additions & 10 deletions projects/workflows-creator/src/lib/builder/builder.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,16 @@ export class BuilderComponent<E> implements OnInit, OnChanges {
case EventTypes.OnValueEvent:
case ActionTypes.ChangeColumnValueAction:
const columnExists = !!node.node.state.get('column');
let valueExists = false;
if (typeof node.node.state.get('value') !== 'undefined') {
valueExists = true;
} else if (
node.node.state.get('condition') === ConditionTypes.PastToday
) {
valueExists = true;
} else {
valueExists = !!node.node.state.get('value');
}
let valueExists = false;
if (typeof node.node.state.get('value') !== 'undefined') {
valueExists = true;
} else if (
node.node.state.get('condition') === ConditionTypes.PastToday
) {
valueExists = true;
} else {
valueExists = !!node.node.state.get('value');
}
const valueTypeIsAnyValue =
node.node.state.get('valueType') === ValueTypes.AnyValue;
isValid = columnExists && (valueExists || valueTypeIsAnyValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@
<input
class="date-input"
type="date"
[(ngModel)]="date"
[(ngModel)]="input.getModelValue(nodeWithInput.node.state) || date"
(ngModelChange)="updateSecondVariable($event, inputType.date)"
(click)="$event.stopPropagation()"
min="0000-01-01"
max="9999-12-31"
Expand Down Expand Up @@ -321,10 +322,36 @@
<div class="date-time-picker" (document:click)="hide()">
<div class="time-picker">
<div class="date-input">
<input type="date" [(ngModel)]="dateTime.date" />
<input
type="date"
[(ngModel)]="
input.getModelValue(nodeWithInput.node.state).date ||
dateTime.date
"
(ngModelChange)="
updateSecondVariable(
$event,
inputType.dateTime,
dateTimeFields.date
)
"
/>
</div>
<div class="time-input">
<input type="time" [(ngModel)]="dateTime.time" />
<input
type="time"
[(ngModel)]="
input.getModelValue(nodeWithInput.node.state).time ||
dateTime.time
"
(ngModelChange)="
updateSecondVariable(
$event,
inputType.dateTime,
dateTimeFields.time
)
"
/>
</div>
<div>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {NgxPopperjsContentComponent} from 'ngx-popperjs';
import {isSelectInput, NodeService, WorkflowPrompt} from '../../classes';
import {AbstractBaseGroup} from '../../classes/nodes';
import {
DateTimeFields,
InputTypes,
LocalizedStringKeys,
NodeTypes,
Expand Down Expand Up @@ -61,6 +62,7 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
private readonly localizationSvc: LocalizationProviderService,
) {}
public inputType = InputTypes;
public dateTimeFields = DateTimeFields;
private isMouseDown: boolean = false;
@Input()
group: AbstractBaseGroup<E>;
Expand Down Expand Up @@ -322,6 +324,11 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
time: '',
};
this.date = '';
this.emailInput = {
subject: '',
body: '',
focusKey: '',
};
const newNode = {
node: this.nodes.getNodeByName(
node.getIdentifier(),
Expand Down Expand Up @@ -528,6 +535,11 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
metaObj: RecordOfAnyType,
) {
const value = $event.target?.value ?? $event;
this.dateTime = {
date: '',
time: '',
};
this.date = '';
switch (type) {
case InputTypes.People:
const selectedIds = metaObj.list.filter((item: {id: any}) =>
Expand All @@ -547,8 +559,8 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
}
case InputTypes.DateTime:
if (value) {
if (this.dateTime.time === '') {
this.dateTime.time = node.state.get('defaultTime') ?? '9:00';
if (value.time === '') {
value.time = node.state.get('defaultTime') ?? '9:00';
}
const dateObj = moment(`${value.date} ${value.time}`);
return {
Expand Down Expand Up @@ -614,6 +626,26 @@ export class GroupComponent<E> implements OnInit, AfterViewInit {
callback(response);
}
}

updateSecondVariable(
event: any,
inputType: InputTypes,
dateTimeField?: string,
) {
//if inputType->dateTime
switch (inputType) {
case InputTypes.DateTime:
if (dateTimeField == 'date') {
this.dateTime.date = event;
} else {
this.dateTime.time = event;
}
break;
case InputTypes.Date:
this.date = event;
}
}

/**
* It removes all the inputs that come after the current input
* @param element - NodeWithInput<E>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,19 @@ export abstract class WorkflowPrompt {
});
}
case InputTypes.Date: {
if (!state.get(this.inputKey)) {
return '';
}
const dateString = state.get(this.inputKey);
return moment(dateString).format('YYYY-MM-DD');
}
case InputTypes.DateTime: {
if (!state.get(this.inputKey)) {
return {
date: null,
time: null,
};
}
const dateString = moment(state.get(this.inputKey))?.format(
DATE_TIME_FORMAT,
);
Expand Down
5 changes: 5 additions & 0 deletions projects/workflows-creator/src/lib/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ export enum LocalizedStringKeys {
SelectColumnTooltip = 'selectColumnTooltip',
SetLbl = 'setLbl',
}

export enum DateTimeFields {
Date = 'date',
Time = 'time',
}
11 changes: 11 additions & 0 deletions projects/workflows-element/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.1.9](https://github.com/sourcefuse/workflows-creator/compare/@sourceloop/[email protected]...@sourceloop/[email protected]) (2024-03-04)

### Bug Fixes

- **core:** allow date to be set on enter ([#61](https://github.com/sourcefuse/workflows-creator/issues/61)) ([daf0ab2](https://github.com/sourcefuse/workflows-creator/commit/daf0ab21c0d3632edf2201da80649b18874f67a0)), closes [#56](https://github.com/sourcefuse/workflows-creator/issues/56) [#56](https://github.com/sourcefuse/workflows-creator/issues/56)
- **core:** allow only 4 digits for year in date input ([#64](https://github.com/sourcefuse/workflows-creator/issues/64)) ([34246b2](https://github.com/sourcefuse/workflows-creator/commit/34246b24d6ed308208227ad70ce1e0d4b3bfed3f)), closes [#56](https://github.com/sourcefuse/workflows-creator/issues/56) [#56](https://github.com/sourcefuse/workflows-creator/issues/56) [#56](https://github.com/sourcefuse/workflows-creator/issues/56)
- **core:** fix issue of WF| 'Save' button is not getting enabled when '<Blank>' is selected for any column ([#63](https://github.com/sourcefuse/workflows-creator/issues/63)) ([408534a](https://github.com/sourcefuse/workflows-creator/commit/408534a6b454ab0af044ffa76e7b47f561a77f48)), closes [#62](https://github.com/sourcefuse/workflows-creator/issues/62) [#62](https://github.com/sourcefuse/workflows-creator/issues/62)
- **core:** fix save button ([#66](https://github.com/sourcefuse/workflows-creator/issues/66)) ([4a74954](https://github.com/sourcefuse/workflows-creator/commit/4a749545e936a024fe358ac5235c463350ab7991)), closes [#65](https://github.com/sourcefuse/workflows-creator/issues/65)
- **core:** fix you can add isPastToday in valid WF ([#70](https://github.com/sourcefuse/workflows-creator/issues/70)) ([a91ebd7](https://github.com/sourcefuse/workflows-creator/commit/a91ebd71f9ee66485953f3dc3dbd692b1f9fe2e5)), closes [#68](https://github.com/sourcefuse/workflows-creator/issues/68)
- **core:** WF| Able to enter negative value in 'n' interval of "Every time period" event ([#69](https://github.com/sourcefuse/workflows-creator/issues/69)) ([6a4dad7](https://github.com/sourcefuse/workflows-creator/commit/6a4dad7e9902767c176e3bbb739534e96782943b)), closes [#67](https://github.com/sourcefuse/workflows-creator/issues/67) [#67](https://github.com/sourcefuse/workflows-creator/issues/67)

## [1.1.8](https://github.com/sourcefuse/workflows-creator/compare/@sourceloop/[email protected]...@sourceloop/[email protected]) (2024-02-21)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions projects/workflows-element/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions projects/workflows-element/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sourceloop/workflows-creator-element",
"version": "1.1.8",
"version": "1.1.9",
"description": "Web Component for providing a smooth user workflow.",
"scripts": {
"prepublishOnly": "cp package.json dist/package.json"
Expand All @@ -17,5 +17,7 @@
"access": "public",
"directory": "dist"
},

"hash": "b3becb84440a55958bc16f9caf46b27fe1c7aab612e7fee3df4539591abee228"
}
}

0 comments on commit 310d2a6

Please sign in to comment.