@sap-ux/inquirer-common 0.5.7 → 0.5.9

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.
@@ -234,6 +234,15 @@ export declare class ErrorHandler {
234
234
  * @returns A validation help link or help link message
235
235
  */
236
236
  static getHelpForError(errorType: ERROR_TYPE, errorMsg?: string): ValidationLinkOrString | undefined;
237
+ /**
238
+ * Get a help link for the specified help node.
239
+ *
240
+ * @param helpNode The help node to get the link for
241
+ * @param errorType The error type
242
+ * @param errorMsg The error message to display with the help link
243
+ * @returns A validation help link
244
+ */
245
+ static getHelpLink(helpNode: number, errorType: ERROR_TYPE, errorMsg: string): ValidationLink;
237
246
  }
238
247
  export {};
239
248
  //# sourceMappingURL=error-handler.d.ts.map
@@ -575,35 +575,46 @@ class ErrorHandler {
575
575
  static getHelpForError(errorType, errorMsg) {
576
576
  const helpNode = ErrorHandler.getHelpNode(errorType);
577
577
  const mappedErrorMsg = errorMsg ?? ErrorHandler.getErrorMsgFromType(errorType);
578
- if (helpNode) {
579
- const valLink = {
580
- message: mappedErrorMsg ?? '',
581
- link: {
582
- text: (0, i18n_1.t)('guidedAnswers.validationErrorHelpText'),
583
- icon: guided_answers_helper_1.GUIDED_ANSWERS_ICON,
584
- url: (0, guided_answers_helper_1.getHelpUrl)(guided_answers_helper_1.HELP_TREE.FIORI_TOOLS, [helpNode])
578
+ if (helpNode && mappedErrorMsg) {
579
+ return this.getHelpLink(helpNode, errorType, mappedErrorMsg);
580
+ }
581
+ return mappedErrorMsg;
582
+ }
583
+ /**
584
+ * Get a help link for the specified help node.
585
+ *
586
+ * @param helpNode The help node to get the link for
587
+ * @param errorType The error type
588
+ * @param errorMsg The error message to display with the help link
589
+ * @returns A validation help link
590
+ */
591
+ static getHelpLink(helpNode, errorType, errorMsg) {
592
+ const valLink = {
593
+ message: errorMsg,
594
+ link: {
595
+ text: (0, i18n_1.t)('guidedAnswers.validationErrorHelpText'),
596
+ icon: guided_answers_helper_1.GUIDED_ANSWERS_ICON,
597
+ url: (0, guided_answers_helper_1.getHelpUrl)(guided_answers_helper_1.HELP_TREE.FIORI_TOOLS, [helpNode])
598
+ }
599
+ };
600
+ if (this.guidedAnswersEnabled) {
601
+ valLink.link.command = {
602
+ id: guided_answers_helper_1.GUIDED_ANSWERS_LAUNCH_CMD_ID,
603
+ params: {
604
+ treeId: guided_answers_helper_1.HELP_TREE.FIORI_TOOLS,
605
+ nodeIdPath: [helpNode],
606
+ trigger: this.guidedAnswersTrigger
585
607
  }
586
608
  };
587
- if (this.guidedAnswersEnabled) {
588
- valLink.link.command = {
589
- id: guided_answers_helper_1.GUIDED_ANSWERS_LAUNCH_CMD_ID,
590
- params: {
591
- treeId: guided_answers_helper_1.HELP_TREE.FIORI_TOOLS,
592
- nodeIdPath: [helpNode],
593
- trigger: this.guidedAnswersTrigger
594
- }
595
- };
596
- }
597
- // Report the GA link created event
598
- (0, telemetry_1.sendTelemetryEvent)(telemEventGALinkCreated, {
599
- errorType,
600
- isGuidedAnswersEnabled: this.guidedAnswersEnabled,
601
- nodeIdPath: `${helpNode}`,
602
- Platform: this.platform ?? (0, fiori_generator_shared_1.getHostEnvironment)().technical
603
- });
604
- return new types_1.ValidationLink(valLink);
605
609
  }
606
- return mappedErrorMsg;
610
+ // Report the GA link created event
611
+ (0, telemetry_1.sendTelemetryEvent)(telemEventGALinkCreated, {
612
+ errorType,
613
+ isGuidedAnswersEnabled: this.guidedAnswersEnabled,
614
+ nodeIdPath: `${helpNode}`,
615
+ Platform: this.platform ?? (0, fiori_generator_shared_1.getHostEnvironment)().technical
616
+ });
617
+ return new types_1.ValidationLink(valLink);
607
618
  }
608
619
  }
609
620
  exports.ErrorHandler = ErrorHandler;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/inquirer-common",
3
3
  "description": "Commonly used shared functionality and types to support inquirer modules.",
4
- "version": "0.5.7",
4
+ "version": "0.5.9",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,9 +30,9 @@
30
30
  "semver": "7.5.4",
31
31
  "@sap-ux/btp-utils": "0.17.1",
32
32
  "@sap-ux/feature-toggle": "0.2.3",
33
- "@sap-ux/fiori-generator-shared": "0.7.12",
34
- "@sap-ux/guided-answers-helper": "0.1.0",
35
- "@sap-ux/telemetry": "0.5.46",
33
+ "@sap-ux/fiori-generator-shared": "0.7.13",
34
+ "@sap-ux/guided-answers-helper": "0.1.1",
35
+ "@sap-ux/telemetry": "0.5.47",
36
36
  "@sap-ux/logger": "0.6.0",
37
37
  "@sap-ux/ui5-info": "0.8.3"
38
38
  },