show button toggle value as primary text color when single project is selected
This commit is contained in:
parent
b53e544c8e
commit
41f2c1d564
2 changed files with 8 additions and 1 deletions
|
@ -56,6 +56,9 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['selectedProject']),
|
...mapState(['selectedProject']),
|
||||||
...mapGetters(['hasProject']),
|
...mapGetters(['hasProject']),
|
||||||
|
hasOneProject() {
|
||||||
|
return this.items.length === 1;
|
||||||
|
},
|
||||||
isDisabled() {
|
isDisabled() {
|
||||||
return this.items.length < 2;
|
return this.items.length < 2;
|
||||||
},
|
},
|
||||||
|
@ -158,7 +161,7 @@ export default {
|
||||||
:value="selectedProject.projectId"
|
:value="selectedProject.projectId"
|
||||||
/>
|
/>
|
||||||
<dropdown-button
|
<dropdown-button
|
||||||
:class="{ 'gl-field-error-outline': hasErrors }"
|
:class="{ 'gl-field-error-outline': hasErrors, 'read-only': hasOneProject }"
|
||||||
:is-disabled="isDisabled"
|
:is-disabled="isDisabled"
|
||||||
:is-loading="isLoading"
|
:is-loading="isLoading"
|
||||||
:toggle-text="toggleText"
|
:toggle-text="toggleText"
|
||||||
|
|
|
@ -63,6 +63,10 @@
|
||||||
border-radius: $border-radius-base;
|
border-radius: $border-radius-base;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
|
&:disabled.read-only {
|
||||||
|
color: $gl-text-color !important;
|
||||||
|
}
|
||||||
|
|
||||||
&.no-outline {
|
&.no-outline {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue