From 185af6f00e8221394af741530f8dcc943ea675c0 Mon Sep 17 00:00:00 2001 From: Priya Patel Date: Tue, 29 Apr 2025 16:28:59 -0700 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20remove=20card=20comp?= =?UTF-8?q?onent=20from=20desktop=20(#2798)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/app/components/card/index.hbs | 37 ------------- ui/desktop/app/styles/app.scss | 37 ------------- .../tests/integration/components/card-test.js | 53 ------------------- 3 files changed, 127 deletions(-) delete mode 100644 ui/desktop/app/components/card/index.hbs delete mode 100644 ui/desktop/tests/integration/components/card-test.js diff --git a/ui/desktop/app/components/card/index.hbs b/ui/desktop/app/components/card/index.hbs deleted file mode 100644 index 48ff67736..000000000 --- a/ui/desktop/app/components/card/index.hbs +++ /dev/null @@ -1,37 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: BUSL-1.1 -}} - -
- {{#if (if (has-block 'header') true @heading)}} -
- {{#if @heading}} - - {{#if @icon}} - - {{/if}} - {{@heading}} - - {{/if}} - - {{yield to='header'}} - -
- {{/if}} - -
- {{yield to='body'}} -
- - {{#if (has-block 'footer')}} -
- {{yield to='footer'}} -
- {{/if}} -
\ No newline at end of file diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index 7471bda60..41d0c69d5 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -274,43 +274,6 @@ z-index: 5500; } -// Card component (app/components/card) -.card { - border: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); - display: flex; - flex-direction: column; - margin-bottom: sizing.rems(m); - - .card-header { - align-items: center; - border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); - display: flex; - justify-content: space-between; - padding: sizing.rems(s) sizing.rems(s) sizing.rems(s) sizing.rems(m); - - h2 { - @include type.type(s, normal); - - color: var(--ui-gray-starker-1); - margin: 0; - padding: sizing.rems(xxs) + sizing.rems(xxxs) 0; - } - - .hds-icon { - margin-right: sizing.rems(xxxs); - } - } - - .card-body { - padding: sizing.rems(s); - } - - .card-footer { - border-top: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3); - padding: sizing.rems(s); - } -} - // Hidden secret component (app/components/hidden-secret) .hidden-secret { display: flex; diff --git a/ui/desktop/tests/integration/components/card-test.js b/ui/desktop/tests/integration/components/card-test.js deleted file mode 100644 index 93c5a6d56..000000000 --- a/ui/desktop/tests/integration/components/card-test.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render, find } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; - -module('Integration | Component | card', function (hooks) { - setupRenderingTest(hooks); - - test('it renders', async function (assert) { - await render(hbs``); - assert.ok(find('.card')); - }); - - test('it renders with content', async function (assert) { - await render(hbs` - - <:header> - <:body> - <:footer> - - `); - - assert.ok(find('.card')); - assert.ok(find('.card-header')); - assert.ok(find('.card-body')); - assert.ok(find('.card-footer')); - }); - - test('header renders an icon when defined', async function (assert) { - await render(hbs` - - <:header> - <:body> - <:footer> - - `); - - assert.dom('.card').exists(); - assert.dom('.card-header').exists(); - assert.dom('.card-header .hds-icon').isVisible(); - assert.strictEqual( - this.element.textContent.trim(), - 'This is a heading test', - ); - }); -});