SPIKE: Applying keyboard shortcuts modal guidelines within ERM and Dashboard apps
Description
is defined by
relates to
Checklist
hideTestRail: Results
Activity
Show:
Aditya matukumalli September 17, 2021 at 5:35 PM
Closing the SPIKE as the API has been finalized and implemented as a part of https://github.com/folio-org/stripes-components/pull/1617 PR
Aditya matukumalli September 13, 2021 at 3:58 PM
Branch in progress - https://github.com/folio-org/stripes-components/tree/export-keyboard-shortcuts-api
Done
Details
Details
Assignee
Aditya matukumalli
Aditya matukumalliReporter
Jag Goraya
Jag GorayaPriority
Sprint
None
Development Team
Bienenvolk
TestRail: Cases
Open TestRail: Cases
TestRail: Runs
Open TestRail: Runs
Created August 23, 2021 at 1:58 PM
Updated September 22, 2021 at 1:05 PM
Resolved September 17, 2021 at 5:35 PM
TestRail: Cases
TestRail: Runs
The approach proposed for https://github.com/folio-org/stripes-components/pull/1595 does not meet the application design goals and constraints for Stripes Components.
This task is to explore acceptable alternatives.
We need to come up with an API that lets an app developer declartive specify the list of keyboard shortcuts he/she needs within their app. Currently, the implementation of the individual shortcuts exists in [STCOM|https://github.com/folio-org/stripes-components/blob/569c89aa13955ddda9f187f7d33802e1b0cea6ec/lib/Commander/keyboardShortcuts.js.]
The reason the implementation exists in STCOM is to reduce the boilerplate code required within the apps. So, re implementing those at the app level is not ideal.
Currently, an app developer has to import that list within their app and has to prune it to conditionaly display a specific set of shortcut keys relevant to their app, but this approach is cumbersome and doesnt represent a good API design.
Task here is to come up with a design which is declarative in nature, i.e. the app has to just call a function such as:
shortcutKeys(['new', 'save', 'edit', 'duplicateRecord']);
and that should return the keys along with their implementation which can be then displayed in the shortcut modal.
This API needs extension, as we need customizable labels for each of those keys. Currently the labels for the shortcuts are hardcoded within stcom.
So, probably the above function call `shortcutKeys` needs to be further extended to accept an array of name/label objects.