Skip to content

Commit aa1a14e

Browse files
committed
feat(secrets): add new feature flag
1 parent 2779409 commit aa1a14e

File tree

5 files changed

+8
-78
lines changed

5 files changed

+8
-78
lines changed

pro/pkg/features/features.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ package features
22

33
import "github.com/semaphoreui/semaphore/db"
44

5-
type Features struct {
6-
ProjectRunners bool `json:"project_runners"`
7-
TerraformBackend bool `json:"terraform_backend"`
8-
TaskSummary bool `json:"task_summary"`
9-
SecretStorages bool `json:"secret_storages"`
10-
}
11-
125
func GetFeatures(user *db.User) map[string]bool {
136
return map[string]bool{
147
"project_runners": false,

web/src/components/EnvironmentForm.vue

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,6 @@
66
v-if="item != null && secretStorages != null"
77
class="pb-3"
88
>
9-
10-
<!-- <v-dialog-->
11-
<!-- v-model="envEditorDialog"-->
12-
<!-- max-width="800"-->
13-
<!-- persistent-->
14-
<!-- :transition="false"-->
15-
<!-- >-->
16-
<!-- <div style="position: relative;">-->
17-
<!-- <codemirror-->
18-
<!-- class="EnvironmentMaximizedEditor"-->
19-
<!-- :style="{ border: '1px solid lightgray' }"-->
20-
<!-- v-model="json"-->
21-
<!-- :options="cmOptions"-->
22-
<!-- :placeholder="$t('enterExtraVariablesJson')"-->
23-
<!-- />-->
24-
25-
<!-- <v-btn-->
26-
<!-- dark-->
27-
<!-- fab-->
28-
<!-- small-->
29-
<!-- color="blue-grey"-->
30-
<!-- v-if="extraVarsEditMode === 'json'"-->
31-
<!-- style="-->
32-
<!-- position: absolute;-->
33-
<!-- right: 0;-->
34-
<!-- top: 0;-->
35-
<!-- margin: 10px;-->
36-
<!-- "-->
37-
<!-- @click="envEditorDialog = false"-->
38-
<!-- >-->
39-
<!-- <v-icon>mdi-arrow-collapse</v-icon>-->
40-
<!-- </v-btn>-->
41-
<!-- </div>-->
42-
<!-- </v-dialog>-->
43-
449
<v-alert
4510
:value="formError"
4611
color="error"
@@ -58,7 +23,7 @@
5823
dense
5924
></v-text-field>
6025

61-
<v-row v-if="isNew">
26+
<v-row v-if="supportStorages && isNew">
6227
<v-col>
6328
<v-autocomplete
6429
v-model="item.secret_storage_id"
@@ -156,24 +121,6 @@
156121
margin: 10px;
157122
"
158123
/>
159-
160-
<!-- <v-btn-->
161-
<!-- dark-->
162-
<!-- fab-->
163-
<!-- small-->
164-
<!-- color="blue-grey"-->
165-
<!-- v-if="extraVarsEditMode === 'json'"-->
166-
<!-- style="-->
167-
<!-- position: absolute;-->
168-
<!-- right: 0;-->
169-
<!-- top: 0;-->
170-
<!-- margin: 10px;-->
171-
<!-- "-->
172-
<!-- @click="envEditorDialog = true"-->
173-
<!-- >-->
174-
<!-- <v-icon>mdi-arrow-expand</v-icon>-->
175-
<!-- </v-btn>-->
176-
177124
</div>
178125
<div v-else-if="extraVarsEditMode === 'table'">
179126
<v-data-table
@@ -435,13 +382,6 @@
435382
height: 160px !important;
436383
}
437384
}
438-
439-
//.EnvironmentMaximizedEditor {
440-
// .CodeMirror {
441-
// font-size: 14px;
442-
// height: 600px !important;
443-
// }
444-
//}
445385
</style>
446386
<script>
447387
/* eslint-disable import/no-extraneous-dependencies,import/extensions */
@@ -460,6 +400,7 @@ export default {
460400
461401
props: {
462402
needHelp: Boolean,
403+
supportStorages: Boolean,
463404
},
464405
465406
components: {
@@ -477,12 +418,6 @@ export default {
477418
},
478419
479420
watch: {
480-
// envEditorDialog(val) {
481-
// this.$emit('maximize', {
482-
// maximized: val,
483-
// });
484-
// },
485-
486421
extraVarsEditMode(val) {
487422
let extraVars;
488423
@@ -546,7 +481,6 @@ export default {
546481
},
547482
548483
extraVarsEditMode: 'json',
549-
// envEditorDialog: false,
550484
551485
secretStorages: null,
552486
};

web/src/components/KeyForm.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/>
2424

2525
<v-autocomplete
26+
v-if="supportStorages"
2627
v-model="item.source_storage_id"
2728
:label="$t('Storage (optional)')"
2829
:items="secretStorages"
@@ -35,7 +36,7 @@
3536
/>
3637

3738
<v-text-field
38-
v-if="item.source_storage_id != null"
39+
v-if="supportStorages && item.source_storage_id != null"
3940
v-model="item.source_storage_key"
4041
:label="$t('Source Key')"
4142
:disabled="formSaving || !canEditSecrets"

web/src/views/project/Environment.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
:need-save="needSave"
2020
:need-reset="needReset"
2121
:need-help="needHelp"
22+
:support-storages="systemInfo.premium_features?.secret_storages"
2223
@maximize="editNoEscape = $event.maximized"
2324
/>
2425
</template>
@@ -87,6 +88,7 @@ export default {
8788
data() {
8889
return {
8990
editNoEscape: false,
91+
systemInfo: Object,
9092
};
9193
},
9294
methods: {

web/src/views/project/SecretStorages.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
<v-menu
4444
offset-y
45-
v-if="premiumFeatures.secret_storages"
45+
v-if="premiumFeatures.secret_storage_management"
4646
>
4747
<template v-slot:activator="{ on, attrs }">
4848

@@ -95,7 +95,7 @@
9595
<v-divider style="margin-top: -1px;"/>
9696

9797
<v-alert
98-
v-if="!premiumFeatures.secret_storages"
98+
v-if="!premiumFeatures.secret_storage_management"
9999
type="info"
100100
text
101101
color="hsl(348deg, 86%, 61%)"

0 commit comments

Comments
 (0)