SAP / open-ux-tools

Enable community collaboration to jointly promote and facilitate best in class tooling capabilities
Apache License 2.0
83 stars 35 forks source link

FEATURE - Additional writer for manifest #1788

Closed schreckstefan closed 4 months ago

schreckstefan commented 5 months ago

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

schreckstefan commented 4 months ago

The requirement is not valid anymore, I could solve my problem by other means.