refactor: 💡 Remove rose:linkbutton (#2590)
Remove rose:linkbutton references and tests
This commit is contained in:
1 parent
e02c50aef8
commit
42dd029611
5 files changed
-112
No files matched your search
@@ -1,32 +0,0 @@
|
||||
{{!
|
||||
Copyright (c) HashiCorp, Inc.
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<LinkTo
|
||||
class='rose-link-button
|
||||
{{if @style (concat "rose-button-" @style)}}
|
||||
{{if @iconOnly "has-icon-only"}}
|
||||
{{if @iconLeft "has-icon-left"}}
|
||||
{{if @iconRight "has-icon-right"}}'
|
||||
@route={{@route}}
|
||||
...attributes
|
||||
>
|
||||
<span class='rose-button-wrapper'>
|
||||
{{#if @iconLeft}}
|
||||
<Rose::Icon @name={{@iconLeft}} @size='medium' />
|
||||
{{/if}}
|
||||
|
||||
<span class='rose-button-body'>
|
||||
{{yield}}
|
||||
</span>
|
||||
|
||||
{{#if @iconOnly}}
|
||||
<Rose::Icon @name={{@iconOnly}} @size='medium' />
|
||||
{{/if}}
|
||||
|
||||
{{#if @iconRight}}
|
||||
<Rose::Icon @name={{@iconRight}} @size='medium' />
|
||||
{{/if}}
|
||||
</span>
|
||||
</LinkTo>
|
||||
@@ -1,6 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
export { default } from 'rose/components/rose/link-button';
|
||||
@@ -19,7 +19,6 @@
|
||||
@import 'nav';
|
||||
@import 'table';
|
||||
@import 'message';
|
||||
@import 'link-button';
|
||||
@import 'toolbar';
|
||||
@import 'code-editor';
|
||||
@import 'metadata-list';
|
||||
@@ -1,9 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) HashiCorp, Inc.
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
// Link button uses rose-button styling
|
||||
.rose-link-button {
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -1,64 +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 | rose/link-button', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Rose::LinkButton @route="index" />`);
|
||||
assert.ok(find('a'));
|
||||
assert.notOk(find('.rose-button'));
|
||||
assert.ok(find('.rose-link-button'));
|
||||
});
|
||||
|
||||
test('it renders with attributes', async function (assert) {
|
||||
await render(hbs`<Rose::LinkButton @route="index" id="link-button"/>`);
|
||||
assert.ok(find('#link-button'));
|
||||
});
|
||||
|
||||
test('it renders with content', async function (assert) {
|
||||
await render(
|
||||
hbs`<Rose::LinkButton @route="index">Link button content</Rose::LinkButton>`,
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-link-button').textContent.trim(),
|
||||
'Link button content',
|
||||
);
|
||||
});
|
||||
|
||||
test('it renders with rose button styles', async function (assert) {
|
||||
await render(hbs`<Rose::LinkButton @route="index" @style="sample"/>`);
|
||||
assert.ok(find(`.rose-button-sample`));
|
||||
});
|
||||
|
||||
test('it supports left icon with @iconLeft', async function (assert) {
|
||||
await render(
|
||||
hbs`<Rose::LinkButton @route="index" @iconLeft="flight-icons/svg/chevron-left-16" />`,
|
||||
);
|
||||
assert.ok(find('.rose-icon'));
|
||||
assert.ok(find('.has-icon-left'));
|
||||
});
|
||||
|
||||
test('it supports left icon with @iconRight', async function (assert) {
|
||||
await render(
|
||||
hbs`<Rose::LinkButton @route="index" @iconRight="flight-icons/svg/entry-point-16" />`,
|
||||
);
|
||||
assert.ok(find('.rose-icon'));
|
||||
assert.ok(find('.has-icon-right'));
|
||||
});
|
||||
|
||||
test('it supports only icon with @iconOnly', async function (assert) {
|
||||
await render(
|
||||
hbs`<Rose::LinkButton @route="index" @iconOnly="flight-icons/svg/help-16" />`,
|
||||
);
|
||||
assert.ok(find('.rose-icon'));
|
||||
assert.ok(find('.has-icon-only'));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user