Fluent Commerce Logo
Community
No alt text provided

How to enable location store user to update the location store hours with custom UI Component

No alt text provided
Author: Randy Chan

Published: 07-03-2025

15 min read

#Json

#Inspiration

#React

Since we will be using the `updateLocation` mutation to update location->openingSchdule, we can write a custom UI Component that can display the opening schedule on the UI to allow users to update the opening schedule details.Here is the list of actions to implement the feature:
  • Determine if it is feasible via web app and GraphQL.
  • Check and add new permissions for the user.
  • Add a reference route in setting: `fc.mystique.manifest.store`
  • Create a new manifest: `fc.mystique.manifest.store.fragment.storelocation` to view and enable user mutation action
  • Create an `OpeningSchedule` Component that maps to the new manifest

By looking at the GraphQL docs, updateLocation mutation can update the openingSchedule. No alt provided
Next, I knew we need `LOCATION_VIEW`, `LOCATION_UPDATE`, `OPENINGSCHEDULE_VIEW` and `OPENINGSCHEDULE_UPDATE` permissions so I create a new Role:Once the new role is created, assign the new role to my store manager by using `updateUser` mutation:Next, add the manifest reference link that you are about to create in the store setting: `fc.mystique.manifest.store`No alt providedCreate a new manifest setting which going to display the location details and `openingSchedule`:Name: fc.mystique.manifest.store.fragment.storelocationContext: ACCOUNTContext ID: 0Value Type: JSONJSON Value:
Open fluent STORE and navigate to the location detail screen:No alt providedThe default update location mutation does provide a high-level UI for updating the opening schedule. However, I want more control over the UI field display, so I will write a custom component.No alt provided
Open up the component SDK and create a new file: `OpeningSchedule.tsx`:Add the following code snippet to `index.tsx`:
Once all saved. Spin up yarn start, refresh the fluent STORE browser, and the new component should be displayed:No alt providedNow, the store user can update the location opening schedule hours via UI.

 
Randy Chan

Randy Chan

Fluent Commerce - Expert Services