Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync single-sign-in branch with main #215

Merged
merged 34 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
52b337b
Improved: UI to remove the block button to fab button for saving chan…
ymaheshwari1 Apr 19, 2024
a547bc6
Improved: UI for the rules page as per the figma(#197)
ymaheshwari1 Apr 19, 2024
3041753
Improved: check for auto cancel days to not allow empty values(#197)
ymaheshwari1 Apr 19, 2024
f0363a7
Implemented: functionality to clear the autoCancelDays(#197)
ymaheshwari1 Apr 19, 2024
48b6bd9
Improved: the button positioning for inventory rules(#197)
ymaheshwari1 Apr 19, 2024
987aa95
Merge pull request #198 from ymaheshwari1/#197
ymaheshwari1 Apr 19, 2024
86a11b2
Implemented: support to autofocus on the input when updating rule name
ymaheshwari1 Apr 22, 2024
6eb1dc0
Merge pull request #201 from ymaheshwari1/fix/auto-focus-inventory-re…
ymaheshwari1 Apr 22, 2024
419e0da
Fixed: case to have a default value for cronExpression when updating …
ymaheshwari1 Apr 22, 2024
1f817d9
Merge pull request #202 from ymaheshwari1/fix/schedule-value
ymaheshwari1 Apr 22, 2024
cbea8d4
Improved: app version in package and lock file for minor release(v1.2.0)
ymaheshwari1 Apr 22, 2024
59e93f4
Merge pull request #203 from ymaheshwari1/release
ymaheshwari1 Apr 22, 2024
0adadce
Fixed: issue regarding decimal numbers can be entered in alert input(…
ymaheshwari1 Apr 25, 2024
8f1bd2f
Fixed: issue in alert input to not allow entering special character a…
ymaheshwari1 Apr 25, 2024
ebc02bd
Fixed: archived routing cards to be dispalyed correctly after unarchi…
ymaheshwari1 Apr 25, 2024
5753927
Merge pull request #204 from ymaheshwari1/#197
ymaheshwari1 Apr 25, 2024
c711ef4
Merge pull request #205 from ymaheshwari1/#181
ymaheshwari1 Apr 25, 2024
8d2f7dc
Improved: app version in package and lock file for patch release(v1.2.1)
ymaheshwari1 Apr 25, 2024
8b0de43
Merge pull request #206 from ymaheshwari1/release
ymaheshwari1 Apr 25, 2024
ebf073a
Fixed: case to handle the case when enum data is missing for specific…
ymaheshwari1 Apr 26, 2024
676cf56
Improved: locale file to include static text
ymaheshwari1 Apr 26, 2024
4993d4b
Improved: check for finding the enum data before fetching the value
ymaheshwari1 Apr 26, 2024
22f2511
Merge pull request #209 from ymaheshwari1/fix/empty-state-on-missing-…
ymaheshwari1 Apr 29, 2024
63fafdb
Fixed: issue in reordering the inventory rules
ymaheshwari1 Apr 29, 2024
7f6c728
Fixed: condition to add a null check before sorting rules
ymaheshwari1 Apr 29, 2024
47c620b
Merge pull request #210 from ymaheshwari1/fix/reordering-inventory-rule
ymaheshwari1 Apr 29, 2024
273eaf0
Improved: UI for back feature from the query page(#124)
ymaheshwari1 May 10, 2024
1023d63
Improved: rule add button to add slot end on the icon(#124)
ymaheshwari1 May 10, 2024
98220c9
Merge pull request #211 from ymaheshwari1/#124
ymaheshwari1 May 10, 2024
7009b5e
Implemented: support to fetch the latest routing history and fetch th…
ymaheshwari1 May 13, 2024
36c5e3d
Fixed: issue of duplicate filters getting applied on the rules
ymaheshwari1 May 13, 2024
ebb0a33
Merge pull request #214 from ymaheshwari1/fix/duplicate-filters-on-rule
ymaheshwari1 May 13, 2024
5529ed8
Improved: code to fetch the latest group history on clicking view all…
ymaheshwari1 May 16, 2024
880be90
Merge pull request #213 from ymaheshwari1/feat/fetch-latest-run-history
ymaheshwari1 May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "order-routing-rules",
"version": "1.1.0",
"version": "1.2.1",
"private": true,
"description": "An Ionic project",
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions src/components/AddInventoryFilterOptionsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<div v-if="!enumerations.length" class="empty-state">
<p>{{ translate(`Failed to fetch ${props.label?.toLowerCase()} options`) }}</p>
</div>
<ion-list v-else>
<ion-item v-for="condition in enumerations" :key="condition.enumId">
<ion-checkbox :checked="isConditionOptionSelected(condition.enumCode)" @ionChange="addConditionOption(condition)">{{ condition.description || condition.enumCode }}</ion-checkbox>
</ion-item>
Expand Down Expand Up @@ -66,7 +69,7 @@ const associatedOptions = { IIP_PROXIMITY: { enum: "IIP_MSMNT_SYSTEM", defaultVa

onMounted(() => {
inventoryRuleConditions.value = props.ruleConditions ? JSON.parse(JSON.stringify(props.ruleConditions)) : {}
enumerations.value = Object.values(enums.value[props.parentEnumId]).filter((enumeration: any) => !hiddenOptions.includes(enumeration.enumId))
enumerations.value = enums.value[props.parentEnumId] ? Object.values(enums.value[props.parentEnumId]).filter((enumeration: any) => !hiddenOptions.includes(enumeration.enumId)) : []
})

function checkFilters() {
Expand Down
7 changes: 5 additions & 2 deletions src/components/AddOrderRouteFilterOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<ion-item v-for="sort in Object.values(enums[props.parentEnumId] ? enums[props.parentEnumId] : {})" :key="sort.enumId">
<div v-if="!enums[props.parentEnumId]" class="empty-state">
<p>{{ translate(`Failed to fetch ${$props.label?.toLowerCase()} options`) }}</p>
</div>
<ion-list v-else>
<ion-item v-for="sort in Object.values(enums[props.parentEnumId])" :key="sort.enumId">
<ion-checkbox :checked="isSortOptionSelected(sort.enumCode)" @ionChange="addSortOption(sort)">{{ sort.description || sort.enumCode }}</ion-checkbox>
</ion-item>
</ion-list>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ArchivedRoutingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ async function updateOrderRouting(routing: Route, fieldToUpdate: string, value:
props.saveRoutings([{
...routing,
[fieldToUpdate]: value
}])
}, ...routings.value])
}
</script>
8 changes: 7 additions & 1 deletion src/components/PromiseFilterPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ async function updatePromiseDate(header = '', isPastDuration = false) {
placeholder: translate("duration"),
min: 0,
type: "number",
value: props.value?.replace("-", "")
value: props.value > 0 && !isPastDuration ? props.value : props.value < 0 && isPastDuration ? props.value?.replace("-", "") : '', // Prefill the value only when the previously selected option and current selection matches
attributes: {
// Added check to not allow mainly .(period) and other special characters to be entered in the alert input
onkeydown: ($event: any) => {
if(/[`!@#$%^&*()_+\-=\\|,.<>?~]/.test($event.key)) $event.preventDefault();
}
}
}]
})

Expand Down
3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"Failed to create brokering run": "Failed to create brokering run",
"Failed to create inventory rule": "Failed to create inventory rule",
"Failed to create order routing": "Failed to create order routing",
"Failed to fetch filters options": "Failed to fetch filters options",
"Failed to fetch sort options": "Failed to fetch sort options",
"Failed to update group information": "Failed to update group information",
"Failed to update group status": "Failed to update group status",
"Failed to schedule service": "Failed to schedule service",
Expand Down Expand Up @@ -96,6 +98,7 @@
"Order priority": "Order priority",
"Order Rule Filters": "Order Rule Filters",
"Order Rule Sort": "Order Rule Sort",
"Order routing information updated": "Order routing information updated",
"Orders will be brokered based on order date if no sorting is specified.": "Orders will be brokered based on order date if no sorting is specified.",
"operator": "operator",
"Partial allocation cannot be disabled. Orders are filtered by item when filtering by promise date.": "Partial allocation cannot be disabled. Orders are filtered by item when filtering by promise date.",
Expand Down
10 changes: 6 additions & 4 deletions src/services/RoutingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ const fetchRoutingScheduleInformation = async (routingGroupId: string): Promise<
});
}

const fetchRoutingHistory = async (routingGroupId: string): Promise<any> => {
const fetchRoutingHistory = async (routingGroupId: string, params: any): Promise<any> => {
return api({
url: `groups/${routingGroupId}/routingRuns`,
method: "GET"
method: "GET",
params
});
}

const fetchGroupHistory = async (jobName: string): Promise<any> => {
const fetchGroupHistory = async (jobName: string, params: any): Promise<any> => {
return api({
url: `serviceJobRuns/${jobName}`,
method: "GET"
method: "GET",
params
});
}

Expand Down
14 changes: 4 additions & 10 deletions src/store/modules/orderRouting/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@
},

async fetchCurrentOrderRouting({ dispatch }, orderRoutingId) {
let currentRoute = {}
let currentRoute = {} as any

try {
const resp = await OrderRoutingService.fetchOrderRouting(orderRoutingId);

if(!hasError(resp) && resp.data) {
currentRoute = resp.data
currentRoute["rules"] = currentRoute["rules"]?.length ? sortSequence(currentRoute["rules"]) : []
} else {
throw resp.data
}
Expand All @@ -185,18 +186,11 @@
commit(types.ORDER_ROUTING_CURRENT_ROUTE_UPDATED, payload)
},

async fetchRoutingHistory({ commit, state }, routingGroupId) {
const history = Object.values(state.routingHistory)[0] as any

// If the routing history for the current group is already available then don't fetch the history again
if(history?.length && history[0].routingGroupId === routingGroupId) {
return;
}

async fetchRoutingHistory({ commit }, routingGroupId) {
let routingHistory = {}

try {
const resp = await OrderRoutingService.fetchRoutingHistory(routingGroupId)
const resp = await OrderRoutingService.fetchRoutingHistory(routingGroupId, { orderByField: "startDate DESC" })

if(!hasError(resp)) {
// Sorting the history based on startTime, as we does not get the records in sorted order from api
Expand All @@ -223,7 +217,7 @@
commit(types.ORDER_ROUTING_HISTORY_UPDATED, routingHistory)
},

async deleteRoutingFilters({ dispatch }, payload) {

Check warning on line 220 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 220 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'dispatch' is defined but never used

Check warning on line 220 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
let hasAllFiltersDeletedSuccessfully = true;
try {
// As discussed, we can't make parallel api calls, hence using for loop to make api calls
Expand All @@ -243,7 +237,7 @@
return hasAllFiltersDeletedSuccessfully
},

async updateRouting({ dispatch }, payload) {

Check warning on line 240 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 240 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'dispatch' is defined but never used

Check warning on line 240 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
let orderRoutingId = ''
try {
const resp = await OrderRoutingService.updateRouting(payload)
Expand Down Expand Up @@ -294,7 +288,7 @@
return routingRuleId;
},

async deleteRuleConditions({ dispatch }, payload) {

Check warning on line 291 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 291 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'dispatch' is defined but never used

Check warning on line 291 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
// TODO: check if we can call request in parallel for delete operation
let hasAllConditionsDeletedSuccessfully = true;
try {
Expand All @@ -314,7 +308,7 @@
return hasAllConditionsDeletedSuccessfully
},

async deleteRuleActions({ dispatch }, payload) {

Check warning on line 311 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 311 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'dispatch' is defined but never used

Check warning on line 311 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
// TODO: check if we can call request in parallel for delete operation
let hasAllActionsDeletedSuccessfully = true;
try {
Expand Down Expand Up @@ -377,7 +371,7 @@
return rulesInformation[routingRuleId] ? JSON.parse(JSON.stringify(rulesInformation[routingRuleId])) : {}
},

async updateRule({ dispatch }, payload) {

Check warning on line 374 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 374 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'dispatch' is defined but never used

Check warning on line 374 in src/store/modules/orderRouting/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
let routingRuleId = ''
try {
const resp = await OrderRoutingService.updateRule(payload)
Expand Down
4 changes: 4 additions & 0 deletions src/theme/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ http://ionicframework.com/docs/theming/ */
text-align: center;
}

ion-input.name {
--background: var(--ion-color-light)
}

.pointer {
cursor: pointer;
}
Expand Down
Loading
Loading