diff --git a/packages/backend/src/images/messageImages.ts b/packages/backend/src/images/messageImages.ts index e42f20de..d0d4a2f1 100644 --- a/packages/backend/src/images/messageImages.ts +++ b/packages/backend/src/images/messageImages.ts @@ -25,7 +25,7 @@ const errorVSCodeLight = // const errorTheiaLight = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIgdmlld0JveD0iMCAwIDE3IDE3Ij4NCiAgPGRlZnM+DQogICAgPGNsaXBQYXRoIGlkPSJjbGlwLWVycm9yX3RoZWlhX2xpZ2h0Ij4NCiAgICAgIDxyZWN0IHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIvPg0KICAgIDwvY2xpcFBhdGg+DQogIDwvZGVmcz4NCiAgPGcgaWQ9ImVycm9yX3RoZWlhX2xpZ2h0IiBjbGlwLXBhdGg9InVybCgjY2xpcC1lcnJvcl90aGVpYV9saWdodCkiPg0KICAgIDxnIGlkPSJHcm91cF8zNTMxIiBkYXRhLW5hbWU9Ikdyb3VwIDM1MzEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xIC0xLjAwNCkiPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMTYwOCIgZGF0YS1uYW1lPSJQYXRoIDE2MDgiIGQ9Ik0yMzAuMzUxLTEwMi40YTguNSw4LjUsMCwwLDAtOC41LDguNSw4LjUsOC41LDAsMCwwLDguNSw4LjUsOC41LDguNSwwLDAsMCw4LjUtOC41LDguNSw4LjUsMCwwLDAtOC41LTguNVptMy41NTQsMTIuMzc2YS43OTMuNzkzLDAsMCwxLS41NTkuMjI3LjguOCwwLDAsMS0uNTY3LS4yMzdsLTIuNDQtMi40NzMtMi41NTgsMi42MjdhLjc5My43OTMsMCwwLDEtLjU2Ny4yNDEuNzkzLjc5MywwLDAsMS0uNTU2LS4yMjcuNzkzLjc5MywwLDAsMS0uMjQzLS41NjEuNzkzLjc5MywwLDAsMSwuMjI4LS41NjdsMi41ODItMi42NS0yLjM2NS0yLjRhLjc5My43OTMsMCwwLDEtLjIzMS0uNTY1Ljc5My43OTMsMCwwLDEsLjIzOS0uNTYyLjc5My43OTMsMCwwLDEsLjU2NS0uMjMxLjc5My43OTMsMCwwLDEsLjU2Mi4yMzlsMi4zNDMsMi4zNzMsMi4zMDktMi4zNzFhLjc5NC43OTQsMCwwLDEsLjU2LS4yNDIuNzkzLjc5MywwLDAsMSwuNTY2LjIyNy43OTMuNzkzLDAsMCwxLC4yNDMuNTYxLjc5My43OTMsMCwwLDEtLjIyOC41NjdsLTIuMzMxLDIuMzkyLDIuNDYyLDIuNDkzYS43OTMuNzkzLDAsMCwxLC4yMjkuNTY3Ljc5My43OTMsMCwwLDEtLjI0My41NjJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjIwLjg1MSAxMDMuNDA0KSIgZmlsbD0iI2U4NGQ0ZCIvPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+DQo=" -export function getImage(state: number) { +export function getImage(state: Severity) { if (state === Severity.error) { return Constants.IS_IN_BAS ? errorTheiaDark diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 6428555e..aae4467a 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -49,7 +49,7 @@ }, "dependencies": { "@mdi/font": "5.9.55", - "@sap-devx/inquirer-gui": "0.5.0", + "@sap-devx/inquirer-gui": "0.6.0", "@sap-devx/inquirer-gui-auto-complete-plugin": "0.0.1", "@sap-devx/inquirer-gui-file-browser-plugin": "0.0.5", "@sap-devx/inquirer-gui-folder-browser-plugin": "0.0.3", diff --git a/packages/generator-foodq/generators/app/index.js b/packages/generator-foodq/generators/app/index.js index 6c17800d..42606757 100644 --- a/packages/generator-foodq/generators/app/index.js +++ b/packages/generator-foodq/generators/app/index.js @@ -182,6 +182,41 @@ module.exports = class extends Generator { hint: "Our recommendation is green", breadcrumb: "Napkin color", }, + additionalMessages: (input, answers) => { + if (input === "warn") { + return { + message: "Some warning message", + severity: 1, + }; + } + if (input === "blue" && answers["confirmHungry"] === false) { + return { + message: `Some conditional warning message (Confirm hungry: ${answers["confirmHungry"]})`, + severity: 1, + }; + } + if (input === "infolong") { + return { + message: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + + "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", + severity: 2, + }; + } + if (input === "info") { + return { + message: "Some info message", + severity: 2, + }; + } + if (input === "error") { + return { + message: "Some error message (consider using a validation message)", + severity: 0, + }; + } + }, when: (response) => { if (_.isNil(this._getOption("favColor"))) { const hungry = this._getAnswer("hungry", response); diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index aee1c373..29d5dd66 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -96,3 +96,11 @@ export interface IValidationLink { */ toString(): string; } + +/** + * Messages with severity + */ +export interface IMessageSeverity { + message: string; + severity: Severity; +} diff --git a/yarn.lock b/yarn.lock index 3110a82a..7dffac41 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2381,10 +2381,10 @@ dependencies: vue "^2.6.10" -"@sap-devx/inquirer-gui@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@sap-devx/inquirer-gui/-/inquirer-gui-0.5.0.tgz#fa6cc903b301fc653f1bfba92772fa224304e3b6" - integrity sha512-4ldYrKyoqtgcJioCxEp+QZMDck2bQgzN/rkh9S2cKPqCJs1oEl0f6hFB1uqmkF2Te+oaK9mI1/CemwCS4BRovA== +"@sap-devx/inquirer-gui@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@sap-devx/inquirer-gui/-/inquirer-gui-0.6.0.tgz#57cbb4a8108137e74432d544456ee835d66419d6" + integrity sha512-/daSaSx6ul6+4CIslG/LDZQbldgMb+5JAmjpLmhx8DQLhsOrNxYQABJbaDFws9h0om1EcQcelXn8KbOY3alSzQ== dependencies: strip-ansi "^6.0.0" vue "2.6.12"