From 3120d93f18e0687667af1ea5b702d4b49b99f571 Mon Sep 17 00:00:00 2001 From: Galimede Date: Tue, 13 Jun 2023 14:53:06 +0200 Subject: [PATCH] feat(cc-env-var-editor-json): make use of the cc-notice instead of cc-error --- .../cc-env-var-editor-json.js | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/cc-env-var-editor-json/cc-env-var-editor-json.js b/src/components/cc-env-var-editor-json/cc-env-var-editor-json.js index e8ad974f5..f65830ff5 100644 --- a/src/components/cc-env-var-editor-json/cc-env-var-editor-json.js +++ b/src/components/cc-env-var-editor-json/cc-env-var-editor-json.js @@ -3,7 +3,7 @@ import { css, html, LitElement } from 'lit'; import { dispatchCustomEvent } from '../../lib/events.js'; import { i18n } from '../../lib/i18n.js'; import '../cc-input-text/cc-input-text.js'; -import '../cc-error/cc-error.js'; +import '../cc-notice/cc-notice.js'; import { linkStyles } from '../../templates/cc-link/cc-link.js'; const SKELETON_VARIABLES = [ @@ -67,43 +67,43 @@ export class CcEnvVarEditorJson extends LitElement { if (type === ERROR_TYPES.INVALID_NAME) { return { msg: i18n('cc-env-var-editor-json.errors.invalid-name', { name }), - isNotice: false, + isWarning: false, }; } if (type === ERROR_TYPES.DUPLICATED_NAME) { return { msg: i18n('cc-env-var-editor-json.errors.duplicated-name', { name }), - isNotice: false, + isWarning: false, }; } if (type === ERROR_TYPES.INVALID_JSON) { return { msg: i18n('cc-env-var-editor-json.errors.invalid-json'), - isNotice: false, + isWarning: false, }; } if (type === ERROR_TYPES.INVALID_JSON_FORMAT) { return { msg: i18n('cc-env-var-editor-json.errors.invalid-json-format'), - isNotice: false, + isWarning: false, }; } if (type === ERROR_TYPES.INVALID_JSON_ENTRY) { return { msg: i18n('cc-env-var-editor-json.errors.invalid-json-entry'), - isNotice: false, + isWarning: false, }; } if (type === ERROR_TYPES.INVALID_NAME_STRICT) { return { msg: i18n('cc-env-var-editor-json.errors.invalid-name-strict', { name }), - isNotice: false, + isWarning: false, }; } if (type === ERROR_TYPES.JAVA_INFO) { return { msg: i18n('cc-env-var-editor-json.info.java-prop', { name }), - isNotice: true, + isWarning: true, }; } return { line: '?', msg: i18n('cc-env-var-editor-json.errors.unknown') }; @@ -156,13 +156,13 @@ export class CcEnvVarEditorJson extends LitElement { ${this._errors.length > 0 ? html`
- ${this._errors.map(({ msg, isNotice }) => html` - ${!isNotice ? html` - ${msg} - ` : ''} - ${isNotice ? html` - ${msg} - ` : ''} + ${this._errors.map(({ msg, isWarning }) => html` + +
+ ${msg} +
+
+ `)}
` : ''} @@ -195,7 +195,7 @@ export class CcEnvVarEditorJson extends LitElement { /* i18n error message may contain tags */ - cc-error code, + cc-notice code, .example code { padding: 0.15em 0.3em; background-color: var(--cc-color-bg-neutral, #eee);