Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashpatil78 committed Apr 30, 2024
1 parent fcffd7e commit 6a6acdb
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 60 deletions.
107 changes: 53 additions & 54 deletions src/app/core/mock-data/modal-controller.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import deepFreeze from 'deep-freeze-strict';

/* eslint-disable custom-rules/prefer-deep-freeze */
import { FyFiltersComponent } from 'src/app/shared/components/fy-filters/fy-filters.component';
import { filterOptions1 } from './filter.data';
import { selectedFilters1, selectedFilters4, taskSelectedFiltersData } from './selected-filters.data';
Expand All @@ -26,7 +25,7 @@ import { VirtualSelectModalComponent } from 'src/app/shared/components/virtual-s
import { apiExpenseRes } from './expense.data';
import { apiExpenses1 } from './platform/v1/expense.data';

export const modalControllerParams = deepFreeze({
export const modalControllerParams = {
component: FyFiltersComponent,
componentProps: {
filterOptions: [
Expand All @@ -46,46 +45,46 @@ export const modalControllerParams = deepFreeze({
activeFilterInitialName: 'approvalDate',
},
cssClass: 'dialog-popover',
});
};

export const modalControllerParams2 = deepFreeze({
export const modalControllerParams2 = {
component: FyFiltersComponent,
componentProps: {
filterOptions: filterOptions1,
selectedFilterValues: selectedFilters1,
activeFilterInitialName: 'approvalDate',
},
cssClass: 'dialog-popover',
});
};

export const newReportModalParams = deepFreeze({
export const newReportModalParams = {
component: CreateNewReportComponent,
componentProps: {
selectedExpensesToReport: apiExpenseRes,
},
mode: <Mode>'ios',
...fyModalProperties,
});
};

export const newReportModalParams2 = deepFreeze({
export const newReportModalParams2 = {
component: createReportV2,
componentProps: {
selectedExpensesToReport: apiExpenses1,
},
mode: <Mode>'ios',
...fyModalProperties,
});
};

export const addExpenseToReportModalParams2 = deepFreeze({
export const addExpenseToReportModalParams2 = {
component: v2,
componentProps: {
txId: '12345',
},
mode: <Mode>'ios',
...fyModalProperties,
});
};

export const popoverControllerParams = deepFreeze({
export const popoverControllerParams = {
component: PopupAlertComponent,
componentProps: {
title: '2 Draft Expenses blocking the way',
Expand All @@ -100,19 +99,19 @@ export const popoverControllerParams = deepFreeze({
},
},
cssClass: 'pop-up-in-center',
});
};

export const openFromComponentConfig = deepFreeze({
export const openFromComponentConfig = {
data: {
icon: 'warning-fill',
showCloseButton: true,
message: 'Please select one or more expenses to be reported',
},
duration: 3000,
panelClass: ['msb-failure-with-report-btn'],
});
};

export const taskModalControllerParams = deepFreeze({
export const taskModalControllerParams = {
component: FyFiltersComponent,
componentProps: {
filterOptions: [
Expand Down Expand Up @@ -167,9 +166,9 @@ export const taskModalControllerParams = deepFreeze({
activeFilterInitialName: 'Expenses',
},
cssClass: 'dialog-popover',
});
};

export const taskModalControllerParams2 = deepFreeze({
export const taskModalControllerParams2 = {
component: FyFiltersComponent,
componentProps: {
filterOptions: [
Expand Down Expand Up @@ -224,9 +223,9 @@ export const taskModalControllerParams2 = deepFreeze({
activeFilterInitialName: undefined,
},
cssClass: 'dialog-popover',
});
};

export const teamReportsModalControllerParams = deepFreeze({
export const teamReportsModalControllerParams = {
component: FyFiltersComponent,
componentProps: {
filterOptions: [
Expand Down Expand Up @@ -332,9 +331,9 @@ export const teamReportsModalControllerParams = deepFreeze({
activeFilterInitialName: 'State',
},
cssClass: 'dialog-popover',
});
};

export const popoverControllerParams2 = deepFreeze({
export const popoverControllerParams2 = {
component: PopupAlertComponent,
componentProps: {
title: 'Unsaved Changes',
Expand All @@ -349,9 +348,9 @@ export const popoverControllerParams2 = deepFreeze({
},
},
cssClass: 'pop-up-in-center',
});
};

export const addToReportModalControllerParams = deepFreeze({
export const addToReportModalControllerParams = {
component: FyAddToReportModalComponent,
componentProps: {
options: reportOptionsData,
Expand All @@ -374,9 +373,9 @@ export const addToReportModalControllerParams = deepFreeze({
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
});
};

export const popoverControllerParams3 = deepFreeze({
export const popoverControllerParams3 = {
component: FyInputPopoverComponent,
componentProps: {
title: 'New Draft Report',
Expand All @@ -386,28 +385,28 @@ export const popoverControllerParams3 = deepFreeze({
isRequired: true,
},
cssClass: 'fy-dialog-popover',
});
};

export const modalControllerParams3 = deepFreeze({
export const modalControllerParams3 = {
component: CaptureReceiptComponent,
componentProps: {
isModal: true,
allowGalleryUploads: false,
allowBulkFyle: false,
},
cssClass: 'hide-modal',
});
};

export const modalControllerParams4 = deepFreeze({
export const modalControllerParams4 = {
component: FyViewAttachmentComponent,
componentProps: {
attachments: advanceRequestFileUrlData2,
canEdit: true,
},
mode: 'ios' as Mode,
});
};

export const modalControllerParams5 = deepFreeze({
export const modalControllerParams5 = {
component: ViewCommentComponent,
componentProps: {
objectType: 'advance_requests',
Expand All @@ -421,9 +420,9 @@ export const modalControllerParams5 = deepFreeze({
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
});
};

export const popoverControllerParams5 = deepFreeze({
export const popoverControllerParams5 = {
component: PopupAlertComponent,
cssClass: 'pop-up-in-center',
componentProps: {
Expand All @@ -438,27 +437,27 @@ export const popoverControllerParams5 = deepFreeze({
action: 'cancel',
},
},
});
};

export const popoverControllerParams6 = deepFreeze({
export const popoverControllerParams6 = {
component: FyPopoverComponent,
cssClass: 'fy-dialog-popover',
componentProps: {
title: 'Send Back',
formLabel: 'Reason For Sending Back Advance',
},
});
};

export const popoverControllerParams7 = deepFreeze({
export const popoverControllerParams7 = {
component: FyPopoverComponent,
cssClass: 'fy-dialog-popover',
componentProps: {
title: 'Reject',
formLabel: 'Please mention the reason for rejecting the advance request',
},
});
};

export const modalControllerParams6 = deepFreeze({
export const modalControllerParams6 = {
component: ViewCommentComponent,
componentProps: {
objectType: 'advance_requests',
Expand All @@ -472,9 +471,9 @@ export const modalControllerParams6 = deepFreeze({
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
});
};

export const modalControllerParams7 = deepFreeze({
export const modalControllerParams7 = {
component: FyViewAttachmentComponent,
componentProps: {
attachments: fileObject4[0],
Expand All @@ -489,18 +488,18 @@ export const modalControllerParams7 = deepFreeze({
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
});
};

export const popoverControllerParams8 = deepFreeze({
export const popoverControllerParams8 = {
component: FyPopoverComponent,
componentProps: {
title: 'Pull Back Advance?',
formLabel: 'Pulling back your advance request will allow you to edit and re-submit the request.',
},
cssClass: 'fy-dialog-popover',
});
};

export const modalControllerParams8 = deepFreeze({
export const modalControllerParams8 = {
component: ViewCommentComponent,
componentProps: {
objectType: 'advance_requests',
Expand All @@ -514,9 +513,9 @@ export const modalControllerParams8 = deepFreeze({
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
});
};

export const modalControllerParams9 = deepFreeze({
export const modalControllerParams9 = {
component: FyViewAttachmentComponent,
componentProps: {
attachments: fileObject4[0],
Expand All @@ -530,9 +529,9 @@ export const modalControllerParams9 = deepFreeze({
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
});
};

export const virtualSelectModalControllerParams = deepFreeze({
export const virtualSelectModalControllerParams = {
component: VirtualSelectModalComponent,
componentProps: {
options: [],
Expand All @@ -558,9 +557,9 @@ export const virtualSelectModalControllerParams = deepFreeze({
initialBreakpoint: 1,
breakpoints: [0, 1],
handle: false,
});
};

export const permissionDeniedPopoverParams = deepFreeze({
export const permissionDeniedPopoverParams = {
component: PopupAlertComponent,
componentProps: {
title: 'Photos Permission',
Expand All @@ -576,4 +575,4 @@ export const permissionDeniedPopoverParams = deepFreeze({
},
cssClass: 'pop-up-in-center',
backdropDismiss: false,
});
};
15 changes: 9 additions & 6 deletions src/app/core/mock-data/my-reports.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ export const openFiltersOptions = deepFreeze([
} as FilterOptions<string>,
]);

export const filterPopoverParams = deepFreeze({
// eslint-disable-next-line custom-rules/prefer-deep-freeze
export const filterPopoverParams = {
component: FyFiltersComponent,
componentProps: {
filterOptions: openFiltersOptions,
Expand All @@ -211,9 +212,10 @@ export const filterPopoverParams = deepFreeze({
activeFilterInitialName: 'State',
},
cssClass: 'dialog-popover',
});
};

export const popoverControllerParams = deepFreeze({
// eslint-disable-next-line custom-rules/prefer-deep-freeze
export const popoverControllerParams = {
component: PopupAlertComponent,
componentProps: {
title: 'Cannot Delete Report',
Expand All @@ -224,11 +226,12 @@ export const popoverControllerParams = deepFreeze({
},
},
cssClass: 'pop-up-in-center',
});
};

const mockDeleteMethod = (): Observable<void> => of();

export const deletePopoverParamsRes = deepFreeze({
// eslint-disable-next-line custom-rules/prefer-deep-freeze
export const deletePopoverParamsRes = {
component: FyDeleteDialogComponent,
cssClass: 'delete-dialog',
backdropDismiss: false,
Expand All @@ -238,4 +241,4 @@ export const deletePopoverParamsRes = deepFreeze({
infoMessage: 'Deleting the report will not delete any of the expenses.',
deleteMethod: mockDeleteMethod,
},
});
};

0 comments on commit 6a6acdb

Please sign in to comment.