Skip to content

Commit 5c8e54e

Browse files
committed
fix(ui): passing feature flags from backend
1 parent 614ae5e commit 5c8e54e

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

web/src/components/EnvironmentForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ref="form"
44
lazy-validation
55
v-model="formValid"
6-
v-if="item != null && secretStorages != null"
6+
v-if="item != null && (!supportStorages || secretStorages != null)"
77
class="pb-3"
88
>
99
<v-alert

web/src/components/PageMixin.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default {
2+
props: {
3+
systemInfo: Object,
4+
},
5+
6+
computed: {
7+
8+
premiumFeatures() {
9+
return this.systemInfo?.premium_features || {};
10+
},
11+
12+
},
13+
};

web/src/views/Runners.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,10 @@ import axios from 'axios';
363363
import DashboardMenu from '@/components/DashboardMenu.vue';
364364
import delay from '@/lib/delay';
365365
import CopyClipboardButton from '@/components/CopyClipboardButton.vue';
366+
import PageMixin from '@/components/PageMixin';
366367
367368
export default {
368-
mixins: [ItemListPageBase],
369+
mixins: [ItemListPageBase, PageMixin],
369370
370371
components: {
371372
CopyClipboardButton,
@@ -376,7 +377,6 @@ export default {
376377
},
377378
378379
props: {
379-
systemInfo: Object,
380380
projectId: Number,
381381
},
382382
@@ -385,10 +385,6 @@ export default {
385385
return this.systemInfo?.web_host || window.location.origin;
386386
},
387387
388-
premiumFeatures() {
389-
return this.systemInfo?.premium_features || {};
390-
},
391-
392388
version() {
393389
return (this.systemInfo?.version || '').split('-')[0];
394390
},

web/src/views/project/Environment.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
:need-save="needSave"
2020
:need-reset="needReset"
2121
:need-help="needHelp"
22-
:support-storages="systemInfo.premium_features?.secret_storages"
22+
:support-storages="premiumFeatures.secret_storages"
2323
@maximize="editNoEscape = $event.maximized"
2424
/>
2525
</template>
@@ -81,14 +81,14 @@
8181
<script>
8282
import ItemListPageBase from '@/components/ItemListPageBase';
8383
import EnvironmentForm from '@/components/EnvironmentForm.vue';
84+
import PageMixin from '@/components/PageMixin';
8485
8586
export default {
8687
components: { EnvironmentForm },
87-
mixins: [ItemListPageBase],
88+
mixins: [ItemListPageBase, PageMixin],
8889
data() {
8990
return {
9091
editNoEscape: false,
91-
systemInfo: Object,
9292
};
9393
},
9494
methods: {

web/src/views/project/Keys.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,17 @@
104104
<script>
105105
import ItemListPageBase from '@/components/ItemListPageBase';
106106
import KeyForm from '@/components/KeyForm.vue';
107+
import PageMixin from '@/components/PageMixin';
107108
108109
export default {
109110
components: { KeyForm },
110111
111-
mixins: [ItemListPageBase],
112+
mixins: [ItemListPageBase, PageMixin],
112113
113114
props: {
114115
systemInfo: Object,
115116
},
116117
117-
computed: {
118-
premiumFeatures() {
119-
return this.systemInfo?.premium_features || {};
120-
},
121-
},
122-
123118
methods: {
124119
getHeaders() {
125120
return [{

0 commit comments

Comments
 (0)