File tree Expand file tree Collapse file tree 4 files changed +12
-19
lines changed
packages/hoppscotch-common/src/components/environments Expand file tree Collapse file tree 4 files changed +12
-19
lines changed Original file line number Diff line number Diff line change 3535 :placeholder =" `${t('action.search')}`"
3636 :context-menu-enabled =" false"
3737 class =" border border-dividerDark focus:border-primaryDark rounded"
38- :readonly =" isFilterInputDisabled"
3938 />
4039 <HoppSmartItem
4140 v-if =" !isScopeSelector"
@@ -701,14 +700,6 @@ const editGlobalEnv = () => {
701700 invokeAction (" modals.global.environment.update" , {})
702701}
703702
704- // Filter input disabled if no environments are available
705- const isFilterInputDisabled = computed (() => {
706- if (selectedEnvTab .value === " my-environments" ) {
707- return myEnvironments .value .length === 0
708- }
709- return teamEnvironmentList .value .length === 0
710- })
711-
712703const editEnv = () => {
713704 if (selectedEnv .value .type === " MY_ENV" && selectedEnv .value .name ) {
714705 invokeAction (" modals.my.environment.edit" , {
Original file line number Diff line number Diff line change 66 autocomplete =" off"
77 class =" flex w-full bg-transparent px-4 py-2 h-8 border-b border-dividerLight"
88 :placeholder =" t('action.search')"
9- :disabled =" !environments.length"
109 />
1110 <div
1211 class =" sticky top-upperPrimaryStickyFold z-10 flex flex-1 flex-shrink-0 justify-between overflow-x-auto border-b border-dividerLight bg-primary"
Original file line number Diff line number Diff line change 8888 :placeholder =" `${t('count.variable', {
8989 count: index + 1,
9090 })}`"
91- :name =" 'param' + index"
91+ :class =" {
92+ 'opacity-25': isViewer,
93+ }"
94+ :name =" 'variable' + index"
9295 :disabled =" isViewer"
9396 />
9497 <SmartEnvInput
100103 :select-text-on-mount ="
101104 env.key ? env.key === editingVariableName : false
102105 "
106+ :readonly =" isViewer"
103107 />
104108 <SmartEnvInput
105109 v-model =" env.currentValue"
@@ -495,8 +499,13 @@ const saveEnvironment = async () => {
495499 secretVariables
496500 )
497501
502+ currentEnvironmentValueService .addEnvironment (
503+ editingID .value ,
504+ nonSecretVariables
505+ )
506+
498507 // If the user is a viewer, we don't need to update the environment in BE
499- // just update the secret environment in the local storage
508+ // just update the secret environment and current environment in the local storage
500509 if (props .isViewer ) {
501510 hideModal ()
502511 toast .success (` ${t (" environment.updated" )} ` )
@@ -521,12 +530,6 @@ const saveEnvironment = async () => {
521530 toast .success (` ${t (" environment.updated" )} ` )
522531
523532 isLoading .value = false
524- if (editingID .value ) {
525- currentEnvironmentValueService .addEnvironment (
526- editingID .value ,
527- nonSecretVariables
528- )
529- }
530533 }
531534 )
532535 )()
Original file line number Diff line number Diff line change 66 autocomplete =" off"
77 class =" flex w-full bg-transparent px-4 py-2 h-8 border-b border-dividerLight"
88 :placeholder =" t('action.search')"
9- :disabled =" loading || !teamEnvironments.length "
9+ :disabled =" loading"
1010 />
1111 <div
1212 class =" sticky top-upperPrimaryStickyFold z-10 flex flex-1 flex-shrink-0 justify-between overflow-x-auto border-b border-dividerLight bg-primary"
You can’t perform that action at this time.
0 commit comments