@sap-ux/ui-service-inquirer 0.0.25 → 0.0.27

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.
@@ -64,8 +64,9 @@ function getServiceNameQuestion(logger, options) {
64
64
  prompt_state_1.PromptState.serviceConfig.content =
65
65
  (await prompt_state_1.PromptState.systemSelection.objectGenerator?.getContent(packageValue)) ?? '';
66
66
  const content = JSON.parse(prompt_state_1.PromptState.serviceConfig?.content);
67
- if ((0, prompt_helper_1.defaultOrShowDraftQuestion)(options?.useDraftEnabled)) {
68
- content.businessObject.projectionBehavior.withDraft = true;
67
+ if ((0, prompt_helper_1.defaultOrShowDraftQuestion)(options?.useDraftEnabled) &&
68
+ content.businessObject?.projectionBehavior?.withDraft) {
69
+ prompt_state_1.PromptState.serviceConfig.showDraftEnabled = true;
69
70
  }
70
71
  prompt_state_1.PromptState.serviceConfig.content = JSON.stringify(content);
71
72
  prompt_state_1.PromptState.serviceConfig.serviceName =
@@ -110,6 +111,7 @@ function getServiceNameQuestion(logger, options) {
110
111
  function getDraftEnabledQuestion(logger) {
111
112
  let draftEnabled = true;
112
113
  return {
114
+ when: () => prompt_state_1.PromptState.serviceConfig.showDraftEnabled,
113
115
  name: 'draftEnabled',
114
116
  type: 'confirm',
115
117
  message: (0, i18n_1.t)('prompts.draftEnabled'),
@@ -46,7 +46,8 @@ class PromptState {
46
46
  PromptState.systemSelection = {};
47
47
  PromptState.serviceConfig = {
48
48
  content: '',
49
- serviceName: ''
49
+ serviceName: '',
50
+ showDraftEnabled: false
50
51
  };
51
52
  }
52
53
  static resetConnectedSystem() {
@@ -55,7 +56,8 @@ class PromptState {
55
56
  static resetServiceConfig() {
56
57
  PromptState.serviceConfig = {
57
58
  content: '',
58
- serviceName: ''
59
+ serviceName: '',
60
+ showDraftEnabled: false
59
61
  };
60
62
  }
61
63
  }
package/dist/types.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface UiServiceAnswers extends AbapDeployConfigAnswersInternal {
17
17
  export interface ServiceConfig {
18
18
  content: string;
19
19
  serviceName: string;
20
+ showDraftEnabled: boolean;
20
21
  }
21
22
  export type SystemSelectionQuestion = Question<UiServiceAnswers>;
22
23
  export type ServiceConfigQuestion = YUIQuestion<UiServiceAnswers>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui-service-inquirer",
3
3
  "description": "Generator for creating UI Service",
4
- "version": "0.0.25",
4
+ "version": "0.0.27",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -29,7 +29,7 @@
29
29
  "@sap-ux/guided-answers-helper": "0.2.2",
30
30
  "@sap-ux/inquirer-common": "0.6.39",
31
31
  "@sap-ux/logger": "0.6.0",
32
- "@sap-ux/odata-service-inquirer": "2.3.3",
32
+ "@sap-ux/odata-service-inquirer": "2.3.4",
33
33
  "@sap-ux/telemetry": "0.5.77"
34
34
  },
35
35
  "devDependencies": {