@sap-ux/preview-middleware 0.12.13 → 0.12.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/base/flp.js +6 -1
  2. package/dist/client/adp/api-handler.js +141 -141
  3. package/dist/client/adp/command-executor.js +54 -54
  4. package/dist/client/adp/control-utils.js +44 -44
  5. package/dist/client/adp/controllers/AddFragment.controller.js +206 -206
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +57 -57
  7. package/dist/client/adp/controllers/ControllerExtension.controller.js +174 -174
  8. package/dist/client/adp/controllers/ExtensionPoint.controller.js +100 -100
  9. package/dist/client/adp/init-dialogs.js +74 -74
  10. package/dist/client/adp/ui5-version-utils.js +63 -63
  11. package/dist/client/adp/utils.js +33 -33
  12. package/dist/client/cpe/changes/flex-change.js +51 -51
  13. package/dist/client/cpe/changes/index.js +10 -10
  14. package/dist/client/cpe/changes/service.js +11 -2
  15. package/dist/client/cpe/changes/service.ts +13 -4
  16. package/dist/client/cpe/changes/validator.js +35 -35
  17. package/dist/client/cpe/documentation.js +164 -164
  18. package/dist/client/cpe/init.js +13 -2
  19. package/dist/client/cpe/init.ts +15 -1
  20. package/dist/client/cpe/logger.js +30 -30
  21. package/dist/client/cpe/outline/nodes.js +84 -84
  22. package/dist/client/cpe/outline/utils.js +37 -37
  23. package/dist/client/cpe/types.js +4 -4
  24. package/dist/client/cpe/ui5-utils.js +49 -49
  25. package/dist/client/cpe/utils.js +48 -48
  26. package/dist/client/flp/WorkspaceConnector.js +84 -69
  27. package/dist/client/flp/WorkspaceConnector.ts +18 -1
  28. package/dist/client/flp/common.js +28 -28
  29. package/dist/client/flp/common.ts +2 -0
  30. package/dist/client/flp/enableFakeConnector.js +77 -77
  31. package/dist/client/flp/init.js +220 -220
  32. package/dist/client/flp/initConnectors.js +33 -33
  33. package/dist/client/flp/initRta.js +178 -178
  34. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +3 -1
  35. package/package.json +6 -6
  36. package/templates/flp/editor.html +2 -1
@@ -1,176 +1,176 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/m/MessageToast", "sap/ui/core/library", "sap/ui/model/json/JSONModel", "sap/ui/fl/Utils", "../api-handler", "./BaseDialog.controller"], function (MessageToast, sap_ui_core_library, JSONModel, Utils, ___api_handler, __BaseDialog) {
4
- "use strict";
5
-
6
- function _interopRequireDefault(obj) {
7
- return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
- }
9
- /** sap.ui.core */
10
- const ValueState = sap_ui_core_library["ValueState"];
11
- /** sap.ui.base */
12
- const getExistingController = ___api_handler["getExistingController"];
13
- const getManifestAppdescr = ___api_handler["getManifestAppdescr"];
14
- const readControllers = ___api_handler["readControllers"];
15
- const writeChange = ___api_handler["writeChange"];
16
- const writeController = ___api_handler["writeController"];
17
- const BaseDialog = _interopRequireDefault(__BaseDialog);
18
- /**
19
- * @namespace open.ux.preview.client.adp.controllers
20
- */
21
- const ControllerExtension = BaseDialog.extend("open.ux.preview.client.adp.controllers.ControllerExtension", {
22
- constructor: function _constructor(name, overlays, rta) {
23
- BaseDialog.prototype.constructor.call(this, name);
24
- this.rta = rta;
25
- this.overlays = overlays;
26
- this.model = new JSONModel();
27
- },
28
- setup: async function _setup(dialog) {
29
- this.dialog = dialog;
30
- this.setEscapeHandler();
31
- await this.buildDialogData();
32
- this.dialog.setModel(this.model);
33
- this.dialog.open();
34
- },
35
- onControllerNameInputChange: function _onControllerNameInputChange(event) {
36
- const input = event.getSource();
37
- const beginBtn = this.dialog.getBeginButton();
38
- const controllerName = input.getValue();
39
- const controllerList = this.model.getProperty('/controllersList');
40
- const updateDialogState = function (valueState) {
41
- let valueStateText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
42
- input.setValueState(valueState).setValueStateText(valueStateText);
43
- beginBtn.setEnabled(valueState === ValueState.Success);
44
- };
45
- if (controllerName.length <= 0) {
46
- updateDialogState(ValueState.None);
47
- this.model.setProperty('/newControllerName', null);
48
- return;
49
- }
50
- const fileExists = controllerList.some(f => f.controllerName === `${controllerName}.js`);
51
- if (fileExists) {
52
- updateDialogState(ValueState.Error, 'Enter a different name. The controller name that you entered already exists in your project.');
53
- return;
54
- }
55
- const isValidName = /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(controllerName);
56
- if (!isValidName) {
57
- updateDialogState(ValueState.Error, 'The controller name cannot contain white spaces or special characters.');
58
- return;
59
- }
60
- if (controllerName.length > 64) {
61
- updateDialogState(ValueState.Error, 'A controller file name cannot contain more than 64 characters.');
62
- return;
63
- }
64
- updateDialogState(ValueState.Success);
65
- this.model.setProperty('/newControllerName', controllerName);
66
- },
67
- onCreateBtnPress: async function _onCreateBtnPress(event) {
68
- const source = event.getSource();
69
- const controllerExists = this.model.getProperty('/controllerExists');
70
- if (!controllerExists) {
71
- source.setEnabled(false);
72
- const controllerName = this.model.getProperty('/newControllerName');
73
- const viewId = this.model.getProperty('/viewId');
74
- await this.createNewController(controllerName, viewId);
75
- } else {
76
- const controllerPath = this.model.getProperty('/controllerPath');
77
- window.open(`vscode://file${controllerPath}`);
78
- }
79
- this.handleDialogClose();
80
- },
81
- buildDialogData: async function _buildDialogData() {
82
- const selectorId = this.overlays.getId();
83
- const overlayControl = sap.ui.getCore().byId(selectorId);
84
- const {
85
- controllerName,
86
- viewId
87
- } = this.getControllerInfo(overlayControl);
88
- const {
89
- controllerExists,
90
- controllerPath,
91
- controllerPathFromRoot
92
- } = await this.getExistingController(controllerName);
93
- if (controllerExists) {
94
- this.updateModelForExistingController(controllerExists, controllerPath, controllerPathFromRoot);
95
- } else {
96
- this.updateModelForNewController(viewId);
97
- await this.getControllers();
98
- }
99
- },
100
- getControllerInfo: function _getControllerInfo(overlayControl) {
101
- const control = overlayControl.getElement();
102
- const view = Utils.getViewForControl(control);
103
- const controllerName = view.getController().getMetadata().getName();
104
- const viewId = view.getId();
105
- return {
106
- controllerName,
107
- viewId
108
- };
109
- },
110
- updateModelForExistingController: function _updateModelForExistingController(controllerExists, controllerPath, controllerPathFromRoot) {
111
- this.model.setProperty('/controllerExists', controllerExists);
112
- this.model.setProperty('/controllerPath', controllerPath);
113
- this.model.setProperty('/controllerPathFromRoot', controllerPathFromRoot);
114
- const content = this.dialog.getContent();
115
- const form = content[0];
116
- form.setVisible(false);
117
- const messageForm = content[1];
118
- messageForm.setVisible(true);
119
- this.dialog.getBeginButton().setText('Open in VS Code').setEnabled(true);
120
- this.dialog.getEndButton().setText('Close');
121
- },
122
- updateModelForNewController: function _updateModelForNewController(viewId) {
123
- this.model.setProperty('/viewId', viewId);
124
- },
125
- getExistingController: async function _getExistingController(controllerName) {
126
- try {
127
- const data = await getExistingController(controllerName);
128
- return data;
129
- } catch (e) {
130
- MessageToast.show(e.message, {
131
- duration: 5000
132
- });
133
- throw new Error(e.message);
134
- }
135
- },
136
- getControllers: async function _getControllers() {
137
- try {
138
- const {
139
- controllers
140
- } = await readControllers();
141
- this.model.setProperty('/controllersList', controllers);
142
- } catch (e) {
143
- MessageToast.show(e.message, {
144
- duration: 5000
145
- });
146
- throw new Error(e.message);
147
- }
148
- },
149
- createNewController: async function _createNewController(controllerName, viewId) {
150
- try {
151
- const manifest = await getManifestAppdescr();
152
- await writeController({
153
- controllerName,
154
- projectId: manifest.id
155
- });
156
- const controllerRef = {
157
- codeRef: `coding/${controllerName}.js`,
158
- viewId
159
- };
160
- const service = await this.rta.getService('controllerExtension');
161
- const change = await service.add(controllerRef.codeRef, controllerRef.viewId);
162
- change.creation = new Date().toISOString();
163
- await writeChange(change);
164
- MessageToast.show(`Controller extension with name '${controllerName}' was created.`);
165
- } catch (e) {
166
- // We want to update the model incase we have already created a controller file but failed when creating a change file,
167
- // so when the user types the same controller name again he does not get 409 from the server, instead an error is shown in the UI
168
- await this.getControllers();
169
- MessageToast.show(e.message);
170
- throw new Error(e.message);
171
- }
172
- }
173
- });
174
- return ControllerExtension;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/m/MessageToast", "sap/ui/core/library", "sap/ui/model/json/JSONModel", "sap/ui/fl/Utils", "../api-handler", "./BaseDialog.controller"], function (MessageToast, sap_ui_core_library, JSONModel, Utils, ___api_handler, __BaseDialog) {
4
+ "use strict";
5
+
6
+ function _interopRequireDefault(obj) {
7
+ return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
+ }
9
+ /** sap.ui.core */
10
+ const ValueState = sap_ui_core_library["ValueState"];
11
+ /** sap.ui.base */
12
+ const getExistingController = ___api_handler["getExistingController"];
13
+ const getManifestAppdescr = ___api_handler["getManifestAppdescr"];
14
+ const readControllers = ___api_handler["readControllers"];
15
+ const writeChange = ___api_handler["writeChange"];
16
+ const writeController = ___api_handler["writeController"];
17
+ const BaseDialog = _interopRequireDefault(__BaseDialog);
18
+ /**
19
+ * @namespace open.ux.preview.client.adp.controllers
20
+ */
21
+ const ControllerExtension = BaseDialog.extend("open.ux.preview.client.adp.controllers.ControllerExtension", {
22
+ constructor: function _constructor(name, overlays, rta) {
23
+ BaseDialog.prototype.constructor.call(this, name);
24
+ this.rta = rta;
25
+ this.overlays = overlays;
26
+ this.model = new JSONModel();
27
+ },
28
+ setup: async function _setup(dialog) {
29
+ this.dialog = dialog;
30
+ this.setEscapeHandler();
31
+ await this.buildDialogData();
32
+ this.dialog.setModel(this.model);
33
+ this.dialog.open();
34
+ },
35
+ onControllerNameInputChange: function _onControllerNameInputChange(event) {
36
+ const input = event.getSource();
37
+ const beginBtn = this.dialog.getBeginButton();
38
+ const controllerName = input.getValue();
39
+ const controllerList = this.model.getProperty('/controllersList');
40
+ const updateDialogState = function (valueState) {
41
+ let valueStateText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
42
+ input.setValueState(valueState).setValueStateText(valueStateText);
43
+ beginBtn.setEnabled(valueState === ValueState.Success);
44
+ };
45
+ if (controllerName.length <= 0) {
46
+ updateDialogState(ValueState.None);
47
+ this.model.setProperty('/newControllerName', null);
48
+ return;
49
+ }
50
+ const fileExists = controllerList.some(f => f.controllerName === `${controllerName}.js`);
51
+ if (fileExists) {
52
+ updateDialogState(ValueState.Error, 'Enter a different name. The controller name that you entered already exists in your project.');
53
+ return;
54
+ }
55
+ const isValidName = /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(controllerName);
56
+ if (!isValidName) {
57
+ updateDialogState(ValueState.Error, 'The controller name cannot contain white spaces or special characters.');
58
+ return;
59
+ }
60
+ if (controllerName.length > 64) {
61
+ updateDialogState(ValueState.Error, 'A controller file name cannot contain more than 64 characters.');
62
+ return;
63
+ }
64
+ updateDialogState(ValueState.Success);
65
+ this.model.setProperty('/newControllerName', controllerName);
66
+ },
67
+ onCreateBtnPress: async function _onCreateBtnPress(event) {
68
+ const source = event.getSource();
69
+ const controllerExists = this.model.getProperty('/controllerExists');
70
+ if (!controllerExists) {
71
+ source.setEnabled(false);
72
+ const controllerName = this.model.getProperty('/newControllerName');
73
+ const viewId = this.model.getProperty('/viewId');
74
+ await this.createNewController(controllerName, viewId);
75
+ } else {
76
+ const controllerPath = this.model.getProperty('/controllerPath');
77
+ window.open(`vscode://file${controllerPath}`);
78
+ }
79
+ this.handleDialogClose();
80
+ },
81
+ buildDialogData: async function _buildDialogData() {
82
+ const selectorId = this.overlays.getId();
83
+ const overlayControl = sap.ui.getCore().byId(selectorId);
84
+ const {
85
+ controllerName,
86
+ viewId
87
+ } = this.getControllerInfo(overlayControl);
88
+ const {
89
+ controllerExists,
90
+ controllerPath,
91
+ controllerPathFromRoot
92
+ } = await this.getExistingController(controllerName);
93
+ if (controllerExists) {
94
+ this.updateModelForExistingController(controllerExists, controllerPath, controllerPathFromRoot);
95
+ } else {
96
+ this.updateModelForNewController(viewId);
97
+ await this.getControllers();
98
+ }
99
+ },
100
+ getControllerInfo: function _getControllerInfo(overlayControl) {
101
+ const control = overlayControl.getElement();
102
+ const view = Utils.getViewForControl(control);
103
+ const controllerName = view.getController().getMetadata().getName();
104
+ const viewId = view.getId();
105
+ return {
106
+ controllerName,
107
+ viewId
108
+ };
109
+ },
110
+ updateModelForExistingController: function _updateModelForExistingController(controllerExists, controllerPath, controllerPathFromRoot) {
111
+ this.model.setProperty('/controllerExists', controllerExists);
112
+ this.model.setProperty('/controllerPath', controllerPath);
113
+ this.model.setProperty('/controllerPathFromRoot', controllerPathFromRoot);
114
+ const content = this.dialog.getContent();
115
+ const form = content[0];
116
+ form.setVisible(false);
117
+ const messageForm = content[1];
118
+ messageForm.setVisible(true);
119
+ this.dialog.getBeginButton().setText('Open in VS Code').setEnabled(true);
120
+ this.dialog.getEndButton().setText('Close');
121
+ },
122
+ updateModelForNewController: function _updateModelForNewController(viewId) {
123
+ this.model.setProperty('/viewId', viewId);
124
+ },
125
+ getExistingController: async function _getExistingController(controllerName) {
126
+ try {
127
+ const data = await getExistingController(controllerName);
128
+ return data;
129
+ } catch (e) {
130
+ MessageToast.show(e.message, {
131
+ duration: 5000
132
+ });
133
+ throw new Error(e.message);
134
+ }
135
+ },
136
+ getControllers: async function _getControllers() {
137
+ try {
138
+ const {
139
+ controllers
140
+ } = await readControllers();
141
+ this.model.setProperty('/controllersList', controllers);
142
+ } catch (e) {
143
+ MessageToast.show(e.message, {
144
+ duration: 5000
145
+ });
146
+ throw new Error(e.message);
147
+ }
148
+ },
149
+ createNewController: async function _createNewController(controllerName, viewId) {
150
+ try {
151
+ const manifest = await getManifestAppdescr();
152
+ await writeController({
153
+ controllerName,
154
+ projectId: manifest.id
155
+ });
156
+ const controllerRef = {
157
+ codeRef: `coding/${controllerName}.js`,
158
+ viewId
159
+ };
160
+ const service = await this.rta.getService('controllerExtension');
161
+ const change = await service.add(controllerRef.codeRef, controllerRef.viewId);
162
+ change.creation = new Date().toISOString();
163
+ await writeChange(change);
164
+ MessageToast.show(`Controller extension with name '${controllerName}' was created.`);
165
+ } catch (e) {
166
+ // We want to update the model incase we have already created a controller file but failed when creating a change file,
167
+ // so when the user types the same controller name again he does not get 409 from the server, instead an error is shown in the UI
168
+ await this.getControllers();
169
+ MessageToast.show(e.message);
170
+ throw new Error(e.message);
171
+ }
172
+ }
173
+ });
174
+ return ControllerExtension;
175
175
  });
176
176
  //# sourceMappingURL=ControllerExtension.controller.js.map
@@ -1,102 +1,102 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/m/MessageToast", "sap/ui/model/json/JSONModel", "../api-handler", "./BaseDialog.controller"], function (MessageToast, JSONModel, ___api_handler, __BaseDialog) {
4
- "use strict";
5
-
6
- function _interopRequireDefault(obj) {
7
- return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
- }
9
- const getFragments = ___api_handler["getFragments"];
10
- const writeFragment = ___api_handler["writeFragment"];
11
- const BaseDialog = _interopRequireDefault(__BaseDialog);
12
- /**
13
- * @namespace open.ux.preview.client.adp.controllers
14
- */
15
- const ExtensionPoint = BaseDialog.extend("open.ux.preview.client.adp.controllers.ExtensionPoint", {
16
- constructor: function _constructor(name, _overlays, _rta, data) {
17
- BaseDialog.prototype.constructor.call(this, name);
18
- this.model = new JSONModel();
19
- this.data = data;
20
- },
21
- setup: async function _setup(dialog) {
22
- this.dialog = dialog;
23
- this.setEscapeHandler();
24
- await this.buildDialogData();
25
- this.dialog.setModel(this.model);
26
- this.dialog.open();
27
- },
28
- onCreateBtnPress: async function _onCreateBtnPress(event) {
29
- const source = event.getSource();
30
- source.setEnabled(false);
31
- const fragmentName = this.model.getProperty('/newFragmentName');
32
- await this.createNewFragment(fragmentName);
33
- this.handleDialogClose();
34
- },
35
- onExtensionPointHandler: function _onExtensionPointHandler(event) {
36
- const source = event.getSource();
37
- const selectedItem = source.getSelectedItem();
38
- let extensionPointName = '';
39
- if (selectedItem) {
40
- extensionPointName = selectedItem.getText();
41
- }
42
- this.model.setProperty('/extensionPointName', extensionPointName);
43
- },
44
- buildDialogData: async function _buildDialogData() {
45
- const name = this.data?.name;
46
- if (name) {
47
- const extensionPointList = [{
48
- key: 0,
49
- value: name
50
- }];
51
- this.updateModel(name, 0, extensionPointList, false);
52
- } else {
53
- const extensionPointList = this.data.info.map((v, idx) => {
54
- return {
55
- key: idx,
56
- value: v.name
57
- };
58
- });
59
- const enabled = extensionPointList.length > 1;
60
- this.updateModel(extensionPointList[0].value, 0, extensionPointList, enabled);
61
- }
62
- try {
63
- const {
64
- fragments
65
- } = await getFragments();
66
- this.model.setProperty('/fragmentList', fragments);
67
- } catch (e) {
68
- MessageToast.show(e.message);
69
- throw new Error(e.message);
70
- }
71
- },
72
- updateModel: function _updateModel(name, key, list, enabled) {
73
- this.model.setProperty('/extensionPointName', name);
74
- this.model.setProperty('/extensionPointKey', key);
75
- this.model.setProperty('/extensionPointList', list);
76
- this.model.setProperty('/extensionListEnabled', enabled);
77
- },
78
- createNewFragment: async function _createNewFragment(fragmentName) {
79
- try {
80
- await writeFragment({
81
- fragmentName
82
- });
83
- MessageToast.show(`Fragment with name '${fragmentName}' was created.`);
84
- } catch (e) {
85
- // In case of error when creating a new fragment, we should not create a change file
86
- MessageToast.show(e.message);
87
- throw new Error(e.message);
88
- }
89
- await this.createExtensionPointFragmentChange(fragmentName);
90
- },
91
- createExtensionPointFragmentChange: async function _createExtensionPointFragmentChange(fragmentName) {
92
- const extensionPointName = this.model.getProperty('/extensionPointName');
93
- const modifiedValue = {
94
- fragmentPath: `fragments/${fragmentName}.fragment.xml`,
95
- extensionPointName
96
- };
97
- this.data.deferred.resolve(modifiedValue);
98
- }
99
- });
100
- return ExtensionPoint;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/m/MessageToast", "sap/ui/model/json/JSONModel", "../api-handler", "./BaseDialog.controller"], function (MessageToast, JSONModel, ___api_handler, __BaseDialog) {
4
+ "use strict";
5
+
6
+ function _interopRequireDefault(obj) {
7
+ return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
+ }
9
+ const getFragments = ___api_handler["getFragments"];
10
+ const writeFragment = ___api_handler["writeFragment"];
11
+ const BaseDialog = _interopRequireDefault(__BaseDialog);
12
+ /**
13
+ * @namespace open.ux.preview.client.adp.controllers
14
+ */
15
+ const ExtensionPoint = BaseDialog.extend("open.ux.preview.client.adp.controllers.ExtensionPoint", {
16
+ constructor: function _constructor(name, _overlays, _rta, data) {
17
+ BaseDialog.prototype.constructor.call(this, name);
18
+ this.model = new JSONModel();
19
+ this.data = data;
20
+ },
21
+ setup: async function _setup(dialog) {
22
+ this.dialog = dialog;
23
+ this.setEscapeHandler();
24
+ await this.buildDialogData();
25
+ this.dialog.setModel(this.model);
26
+ this.dialog.open();
27
+ },
28
+ onCreateBtnPress: async function _onCreateBtnPress(event) {
29
+ const source = event.getSource();
30
+ source.setEnabled(false);
31
+ const fragmentName = this.model.getProperty('/newFragmentName');
32
+ await this.createNewFragment(fragmentName);
33
+ this.handleDialogClose();
34
+ },
35
+ onExtensionPointHandler: function _onExtensionPointHandler(event) {
36
+ const source = event.getSource();
37
+ const selectedItem = source.getSelectedItem();
38
+ let extensionPointName = '';
39
+ if (selectedItem) {
40
+ extensionPointName = selectedItem.getText();
41
+ }
42
+ this.model.setProperty('/extensionPointName', extensionPointName);
43
+ },
44
+ buildDialogData: async function _buildDialogData() {
45
+ const name = this.data?.name;
46
+ if (name) {
47
+ const extensionPointList = [{
48
+ key: 0,
49
+ value: name
50
+ }];
51
+ this.updateModel(name, 0, extensionPointList, false);
52
+ } else {
53
+ const extensionPointList = this.data.info.map((v, idx) => {
54
+ return {
55
+ key: idx,
56
+ value: v.name
57
+ };
58
+ });
59
+ const enabled = extensionPointList.length > 1;
60
+ this.updateModel(extensionPointList[0].value, 0, extensionPointList, enabled);
61
+ }
62
+ try {
63
+ const {
64
+ fragments
65
+ } = await getFragments();
66
+ this.model.setProperty('/fragmentList', fragments);
67
+ } catch (e) {
68
+ MessageToast.show(e.message);
69
+ throw new Error(e.message);
70
+ }
71
+ },
72
+ updateModel: function _updateModel(name, key, list, enabled) {
73
+ this.model.setProperty('/extensionPointName', name);
74
+ this.model.setProperty('/extensionPointKey', key);
75
+ this.model.setProperty('/extensionPointList', list);
76
+ this.model.setProperty('/extensionListEnabled', enabled);
77
+ },
78
+ createNewFragment: async function _createNewFragment(fragmentName) {
79
+ try {
80
+ await writeFragment({
81
+ fragmentName
82
+ });
83
+ MessageToast.show(`Fragment with name '${fragmentName}' was created.`);
84
+ } catch (e) {
85
+ // In case of error when creating a new fragment, we should not create a change file
86
+ MessageToast.show(e.message);
87
+ throw new Error(e.message);
88
+ }
89
+ await this.createExtensionPointFragmentChange(fragmentName);
90
+ },
91
+ createExtensionPointFragmentChange: async function _createExtensionPointFragmentChange(fragmentName) {
92
+ const extensionPointName = this.model.getProperty('/extensionPointName');
93
+ const modifiedValue = {
94
+ fragmentPath: `fragments/${fragmentName}.fragment.xml`,
95
+ extensionPointName
96
+ };
97
+ this.data.deferred.resolve(modifiedValue);
98
+ }
99
+ });
100
+ return ExtensionPoint;
101
101
  });
102
102
  //# sourceMappingURL=ExtensionPoint.controller.js.map