Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: HDS adoption replace <CopyButton> part 5: Cleanup #22884

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/app/components/sidebar/user-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
@text="Copy token"
@textToCopy={{this.auth.currentToken}}
@isFullWidth={{true}}
class="hds-copy-button size-7 hidden-icon link is-flex-start"
class="hds-copy-button in-dropdown link is-flex-start"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined 2 classes into one, this is applied to copy buttons which are in dropdowns

{{on "click" (action (set-flash-message "Token copied!"))}}
/>
</li>
Expand Down
10 changes: 0 additions & 10 deletions ui/app/styles/components/code-snippet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,3 @@
white-space: pre;
}
}

.code-snippet-copy-button {
cursor: pointer;
color: $ui-gray-300;
background: none;
border: none;
box-shadow: none;
min-width: auto;
padding: $size-11 $size-8;
}
3 changes: 0 additions & 3 deletions ui/app/styles/components/masked-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@
}

.button.masked-input-toggle,
.button.copy-button,
.button.download-button {
min-width: $spacing-xl;
border-left: 0;
color: $grey;
box-shadow: 0 3px 1px 0px rgba(10, 10, 10, 0.12);
}

.button.copy-button,
.button.download-button {
border-radius: 0;
}
Expand All @@ -68,7 +66,6 @@

.display-only {
.button.masked-input-toggle,
.button.copy-button,
.button.download-button {
background: transparent;
height: auto;
Expand Down
3 changes: 1 addition & 2 deletions ui/app/styles/components/text-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
line-height: inherit;
}
}
.button.masked-input-toggle,
.button.copy-button {
.button.masked-input-toggle {
display: flex;
}
}
43 changes: 22 additions & 21 deletions ui/app/styles/core/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -347,27 +347,6 @@ a.button.disabled {
color: $white;
}

&.hidden-icon svg {
color: transparent;
}

&.size-7 div {
font-size: $size-7;
}

&.code-snippet {
background: none;
border: none;
box-shadow: none;
min-width: auto;
padding: $size-11 $size-8;
color: $ui-gray-300;

svg {
color: $ui-gray-300;
}
}

&.is-primary {
background-color: $blue;
box-shadow: $box-shadow-low;
Expand Down Expand Up @@ -400,4 +379,26 @@ a.button.disabled {
border-radius: 0;
box-shadow: 0 3px 1px 0px rgba(10, 10, 10, 0.12);
}

&.code-snippet {
background: none;
border: none;
box-shadow: none;
min-width: auto;
padding: $size-11 $size-8;
color: $ui-gray-300;

svg {
color: $ui-gray-300;
}
}

&.in-dropdown {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job combining the classes!

div {
font-size: $size-7;
}
svg {
color: transparent;
}
}
}
2 changes: 1 addition & 1 deletion ui/app/templates/components/transit-form-show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
@text="Copy Public Key"
@textToCopy={{meta.public_key}}
@isFullWidth={{true}}
class="hds-copy-button size-7 hidden-icon link is-flex-start"
class="hds-copy-button in-dropdown link is-flex-start"
{{on "click" (action (set-flash-message "Public key copied!"))}}
/>
</li>
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/core/addon/components/copy-secret-dropdown.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@text="Copy JSON"
@textToCopy={{@clipboardText}}
@isFullWidth={{true}}
class="hds-copy-button size-7 hidden-icon link is-flex-start"
class="hds-copy-button in-dropdown link is-flex-start"
{{on "click" (action (set-flash-message "JSON Copied!"))}}
data-test-copy-button
/>
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/kmip/addon/templates/credentials/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<Hds::Copy::Button
@text="Copy certificate"
@textToCopy={{this.model.certificate}}
class="toolbar-link is-flex-center hds-copy-button"
class="toolbar-link is-flex-center"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toolbar-link class already covers necessary styling, so removed extra class here

data-test-copy-button
/>
</ToolbarActions>
Expand Down
1 change: 0 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"ember-cli": "~4.12.1",
"ember-cli-autoprefixer": "^0.8.1",
"ember-cli-babel": "^7.26.11",
"ember-cli-clipboard": "0.16.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ember-cli-clipboard 0.16.0 because we no longer have structure copy button which relied on this. HDS copy button is dependent on ember-cli-clipboard 1.0.0, which was added when I upgraded HDS to 2.9.0 in first subtask of copy button replacement

"ember-cli-content-security-policy": "2.0.3",
"ember-cli-dependency-checker": "^3.3.1",
"ember-cli-deprecation-workflow": "^2.1.0",
Expand Down
73 changes: 11 additions & 62 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4392,29 +4392,29 @@ __metadata:
languageName: node
linkType: hard

"@ember/render-modifiers@npm:^1.0.2 || ^2.0.0, @ember/render-modifiers@npm:^2.0.2, @ember/render-modifiers@npm:^2.0.4":
version: 2.0.4
resolution: "@ember/render-modifiers@npm:2.0.4"
"@ember/render-modifiers@npm:^2.0.0, @ember/render-modifiers@npm:^2.0.5":
version: 2.0.5
resolution: "@ember/render-modifiers@npm:2.0.5"
dependencies:
"@embroider/macros": ^1.0.0
ember-cli-babel: ^7.26.11
ember-modifier-manager-polyfill: ^1.2.0
peerDependencies:
ember-source: ^3.8 || 4
checksum: 6186a013349273f9eb0339a5b2ab7ccc7b9e6429d83b8cabba2842dfc35bd4b77b66979c2f2c25b062a7cdd359c6a500df27154880ac5f04a3ffa52ca6e343d6
ember-source: ^3.8 || ^4.0.0
checksum: ebeb4d573968f46490f8f5618b9d85f2c7ca39cee5b854bb497a3aee7dee3d710ab02b9677df30f1e2a484e712dd89171045118da563d9d9a6c316ccdccc2671
languageName: node
linkType: hard

"@ember/render-modifiers@npm:^2.0.0, @ember/render-modifiers@npm:^2.0.5":
version: 2.0.5
resolution: "@ember/render-modifiers@npm:2.0.5"
"@ember/render-modifiers@npm:^2.0.2, @ember/render-modifiers@npm:^2.0.4":
version: 2.0.4
resolution: "@ember/render-modifiers@npm:2.0.4"
dependencies:
"@embroider/macros": ^1.0.0
ember-cli-babel: ^7.26.11
ember-modifier-manager-polyfill: ^1.2.0
peerDependencies:
ember-source: ^3.8 || ^4.0.0
checksum: ebeb4d573968f46490f8f5618b9d85f2c7ca39cee5b854bb497a3aee7dee3d710ab02b9677df30f1e2a484e712dd89171045118da563d9d9a6c316ccdccc2671
ember-source: ^3.8 || 4
checksum: 6186a013349273f9eb0339a5b2ab7ccc7b9e6429d83b8cabba2842dfc35bd4b77b66979c2f2c25b062a7cdd359c6a500df27154880ac5f04a3ffa52ca6e343d6
languageName: node
linkType: hard

Expand Down Expand Up @@ -10470,7 +10470,7 @@ __metadata:
languageName: node
linkType: hard

"clipboard@npm:^2.0.11, clipboard@npm:^2.0.6":
"clipboard@npm:^2.0.11":
version: 2.0.11
resolution: "clipboard@npm:2.0.11"
dependencies:
Expand Down Expand Up @@ -12425,43 +12425,6 @@ __metadata:
languageName: node
linkType: hard

"ember-auto-import@npm:^1.11.3":
version: 1.12.0
resolution: "ember-auto-import@npm:1.12.0"
dependencies:
"@babel/core": ^7.1.6
"@babel/preset-env": ^7.10.2
"@babel/traverse": ^7.1.6
"@babel/types": ^7.1.6
"@embroider/core": ^0.33.0
babel-core: ^6.26.3
babel-loader: ^8.0.6
babel-plugin-syntax-dynamic-import: ^6.18.0
babylon: ^6.18.0
broccoli-debug: ^0.6.4
broccoli-node-api: ^1.7.0
broccoli-plugin: ^4.0.0
broccoli-source: ^3.0.0
debug: ^3.1.0
ember-cli-babel: ^7.0.0
enhanced-resolve: ^4.0.0
fs-extra: ^6.0.1
fs-tree-diff: ^2.0.0
handlebars: ^4.3.1
js-string-escape: ^1.0.1
lodash: ^4.17.19
mkdirp: ^0.5.1
resolve-package-path: ^3.1.0
rimraf: ^2.6.2
semver: ^7.3.4
symlink-or-copy: ^1.2.0
typescript-memoize: ^1.0.0-alpha.3
walk-sync: ^0.3.3
webpack: ^4.43.0
checksum: 689de6088854855c7eb50d882a81fc9ee3efd1671ddd8aea35a7d6ef0db8e08d211d156b63390da4fd98518d32ad2a3f9ed9be6f25810311a9011604f10b3c85
languageName: node
linkType: hard

"ember-auto-import@npm:^1.12.0":
version: 1.12.1
resolution: "ember-auto-import@npm:1.12.1"
Expand Down Expand Up @@ -12712,19 +12675,6 @@ __metadata:
languageName: node
linkType: hard

"ember-cli-clipboard@npm:0.16.0":
version: 0.16.0
resolution: "ember-cli-clipboard@npm:0.16.0"
dependencies:
"@ember/render-modifiers": ^1.0.2 || ^2.0.0
clipboard: ^2.0.6
ember-auto-import: ^1.11.3
ember-cli-babel: ^7.26.6
ember-cli-htmlbars: ^5.7.1
checksum: dea292fb8116d657cc2ac00695c7cdfc6fd71db3ff444b8418a3bdb641165d632e4281e06eb6fabfb82a58eb3a3ed5ea3e861539961501bb141725df7dc75604
languageName: node
linkType: hard

"ember-cli-clipboard@npm:^1.0.0":
version: 1.0.0
resolution: "ember-cli-clipboard@npm:1.0.0"
Expand Down Expand Up @@ -26029,7 +25979,6 @@ __metadata:
ember-cli: ~4.12.1
ember-cli-autoprefixer: ^0.8.1
ember-cli-babel: ^7.26.11
ember-cli-clipboard: 0.16.0
ember-cli-content-security-policy: 2.0.3
ember-cli-dependency-checker: ^3.3.1
ember-cli-deprecation-workflow: ^2.1.0
Expand Down