feat(flexibility-registry): add Flexibility Registry tab with change export - #377
Open
MyLittleCrab wants to merge 2 commits into
Open
feat(flexibility-registry): add Flexibility Registry tab with change export#377MyLittleCrab wants to merge 2 commits into
MyLittleCrab wants to merge 2 commits into
Conversation
Contributor
|
Hi @MyLittleCrab , |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
When a developer changes a control property in the UI5 Inspector's Properties tab, that change currently lives only in the inspected page and is lost as soon as the page reloads. To persist such adjustments in an OpenUI5/SAPUI5 app, the developer had to export them manually into the
changesfolder of a flexibility/adaptation project — a tedious, error-prone process.What's new
A new Flexibility Registry tab in the UI5 panel (between Elements Registry and AI Assistant) that automatically records every property change made through the inspector and lets you export the result.
The tab consists of two panes:
DataGridlisting each registered change with columns forchangeType,selector.id,selector.type,content.propertyandcontent.newValue, plus Download and Clear toolbar buttons.How it works
do-control-flexibility-property-changeaction (app/scripts/injected/main.js).flexibilityRegistryinapp/vendor/ToolsAPI.js, using the same structure thatChange.createInitialFileContentproduces (fileType: "change",changeType: "propertyChange",layer: "VENDOR",packageName: "$TMP",namespace: "apps/<projectId>/changes/",support.generator: "Change.createInitialFileContent", etc.). The control class is read from the UI5 metadata and used asselector.type; the inspected app's component name is resolved via thesap.ushellAppLifeCycle service and used asreference.stateRegistrykeeps the first-observed value per(controlId, changeType, property). Changes are de-duplicated by(selector.id, content.property), and a property restored to its initial value is automatically removed from the list.FlexibilityRegistry.zip(sap/ui/core/util/File+JSZip), where every change is a separateid_<timestamp>_<changeType>.changefile. The archive can be unpacked directly into thechangesfolder of a flexibility/adaptation project in the Web IDE / Business Application Studio.API additions
New public
ToolsAPImethods, all backed by unit-tested modules:getFlexibilityInformation()/addFlexibilityInformation(data)/removeFlexibilityInformation(change)— register, read and remove flexibility changes (the registry data is pushed to the panel per frame alongside the existing element registry).downloadFlexibilityInformation()— generate and save the zip archive.isStateExists(key)/setStateValue(key, value)/getStateValue(key)— initial-value tracking used to drop revert-to-initial edits.Wiring
app/html/panel/ui5/index.html; the panel (app/scripts/devtools/panel/ui5/main.js) cachesflexibilityInformationper frame, keeps the grid in sync via a newon-control-flexibility-property-changemessage, and forwards the download/clear/select actions.largeicon-downloadicon was added to the DataGrid sprite map (app/scripts/modules/ui/datagrid/UIUtils.js).app/styles/less/modules/FlexibilityRegistry.less(imported inbase.less); the compiled light/dark CSS was regenerated.Tests
tests/modules/ui/FlexibilityRegistryMasterView.spec.js— constructor defaults/overrides, grid rendering,setData(incl. duplicate prevention and undefined/null input), selection handler, clear-button behavior.tests/modules/ui/FlexibilityRegistryDetailView.spec.js— editor creation/configuration, light/dark theme selection,updateandclear.grunt test/ lint suites stay green.Authors