chore: remove managed mode from edit cookie for now

This commit is contained in:
Andrew Bastin
2023-10-25 11:45:53 +05:30
parent 3e2d029ee3
commit d068da1341

View File

@@ -7,57 +7,10 @@
@close="hideModal"
>
<template #body>
<HoppSmartTabs v-model="currentActiveTab">
<HoppSmartTab :id="'managed'" :label="t('cookies.modal.managed_tab')">
<div class="flex flex-col gap-y-4">
<div class="flex items-center">
<label class="w-20">{{ t("cookies.modal.cookie_name") }}</label>
<HoppSmartInput
v-model="cookieName"
:placeholder="t('cookies.modal.cookie_name')"
class="flex-1"
/>
</div>
<div class="flex items-center">
<label class="w-20">{{ t("cookies.modal.cookie_value") }}</label>
<HoppSmartInput
v-model="cookieValue"
:placeholder="t('cookies.modal.cookie_value')"
class="flex-1"
/>
</div>
<div class="flex items-center">
<label class="w-20">{{ t("cookies.modal.cookie_path") }}</label>
<HoppSmartInput
v-model="cookiePath"
:placeholder="t('cookies.modal.cookie_path')"
class="flex-1"
/>
</div>
<div class="flex items-center">
<label class="w-20">{{
t("cookies.modal.cookie_expires")
}}</label>
<HoppSmartInput
v-model="cookieExpires"
:placeholder="t('cookies.modal.cookie_expires')"
:type="'datetime-local'"
class="flex-1"
/>
</div>
</div>
</HoppSmartTab>
<HoppSmartTab :id="'raw'" :label="t('cookies.modal.raw_tab')">
<HoppSmartInput
v-model="rawCookieString"
:placeholder="t('cookies.modal.cookie_string')"
/>
</HoppSmartTab>
</HoppSmartTabs>
<HoppSmartInput
v-model="rawCookieString"
:placeholder="t('cookies.modal.cookie_string')"
/>
</template>
<template #footer>
@@ -81,12 +34,7 @@
<script setup lang="ts">
import { useI18n } from "@composables/i18n"
import { HoppSmartInput, HoppSmartTab } from "@hoppscotch/ui"
import { useService } from "dioc/vue"
import { watch, ref } from "vue"
import { CookieJarService } from "~/services/cookie-jar.service"
const cookieService = useService(CookieJarService)
// TODO: Build Managed Mode!
@@ -104,13 +52,6 @@ const emit = defineEmits<{
const t = useI18n()
const currentActiveTab = ref<"managed" | "raw">("managed")
const cookieName = ref("")
const cookieValue = ref("")
const cookiePath = ref("")
const cookieExpires = ref("")
const rawCookieString = ref("")
watch(
@@ -120,14 +61,7 @@ watch(
const cookieEntry = props.entry[2]
const parsedEntry = cookieService.parseSetCookieString(cookieEntry)
rawCookieString.value = cookieEntry
cookieName.value = parsedEntry.name ?? ""
cookieValue.value = parsedEntry.value ?? ""
cookiePath.value = parsedEntry.path ?? ""
cookieExpires.value = (parsedEntry.expires ?? new Date()).toISOString()
}
)