Skip to content

Commit 69c78de

Browse files
jleveuglejleveugle
authored andcommitted
fix(sidebar): add oui-clipboard to copy id of project
1 parent 1bb5a17 commit 69c78de

File tree

2 files changed

+36
-23
lines changed

2 files changed

+36
-23
lines changed

packages/manager/apps/public-cloud/src/assets/theme/_sidebar.less

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@ cloud-sidebar { /* stylelint-disable-line */
99
position: relative;
1010
box-shadow: 0 2pt 10pt rgba(40, 89, 192, 0.25);
1111

12+
oui-clipboard { /* stylelint-disable-line */
13+
margin-bottom: 0;
14+
15+
.oui-clipboard__control {
16+
border-bottom: 0;
17+
padding: 0;
18+
padding-left: 1.5rem;
19+
font-weight: 400;
20+
color: @primary-color;
21+
background-color: transparent;
22+
23+
&:hover,
24+
&:focus {
25+
text-decoration: underline;
26+
background-color: transparent;
27+
}
28+
}
29+
30+
.oui-clipboard__button {
31+
left: 0;
32+
right: inherit;
33+
padding: 0;
34+
min-width: auto;
35+
color: @primary-color;
36+
}
37+
}
38+
1239
.project-list {
1340
position: absolute;
1441
width: 100%;
@@ -22,6 +49,13 @@ cloud-sidebar { /* stylelint-disable-line */
2249
will-change: transform;
2350
transition: transform ease-in-out 500ms;
2451

52+
oui-clipboard { /* stylelint-disable-line */
53+
.oui-clipboard__control,
54+
.oui-clipboard__button {
55+
color: #fff;
56+
}
57+
}
58+
2559
&.ng-enter,
2660
&.ng-leave.ng-leave-active {
2761
transform: translateX(-100%);
@@ -141,21 +175,6 @@ cloud-sidebar { /* stylelint-disable-line */
141175
}
142176
}
143177
}
144-
145-
.project-copy {
146-
border: 0;
147-
background-color: transparent;
148-
padding: 0;
149-
150-
&,
151-
.oui-icon {
152-
color: @primary-color;
153-
}
154-
155-
.oui-icon {
156-
font-size: 1rem;
157-
}
158-
}
159178
}
160179

161180
#sidebar-menu .oui-sidebar-menu {

packages/manager/apps/public-cloud/src/sidebar/sidebar.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
<div class="d-flex" data-ng-if="!$ctrl.isLoading && $ctrl.project">
88
<div class="w-100 text-truncate mr-3">
99
<h2 class="mb-0 d-inline-block" style="font-weight: 400;" data-ng-bind="$ctrl.project.description"></h2>
10-
<button class="project-copy w-100 d-flex">
11-
<span class="my-auto oui-icon oui-icon-copy-normal mr-1"></span>
12-
<span class="w-100 text-truncate" data-ng-bind="$ctrl.project.project_id"></span>
13-
</button>
10+
<oui-clipboard model="$ctrl.project.project_id"></oui-clipboard>
1411
</div>
1512
<div class="my-auto">
1613
<button type="button" class="btn btn-primary rounded-circle" style="padding: 6px 13px; background-color: rgb(40, 89, 192);" data-ng-click="$ctrl.toggleProjectsList()">
@@ -45,10 +42,7 @@ <h2 class="mb-0 d-inline-block" style="font-weight: 400;" data-ng-bind="$ctrl.pr
4542
</div>
4643
<div class="w-100 text-truncate ml-3">
4744
<h2 class="mb-0 d-inline-block text-white" style="font-weight: 400;" data-ng-bind="$ctrl.project.description"></h2>
48-
<button class="project-copy w-100 d-flex text-white">
49-
<span class="my-auto oui-icon oui-icon-copy-normal mr-1 text-white"></span>
50-
<span class="w-100 text-truncate" data-ng-bind="$ctrl.project.project_id"></span>
51-
</button>
45+
<oui-clipboard model="$ctrl.project.project_id"></oui-clipboard>
5246
</div>
5347
</div>
5448
<cloud-sidebar-project-list></cloud-sidebar-project-list>

0 commit comments

Comments
 (0)