As a developer,
I want to write changes to the manifest,
so that a subsequent update of the UI (Fiori Tools: Page Editor) shows the right content
Description
open-ux-tools already provides the FPM writer for writing extensions.
But the given scenario is not part of the Flexible Programming Model, thus a new template as part of the FPM writer might be misleading.
The scenario in detail is a switch of a Fiori List report from a single table to multiple views.
Most urgent for OData V4, but a later extension to the equivalent V2 scenario (quickVariantSelectionX) should be kept in mind.
In the given scenario, several steps need to take place:
creation of SelectionPresentationVariants for the views
registration of the views in manifest
transfer of settings from the original table to the view (table settings, custom columns, custom actions)
The manifest updates could also take place by writing in to the config file of sap/ux-specification, but this works only incompletely, as long as the JSON schema is not updated from the new versions of the OData annotations as well as the updated manifest.
Technical Design
The idea is to follow the design of the FPM writer, and to profit as much as possible from the types and functions that are already provided there. This means using the mechanisms of mem-fs and mem-fs-editor here as well.
The new function shall also not be a general file writer that can write anything into the manifest, but be restricted to the special case (aka template).
The exposure takes place in form of functions and parameter types, similar to the index.ts of the fpm-writer.
Acceptance Criteria
Given I have the new module and function (generateViews) available
when I import it and use the new function
then the manifest update will take place as soon as the consumer calls the commit function of mem-fs.
In the following, at the Fiori Tools, the file watcher will trigger further activities, like the update of the JSON schema and config of sap/ux-specification.
Notes
Tasks
[ ] Create the new package manifest-writer
[ ] Define the new template
[ ] Expose reusable functions and types from the FPM writer
[ ] Define the new API function generateViews at manifest-writer
As a developer, I want to write changes to the manifest, so that a subsequent update of the UI (Fiori Tools: Page Editor) shows the right content
Description
open-ux-tools already provides the FPM writer for writing extensions. But the given scenario is not part of the Flexible Programming Model, thus a new template as part of the FPM writer might be misleading.
The scenario in detail is a switch of a Fiori List report from a single table to multiple views. Most urgent for OData V4, but a later extension to the equivalent V2 scenario (quickVariantSelectionX) should be kept in mind.
In the given scenario, several steps need to take place:
The manifest updates could also take place by writing in to the config file of sap/ux-specification, but this works only incompletely, as long as the JSON schema is not updated from the new versions of the OData annotations as well as the updated manifest.
Technical Design
The idea is to follow the design of the FPM writer, and to profit as much as possible from the types and functions that are already provided there. This means using the mechanisms of mem-fs and mem-fs-editor here as well.
As we do not talk about Flexible Programming Model in the given scenario, we should rather introduce the new function as part of the fiori-elements-writer: here we already can find a similar module https://github.com/SAP/open-ux-tools/blob/main/packages/fiori-elements-writer/templates/v4/lrop/extend/webapp/manifest.json.
The new function shall also not be a general file writer that can write anything into the manifest, but be restricted to the special case (aka template). The exposure takes place in form of functions and parameter types, similar to the index.ts of the fpm-writer.
Acceptance Criteria
Given I have the new module and function (generateViews) available when I import it and use the new function then the manifest update will take place as soon as the consumer calls the commit function of mem-fs.
In the following, at the Fiori Tools, the file watcher will trigger further activities, like the update of the JSON schema and config of sap/ux-specification.
Notes
Tasks