-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`Added functionality to retrieve supplier page settings and updated f…
…orms to use select options for supplier page names.`
- Loading branch information
vivek7315
committed
Jan 1, 2025
1 parent
106065f
commit b01cfcb
Showing
25 changed files
with
284 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
export enum SupplierPageNames { | ||
|
||
Deshboards = "Deshboards", | ||
Product_Details = "Product-Details", | ||
Inventory_Details = "Product-Details", | ||
Inventory_Details = "Inventory-Details", | ||
Add_Product = "Add-Product", | ||
Add_Inventory = "Add-Inventory", | ||
|
||
Add_Inventory = "Add-Inventory", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { SupplierPageNames } from "../Enums/SupplierPageNames.Enums"; | ||
|
||
export const SupplierInitialPageSetting = [ | ||
{ | ||
pageName: SupplierPageNames.Add_Inventory, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: SupplierPageNames.Add_Product, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: SupplierPageNames.Deshboards, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: SupplierPageNames.Inventory_Details, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: SupplierPageNames.Product_Details, | ||
editConfig : true, | ||
deleteConfig : true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { customerPageNames } from "../Enums/CustomerPageNames.Enum"; | ||
|
||
export const CustomerPageSetting = [ | ||
{ | ||
pageName: customerPageNames.AboutUs, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: customerPageNames.AddToCart, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: customerPageNames.WhisList, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: customerPageNames.ContactUs, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: customerPageNames.Profile, | ||
editConfig : true, | ||
deleteConfig : true | ||
}, | ||
{ | ||
pageName: customerPageNames.Profile, | ||
editConfig : true, | ||
deleteConfig : true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ActionReducer, MetaReducer } from "@ngrx/store"; | ||
import { localStorageSync } from "ngrx-store-localstorage"; | ||
|
||
// Ensure localStorage is only accessed in a browser environment | ||
export function localStorageSyncReducer(reducer: ActionReducer<any>): ActionReducer<any> { | ||
return (state, action) => { | ||
if (typeof window !== 'undefined' && window.localStorage) { | ||
return localStorageSync({ | ||
keys: ['SupplierPageConfig','CustomerPageConfig'], | ||
rehydrate: true, | ||
})(reducer)(state, action); | ||
} | ||
return reducer(state, action); | ||
}; | ||
} | ||
export const metaReducers: Array<MetaReducer<any, any>> = [localStorageSyncReducer]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createReducer, on, State } from "@ngrx/store"; | ||
import { CustomerPageSetting } from "../../Shared/helpers/customerPagesetting"; | ||
import { AddCustomerPageSettings } from "../action/CustomerPageSetting.action"; | ||
|
||
|
||
export interface pageSetting { | ||
pageName: string; | ||
editConfig: boolean, | ||
deleteConfig: boolean | ||
} | ||
|
||
|
||
export interface AppState { | ||
pageSetting: any[]; | ||
} | ||
|
||
|
||
|
||
export const initialState: AppState = { | ||
pageSetting: CustomerPageSetting | ||
}; | ||
|
||
export const CustomerPageconfigrationSetting = createReducer( | ||
initialState, | ||
on(AddCustomerPageSettings , (state, action) =>{ | ||
const AddCustomerPageSettings = {pageName: action.pageName, editConfig: action.editConfig, deleteConfig: action.deleteConfig}; | ||
return { | ||
...state, | ||
} | ||
}) | ||
) | ||
export function pageConfigSettingReducerF(state: any, action: any) { | ||
return CustomerPageconfigrationSetting(state, action); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createReducer, on, State } from "@ngrx/store"; | ||
import { SupplierInitialPageSetting} from "../../Shared/helpers/SupplierPageSetting"; | ||
import { AddSupplierPageSettings } from "../action/Pagesetting.action"; | ||
|
||
|
||
export interface pageSetting { | ||
pageName: string; | ||
editConfig: boolean, | ||
deleteConfig: boolean | ||
} | ||
|
||
|
||
export interface AppState { | ||
pageSetting: any[]; | ||
} | ||
|
||
|
||
|
||
export const initialState: AppState = { | ||
pageSetting: SupplierInitialPageSetting | ||
}; | ||
|
||
export const configrationSetting = createReducer( | ||
initialState, | ||
on(AddSupplierPageSettings , (state, action) =>{ | ||
const AddCustomerPageConfigration = {pageName: action.pageName, editConfig: action.editConfig, deleteConfig: action.deleteConfig}; | ||
return { | ||
...state, | ||
} | ||
}) | ||
) | ||
export function pageConfigSettingReducerF(state: any, action: any) { | ||
return configrationSetting(state, action); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createAction, props } from "@ngrx/store"; | ||
|
||
export const AddCustomerPageSettings = createAction('AddCustomerPageSettings', props<{ pageName: string, editConfig: boolean, deleteConfig: boolean }>()); | ||
export const UpdateCustomerPageSettings = createAction('UpdateCustomerPageSettings', props<{ pageName: string, editConfig: boolean, deleteConfig: boolean }>()); | ||
export const DeleteCustomerPageSettings = createAction('DeleteCustomerPageSettings', props<{ pageName: string, editConfig: boolean, deleteConfig: boolean }>()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createAction, props } from "@ngrx/store"; | ||
|
||
export const AddSupplierPageSettings = createAction('AddSupplierPageSettings', props<{ pageName: string, editConfig: boolean, deleteConfig: boolean }>()); | ||
export const UpdateSupplierPageSettings = createAction('UpdateSupplierPageSettings', props<{ pageName: string, editConfig: boolean, deleteConfig: boolean }>()); | ||
export const DeleteSupplierPageSettings = createAction('DeleteSupplierPageSettings', props<{ pageName: string, editConfig: boolean, deleteConfig: boolean }>()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createAction, props } from "@ngrx/store"; | ||
|
||
export const AddCustomerPageConfigration = createAction('AddCustomerPageConfigration', props<{ Pagename:string, editConfig:boolean ,deleteConfig:boolean}>()); | ||
export const editCustomerPageConfigration = createAction('EditCustomerPageConfigration', props<{ Pagename:string,editConfig:boolean ,deleteConfig:boolean}>()); | ||
export const DeleteCustomerPageConfigration = createAction('DeleteCustomerPageConfigration', props<{ Pagename:string,editConfig:boolean ,deleteConfig:boolean}>()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.