diff --git a/changelog/24299.txt b/changelog/24299.txt
new file mode 100644
index 000000000000..1b295b985687
--- /dev/null
+++ b/changelog/24299.txt
@@ -0,0 +1,3 @@
+```release-note:improvement
+ui: Update AlertInline component to use Helios Design System Alert component
+```
diff --git a/ui/app/components/auth-saml.hbs b/ui/app/components/auth-saml.hbs
index f555bd92a186..8d69fe8759ce 100644
--- a/ui/app/components/auth-saml.hbs
+++ b/ui/app/components/auth-saml.hbs
@@ -22,8 +22,7 @@
/>
diff --git a/ui/app/styles/components/doc-link.scss b/ui/app/styles/components/doc-link.scss
index 3e8a7345c0be..20edb9d62dc8 100644
--- a/ui/app/styles/components/doc-link.scss
+++ b/ui/app/styles/components/doc-link.scss
@@ -11,12 +11,3 @@
text-decoration: underline !important;
}
}
-
-.doc-link-subtle {
- color: inherit;
- text-decoration: underline;
- font-weight: inherit;
- &:hover {
- color: inherit;
- }
-}
diff --git a/ui/app/templates/components/auth-form-options.hbs b/ui/app/templates/components/auth-form-options.hbs
index 3505b8e262c2..ace2085cfb28 100644
--- a/ui/app/templates/components/auth-form-options.hbs
+++ b/ui/app/templates/components/auth-form-options.hbs
@@ -23,8 +23,7 @@
/>
diff --git a/ui/app/templates/components/auth-form.hbs b/ui/app/templates/components/auth-form.hbs
index 35506c5cb3c5..8d06e36dcd86 100644
--- a/ui/app/templates/components/auth-form.hbs
+++ b/ui/app/templates/components/auth-form.hbs
@@ -191,8 +191,7 @@
/>
{{#if (and this.delayAuthMessageReminder.isIdle this.showLoading)}}
diff --git a/ui/app/templates/components/clients/attribution.hbs b/ui/app/templates/components/clients/attribution.hbs
index 7cea4fe50ecb..5418b26b5b27 100644
--- a/ui/app/templates/components/clients/attribution.hbs
+++ b/ui/app/templates/components/clients/attribution.hbs
@@ -112,17 +112,24 @@
{{#if @upgradeExplanation}}
-
-
- Your data contains an upgrade.
-
+
+ Your data contains an upgrade.
+ {{@upgradeExplanation}}
+ Visit our
+
- Learn more here.
-
-
-
{{@upgradeExplanation}}
-
+ Client count FAQ
+
+ for more information.
+
+
{{/if}}
diff --git a/ui/app/templates/components/date-dropdown.hbs b/ui/app/templates/components/date-dropdown.hbs
index 4e87843a2a10..d154886f6a46 100644
--- a/ui/app/templates/components/date-dropdown.hbs
+++ b/ui/app/templates/components/date-dropdown.hbs
@@ -34,5 +34,5 @@
/>
{{#if this.invalidDate}}
-
+
{{/if}}
\ No newline at end of file
diff --git a/ui/app/templates/components/keymgmt/distribute.hbs b/ui/app/templates/components/keymgmt/distribute.hbs
index c9c54a33320e..06439b8a5a0f 100644
--- a/ui/app/templates/components/keymgmt/distribute.hbs
+++ b/ui/app/templates/components/keymgmt/distribute.hbs
@@ -28,11 +28,20 @@
@disallowNewItems={{false}}
>
{{#if (and this.validMatchError.key (not this.isNewKey))}}
-
- {{this.validMatchError.key}}
- To check compatibility,
- refer to this table.
-
+
+
+ {{this.validMatchError.key}}
+ To check compatibility,
+
+ refer to this table
+ .
+
+
{{/if}}
@@ -62,11 +71,20 @@
{{#if this.validMatchError.key}}
-
- {{this.validMatchError.key}}
- To check compatibility,
- refer to this table.
-
+
+
+ {{this.validMatchError.key}}
+ To check compatibility,
+
+ refer to this table
+ .
+
+
{{/if}}
@@ -89,11 +107,20 @@
data-test-keymgmt-dist-provider
>
{{#if this.validMatchError.provider}}
-
- {{this.validMatchError.provider}}
- To check compatibility,
- refer to this table.
-
+
+
+ {{this.validMatchError.provider}}
+ To check compatibility,
+
+ refer to this table
+ .
+
+
{{/if}}
diff --git a/ui/app/templates/components/mfa/mfa-form.hbs b/ui/app/templates/components/mfa/mfa-form.hbs
index 5ec07b60a172..a2587b47b3ab 100644
--- a/ui/app/templates/components/mfa/mfa-form.hbs
+++ b/ui/app/templates/components/mfa/mfa-form.hbs
@@ -58,7 +58,7 @@
{{#if this.newCodeDelay.isRunning}}
{{/if}}
{{#if this.invalidFormAlert}}
{{/if}}
diff --git a/ui/app/templates/components/oidc/assignment-form.hbs b/ui/app/templates/components/oidc/assignment-form.hbs
index 8ce86f21687a..13ff8044f6db 100644
--- a/ui/app/templates/components/oidc/assignment-form.hbs
+++ b/ui/app/templates/components/oidc/assignment-form.hbs
@@ -63,7 +63,7 @@
data-test-oidc-assignment-cancel
/>
{{#if this.modelValidations.targets.errors}}
-
+
{{/if}}
\ No newline at end of file
diff --git a/ui/app/templates/components/oidc/client-form.hbs b/ui/app/templates/components/oidc/client-form.hbs
index e2c0a9def19b..d789ad92873f 100644
--- a/ui/app/templates/components/oidc/client-form.hbs
+++ b/ui/app/templates/components/oidc/client-form.hbs
@@ -97,7 +97,7 @@
{{#if this.invalidFormAlert}}
{{/if}}
diff --git a/ui/app/templates/components/oidc/key-form.hbs b/ui/app/templates/components/oidc/key-form.hbs
index 9ea41100b07e..77e983fd1d8f 100644
--- a/ui/app/templates/components/oidc/key-form.hbs
+++ b/ui/app/templates/components/oidc/key-form.hbs
@@ -98,7 +98,7 @@
{{#if this.invalidFormAlert}}
{{/if}}
diff --git a/ui/app/templates/components/oidc/provider-form.hbs b/ui/app/templates/components/oidc/provider-form.hbs
index b51e0d1e86eb..b09ca7a2cf7f 100644
--- a/ui/app/templates/components/oidc/provider-form.hbs
+++ b/ui/app/templates/components/oidc/provider-form.hbs
@@ -125,7 +125,7 @@
{{#if this.invalidFormAlert}}
{{/if}}
diff --git a/ui/app/templates/components/oidc/scope-form.hbs b/ui/app/templates/components/oidc/scope-form.hbs
index 76541045a80c..f6e3667982a8 100644
--- a/ui/app/templates/components/oidc/scope-form.hbs
+++ b/ui/app/templates/components/oidc/scope-form.hbs
@@ -73,7 +73,7 @@
{{#if this.invalidFormAlert}}
{{/if}}
diff --git a/ui/app/templates/components/secret-create-or-update.hbs b/ui/app/templates/components/secret-create-or-update.hbs
index fbb491677eba..8650d73fdab7 100644
--- a/ui/app/templates/components/secret-create-or-update.hbs
+++ b/ui/app/templates/components/secret-create-or-update.hbs
@@ -26,12 +26,7 @@
/>
{{#if (get this.validationMessages "path")}}
-
+
{{/if}}
{{#if @modelForData.isFolder}}
@@ -104,12 +99,7 @@
{{#if this.validationMessages.key}}
-
+
{{/if}}
{{/each}}
diff --git a/ui/lib/core/addon/components/alert-inline.hbs b/ui/lib/core/addon/components/alert-inline.hbs
index f0637176cb91..0496ce57d621 100644
--- a/ui/lib/core/addon/components/alert-inline.hbs
+++ b/ui/lib/core/addon/components/alert-inline.hbs
@@ -3,22 +3,16 @@
SPDX-License-Identifier: BUSL-1.1
~}}
-
- {{#if this.isRefreshing}}
-
- {{else}}
-
-
- {{#if (has-block)}}
- {{yield}}
- {{else}}
- {{@message}}
- {{/if}}
-
- {{/if}}
-
\ No newline at end of file
+ {{#unless this.isRefreshing}}
+ {{@message}}
+ {{/unless}}
+
\ No newline at end of file
diff --git a/ui/lib/core/addon/components/alert-inline.js b/ui/lib/core/addon/components/alert-inline.js
index 6fac080fba47..8a25a6fc286b 100644
--- a/ui/lib/core/addon/components/alert-inline.js
+++ b/ui/lib/core/addon/components/alert-inline.js
@@ -7,62 +7,62 @@ import Component from '@glimmer/component';
import { action } from '@ember/object';
import { later } from '@ember/runloop';
import { tracked } from '@glimmer/tracking';
-import { messageTypes } from 'core/helpers/message-types';
+import { assert } from '@ember/debug';
/**
* @module AlertInline
- * `AlertInline` components are used to inform users of important messages.
+ * * Use Hds::Alert @type="compact" for displaying alert messages.
+ * This component renders a compact Hds::Alert that displays a loading icon if the
+ * @message arg changes and then re-renders the updated @message text.
+ * (Example: submitting a form and displaying the number of errors because on re-submit the number may change)
*
* @example
- * ```js
- *
+ * ```
+ *
* ```
*
- * @param {string} type=null - The alert type passed to the message-types helper.
- * @param {string} [message=null] - The message to display within the alert.
- * @param {boolean} [paddingTop=false] - Whether or not to add padding above component.
- * @param {boolean} [isMarginless=false] - Whether or not to remove margin bottom below component.
- * @param {boolean} [sizeSmall=false] - Whether or not to display a small font with padding below of alert message.
- * @param {boolean} [mimicRefresh=false] - If true will display a loading icon when attributes change (e.g. when a form submits and the alert message changes).
+ * @deprecated {string} type - color getter maps type to the Hds::Alert @color
+ * @param {string} color - Styles alert color and icon, can be one of: critical, warning, success, highlight, neutral
+ * @param {string} message - The message to display within the alert.
*/
export default class AlertInlineComponent extends Component {
@tracked isRefreshing = false;
- get mimicRefresh() {
- return this.args.mimicRefresh || false;
- }
-
- get paddingTop() {
- return this.args.paddingTop ? ' padding-top' : '';
- }
-
- get isMarginless() {
- return this.args.isMarginless ? ' is-marginless' : '';
- }
-
- get sizeSmall() {
- return this.args.sizeSmall ? ' size-small' : '';
- }
-
- get textClass() {
- if (this.args.type === 'danger') {
- return this.alertType.glyphClass;
+ constructor() {
+ super(...arguments);
+ assert('@type arg is deprecated, pass @color="critical" instead', this.args.type !== 'critical');
+ if (this.args.color) {
+ const possibleColors = ['critical', 'warning', 'success', 'highlight', 'neutral'];
+ assert(
+ `${this.args.color} is not a valid color. @color must be one of: ${possibleColors.join(', ')}`,
+ possibleColors.includes(this.args.color)
+ );
}
- return null;
}
- get alertType() {
- return messageTypes([this.args.type]);
+ get color() {
+ if (this.args.color) return this.args.color;
+ // @type arg is deprecated, this is for backward compatibility of old implementation
+ switch (this.args.type) {
+ case 'danger':
+ return 'critical';
+ case 'success':
+ return 'success';
+ case 'warning':
+ return 'warning';
+ case 'info':
+ return 'highlight';
+ default:
+ return 'neutral';
+ }
}
@action
refresh() {
- if (this.mimicRefresh) {
- this.isRefreshing = true;
- later(() => {
- this.isRefreshing = false;
- }, 200);
- }
+ this.isRefreshing = true;
+ later(() => {
+ this.isRefreshing = false;
+ }, 200);
}
}
diff --git a/ui/lib/core/addon/components/kv-object-editor.hbs b/ui/lib/core/addon/components/kv-object-editor.hbs
index 74cb0d63e9b7..eac26ede34cc 100644
--- a/ui/lib/core/addon/components/kv-object-editor.hbs
+++ b/ui/lib/core/addon/components/kv-object-editor.hbs
@@ -13,7 +13,7 @@
/>
{{#if @validationError}}
{{/if}}
{{#if this.kvData}}
diff --git a/ui/lib/core/addon/components/string-list.hbs b/ui/lib/core/addon/components/string-list.hbs
index 3c654eecd252..b838f29efdf9 100644
--- a/ui/lib/core/addon/components/string-list.hbs
+++ b/ui/lib/core/addon/components/string-list.hbs
@@ -53,15 +53,15 @@
{{/if}}
{{#if (includes index this.indicesWithComma)}}
-
+
{{/if}}
{{/each}}
{{#if this.indicesWithComma}}
-
+
+
+ Input contains a comma. Please separate values into individual rows.
+
+
{{/if}}
\ No newline at end of file
diff --git a/ui/lib/core/addon/components/text-file.hbs b/ui/lib/core/addon/components/text-file.hbs
index e3fd0ec46864..6572357e82da 100644
--- a/ui/lib/core/addon/components/text-file.hbs
+++ b/ui/lib/core/addon/components/text-file.hbs
@@ -57,7 +57,7 @@
{{/if}}
diff --git a/ui/lib/core/addon/templates/components/edit-form.hbs b/ui/lib/core/addon/templates/components/edit-form.hbs
index 02f0b12a0e73..2ca2fb583b89 100644
--- a/ui/lib/core/addon/templates/components/edit-form.hbs
+++ b/ui/lib/core/addon/templates/components/edit-form.hbs
@@ -30,7 +30,7 @@
>
<:error>
{{#if this.invalidFormAlert}}
-
+
{{/if}}
diff --git a/ui/lib/kubernetes/addon/components/page/configure.hbs b/ui/lib/kubernetes/addon/components/page/configure.hbs
index b623c2a2a975..45795fa15cb8 100644
--- a/ui/lib/kubernetes/addon/components/page/configure.hbs
+++ b/ui/lib/kubernetes/addon/components/page/configure.hbs
@@ -78,7 +78,8 @@
-
+
+
{{#if this.alert}}
-
+
{{/if}}
-
+
{{#if this.showConfirm}}
diff --git a/ui/lib/kubernetes/addon/components/page/role/create-and-edit.hbs b/ui/lib/kubernetes/addon/components/page/role/create-and-edit.hbs
index 5d0d0bb6b6bf..9fc5770458e1 100644
--- a/ui/lib/kubernetes/addon/components/page/role/create-and-edit.hbs
+++ b/ui/lib/kubernetes/addon/components/page/role/create-and-edit.hbs
@@ -130,7 +130,7 @@
{{/if}}
{{#if this.invalidFormAlert}}
{{/if}}
diff --git a/ui/lib/kv/addon/components/kv-data-fields.hbs b/ui/lib/kv/addon/components/kv-data-fields.hbs
index b384d3e4c2e3..395ea446ebc6 100644
--- a/ui/lib/kv/addon/components/kv-data-fields.hbs
+++ b/ui/lib/kv/addon/components/kv-data-fields.hbs
@@ -19,13 +19,15 @@
@valueUpdated={{this.handleJson}}
/>
{{#if (or @modelValidations.secretData.errors this.lintingErrors)}}
-
- {{#if @modelValidations.secretData.errors}}
- {{@modelValidations.secretData.errors}}
- {{else}}
- JSON is unparsable. Fix linting errors to avoid data discrepancies.
- {{/if}}
-
+
{{/if}}
{{else}}
{{/if}}
diff --git a/ui/lib/kv/addon/components/page/secret/metadata/edit.hbs b/ui/lib/kv/addon/components/page/secret/metadata/edit.hbs
index 9d1bd4188244..9d8bcb7b045a 100644
--- a/ui/lib/kv/addon/components/page/secret/metadata/edit.hbs
+++ b/ui/lib/kv/addon/components/page/secret/metadata/edit.hbs
@@ -38,9 +38,8 @@
{{/if}}
diff --git a/ui/lib/kv/addon/components/page/secrets/create.hbs b/ui/lib/kv/addon/components/page/secrets/create.hbs
index 326ecab52f9a..5b7ce940156c 100644
--- a/ui/lib/kv/addon/components/page/secrets/create.hbs
+++ b/ui/lib/kv/addon/components/page/secrets/create.hbs
@@ -61,7 +61,6 @@
class="has-top-padding-s"
@type="danger"
@message={{this.invalidFormAlert}}
- @mimicRefresh={{true}}
/>
{{/if}}
diff --git a/ui/lib/ldap/addon/components/page/configure.hbs b/ui/lib/ldap/addon/components/page/configure.hbs
index b0b1bec2fef9..393b8eb51e99 100644
--- a/ui/lib/ldap/addon/components/page/configure.hbs
+++ b/ui/lib/ldap/addon/components/page/configure.hbs
@@ -70,9 +70,8 @@
{{#if this.invalidFormMessage}}
{{/if}}
diff --git a/ui/lib/ldap/addon/components/page/library/create-and-edit.hbs b/ui/lib/ldap/addon/components/page/library/create-and-edit.hbs
index 8535400cf7ba..7f8b77c00bd0 100644
--- a/ui/lib/ldap/addon/components/page/library/create-and-edit.hbs
+++ b/ui/lib/ldap/addon/components/page/library/create-and-edit.hbs
@@ -43,9 +43,8 @@
{{#if this.invalidFormMessage}}
{{/if}}
diff --git a/ui/lib/ldap/addon/components/page/role/create-and-edit.hbs b/ui/lib/ldap/addon/components/page/role/create-and-edit.hbs
index 8c5b3e54bfb6..c90601480d18 100644
--- a/ui/lib/ldap/addon/components/page/role/create-and-edit.hbs
+++ b/ui/lib/ldap/addon/components/page/role/create-and-edit.hbs
@@ -67,9 +67,8 @@
{{#if this.invalidFormMessage}}
{{/if}}
diff --git a/ui/lib/pki/addon/components/page/pki-configuration-edit.hbs b/ui/lib/pki/addon/components/page/pki-configuration-edit.hbs
index 713f9c46ffbe..e1c890a0b313 100644
--- a/ui/lib/pki/addon/components/page/pki-configuration-edit.hbs
+++ b/ui/lib/pki/addon/components/page/pki-configuration-edit.hbs
@@ -146,9 +146,8 @@
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-edit.hbs b/ui/lib/pki/addon/components/page/pki-issuer-edit.hbs
index 80d682355be4..2c763dd69907 100644
--- a/ui/lib/pki/addon/components/page/pki-issuer-edit.hbs
+++ b/ui/lib/pki/addon/components/page/pki-issuer-edit.hbs
@@ -68,12 +68,7 @@
{{#if this.error}}
{{/if}}
\ No newline at end of file
diff --git a/ui/lib/pki/addon/components/page/pki-issuer-rotate-root.hbs b/ui/lib/pki/addon/components/page/pki-issuer-rotate-root.hbs
index e84330f80c32..137e0cafb14a 100644
--- a/ui/lib/pki/addon/components/page/pki-issuer-rotate-root.hbs
+++ b/ui/lib/pki/addon/components/page/pki-issuer-rotate-root.hbs
@@ -173,9 +173,8 @@
diff --git a/ui/lib/pki/addon/components/pki-generate-csr.hbs b/ui/lib/pki/addon/components/pki-generate-csr.hbs
index b363631dcda5..1b4a38f8bd90 100644
--- a/ui/lib/pki/addon/components/pki-generate-csr.hbs
+++ b/ui/lib/pki/addon/components/pki-generate-csr.hbs
@@ -67,7 +67,7 @@
{{#if this.alert}}
{{/if}}
diff --git a/ui/lib/pki/addon/components/pki-generate-root.hbs b/ui/lib/pki/addon/components/pki-generate-root.hbs
index f94cfb58e4ed..8980ef11462b 100644
--- a/ui/lib/pki/addon/components/pki-generate-root.hbs
+++ b/ui/lib/pki/addon/components/pki-generate-root.hbs
@@ -104,9 +104,8 @@
diff --git a/ui/lib/pki/addon/components/pki-key-form.hbs b/ui/lib/pki/addon/components/pki-key-form.hbs
index 9dcd62dc264b..881492a512bf 100644
--- a/ui/lib/pki/addon/components/pki-key-form.hbs
+++ b/ui/lib/pki/addon/components/pki-key-form.hbs
@@ -55,9 +55,8 @@
diff --git a/ui/lib/pki/addon/components/pki-key-import.hbs b/ui/lib/pki/addon/components/pki-key-import.hbs
index aa3859b946e8..882149985a7b 100644
--- a/ui/lib/pki/addon/components/pki-key-import.hbs
+++ b/ui/lib/pki/addon/components/pki-key-import.hbs
@@ -37,9 +37,8 @@
diff --git a/ui/lib/pki/addon/components/pki-role-form.hbs b/ui/lib/pki/addon/components/pki-role-form.hbs
index 2b8d2cbdff6b..150086a7ea6d 100644
--- a/ui/lib/pki/addon/components/pki-role-form.hbs
+++ b/ui/lib/pki/addon/components/pki-role-form.hbs
@@ -134,11 +134,11 @@
/>
{{#if this.modelValidations.targets.errors}}
-
+
{{/if}}
{{#if this.invalidFormAlert}}
{{/if}}
\ No newline at end of file
diff --git a/ui/lib/pki/addon/components/pki-role-generate.hbs b/ui/lib/pki/addon/components/pki-role-generate.hbs
index e1bebc7e31d8..a5db88ff6557 100644
--- a/ui/lib/pki/addon/components/pki-role-generate.hbs
+++ b/ui/lib/pki/addon/components/pki-role-generate.hbs
@@ -44,7 +44,7 @@
{{#if this.invalidFormAlert}}
{{/if}}
diff --git a/ui/lib/pki/addon/components/pki-sign-intermediate-form.hbs b/ui/lib/pki/addon/components/pki-sign-intermediate-form.hbs
index c49c9471993d..157ba3d16c61 100644
--- a/ui/lib/pki/addon/components/pki-sign-intermediate-form.hbs
+++ b/ui/lib/pki/addon/components/pki-sign-intermediate-form.hbs
@@ -73,13 +73,7 @@
{{#if this.inlineFormAlert}}
{{/if}}
diff --git a/ui/lib/pki/addon/components/pki-tidy-form.hbs b/ui/lib/pki/addon/components/pki-tidy-form.hbs
index e5daca47cfd6..e45483b68710 100644
--- a/ui/lib/pki/addon/components/pki-tidy-form.hbs
+++ b/ui/lib/pki/addon/components/pki-tidy-form.hbs
@@ -75,7 +75,7 @@
{{#if this.invalidFormAlert}}
{{/if}}
\ No newline at end of file
diff --git a/ui/tests/integration/components/alert-inline-test.js b/ui/tests/integration/components/alert-inline-test.js
index 87c0059d4bf6..a992257ede3f 100644
--- a/ui/tests/integration/components/alert-inline-test.js
+++ b/ui/tests/integration/components/alert-inline-test.js
@@ -8,71 +8,84 @@ import { setupRenderingTest } from 'ember-qunit';
import { render, settled, find, waitUntil } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
+const SHARED_STYLES = {
+ success: {
+ icon: 'check-circle-fill',
+ class: 'hds-alert--color-success',
+ },
+ warning: {
+ icon: 'alert-triangle-fill',
+ class: 'hds-alert--color-warning',
+ },
+};
module('Integration | Component | alert-inline', function (hooks) {
setupRenderingTest(hooks);
- hooks.beforeEach(function () {
- this.set('message', 'some very important alert');
- this.set('type', 'warning');
- });
+ test('it renders alert message for each @color arg', async function (assert) {
+ const COLORS = {
+ ...SHARED_STYLES,
+ neutral: {
+ icon: 'info-fill',
+ class: 'hds-alert--color-neutral',
+ },
+ highlight: {
+ icon: 'info-fill',
+ class: 'hds-alert--color-highlight',
+ },
+ critical: {
+ icon: 'alert-diamond-fill',
+ class: 'hds-alert--color-critical',
+ },
+ };
- test('it renders alert message with correct class args', async function (assert) {
- await render(hbs`
-
- `);
+ const { neutral } = COLORS; // default color
+ await render(hbs``);
assert.dom('[data-test-inline-error-message]').hasText('some very important alert');
- assert
- .dom('[data-test-inline-alert]')
- .hasAttribute('class', 'is-flex-center padding-top is-marginless size-small');
- });
+ assert.dom(`[data-test-icon="${neutral.icon}"]`).exists('renders default icon');
+ assert.dom('[data-test-inline-alert]').hasClass(neutral.class, 'renders default class');
- test('it yields to block text', async function (assert) {
- await render(hbs`
-
- A much more important alert
-
- `);
- assert.dom('[data-test-inline-error-message]').hasText('A much more important alert');
+ // assert deprecated @type arg values map to expected color
+ for (const type in COLORS) {
+ this.color = type;
+ const color = COLORS[type];
+ await render(hbs``);
+ assert.dom(`[data-test-icon="${color.icon}"]`).exists(`@color="${type}" renders icon: ${color.icon}`);
+ assert
+ .dom('[data-test-inline-alert]')
+ .hasClass(color.class, `@color="${type}" renders class: ${color.class}`);
+ }
});
- test('it renders correctly for type=danger', async function (assert) {
- this.set('type', 'danger');
- await render(hbs`
-
- `);
- assert
- .dom('[data-test-inline-error-message]')
- .hasAttribute('class', 'has-text-danger', 'has danger text');
- assert.dom('[data-test-icon="x-square-fill"]').exists('danger icon exists');
- });
-
- test('it renders correctly for type=warning', async function (assert) {
- await render(hbs`
-
- `);
- assert.dom('[data-test-inline-error-message]').doesNotHaveAttribute('class', 'does not have styled text');
- assert.dom('[data-test-icon="alert-triangle-fill"]').exists('warning icon exists');
+ test('it renders alert color for each deprecated @type arg', async function (assert) {
+ const OLD_TYPES = {
+ ...SHARED_STYLES,
+ info: {
+ icon: 'info-fill',
+ class: 'hds-alert--color-highlight',
+ },
+ danger: {
+ icon: 'alert-diamond-fill',
+ class: 'hds-alert--color-critical',
+ },
+ };
+ // assert deprecated @type arg values map to expected color
+ for (const type in OLD_TYPES) {
+ this.type = type;
+ const color = OLD_TYPES[type];
+ await render(hbs``);
+ assert
+ .dom(`[data-test-icon="${color.icon}"]`)
+ .exists(`deprecated @type="${type}" renders icon: ${color.icon}`);
+ assert
+ .dom('[data-test-inline-alert]')
+ .hasClass(color.class, `deprecated @type="${type}" renders class: ${color.class}`);
+ }
});
test('it mimics loading when message changes', async function (assert) {
+ this.message = 'some very important alert';
await render(hbs`
-
+
`);
assert
.dom('[data-test-inline-error-message]')
diff --git a/ui/tests/integration/components/kubernetes/page/configure-test.js b/ui/tests/integration/components/kubernetes/page/configure-test.js
index 7d1b922e837a..8c41a3431a78 100644
--- a/ui/tests/integration/components/kubernetes/page/configure-test.js
+++ b/ui/tests/integration/components/kubernetes/page/configure-test.js
@@ -222,9 +222,9 @@ module('Integration | Component | kubernetes | Page::Configure', function (hooks
await click('[data-test-config-save]');
assert
- .dom('[data-test-inline-error-message]')
+ .dom('[data-test-field-validation="kubernetesHost"] [data-test-inline-error-message]')
.hasText('Kubernetes host is required', 'Error renders for required field');
- assert.dom('[data-test-alert] p').hasText('There is an error with this form.', 'Alert renders');
+ assert.dom('[data-test-alert]').hasText('There is an error with this form.', 'Alert renders');
});
test('it should save inferred config', async function (assert) {
diff --git a/ui/tests/integration/components/ldap/page/configure-test.js b/ui/tests/integration/components/ldap/page/configure-test.js
index f81ad8b491bd..a479656adc4d 100644
--- a/ui/tests/integration/components/ldap/page/configure-test.js
+++ b/ui/tests/integration/components/ldap/page/configure-test.js
@@ -85,7 +85,7 @@ module('Integration | Component | ldap | Page::Configure', function (hooks) {
.dom('[data-test-field="bindpass"] [data-test-inline-error-message]')
.hasText('Administrator password is required.', 'Validation message renders for bindpass');
assert
- .dom('[data-test-invalid-form-message] p')
+ .dom('[data-test-invalid-form-message]')
.hasText('There are 2 errors with this form.', 'Invalid form message renders');
});
diff --git a/ui/tests/integration/components/ldap/page/library/create-and-edit-test.js b/ui/tests/integration/components/ldap/page/library/create-and-edit-test.js
index 67c8721ce25e..7003c8bcea03 100644
--- a/ui/tests/integration/components/ldap/page/library/create-and-edit-test.js
+++ b/ui/tests/integration/components/ldap/page/library/create-and-edit-test.js
@@ -87,13 +87,13 @@ module('Integration | Component | ldap | Page::Library::CreateAndEdit', function
await click('[data-test-save]');
assert
- .dom('[data-test-field-validation="name"] p')
+ .dom('[data-test-field-validation="name"]')
.hasText('Library name is required.', 'Name validation error renders');
assert
- .dom('[data-test-field-validation="service_account_names"] p')
+ .dom('[data-test-field-validation="service_account_names"]')
.hasText('At least one service account is required.', 'Service account name validation error renders');
assert
- .dom('[data-test-invalid-form-message] p')
+ .dom('[data-test-invalid-form-message]')
.hasText('There are 2 errors with this form.', 'Invalid form message renders');
});