Added confirmation for profile deletion
This commit is contained in:
parent
fc04e71311
commit
85b0549a11
@ -12,53 +12,105 @@
|
|||||||
<p class="text-md whitespace-nowrap">{{ state.group }}</p>
|
<p class="text-md whitespace-nowrap">{{ state.group }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center">
|
<div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center">
|
||||||
<button
|
<div v-if="(state.delete_active === false)">
|
||||||
type="button"
|
<button
|
||||||
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-blue-500 hover:bg-blue-600 hover:shadow-lg"
|
type="button"
|
||||||
>
|
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-blue-500 hover:bg-blue-600 hover:shadow-lg"
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="feather feather-download"
|
|
||||||
style="display: inline;height: 1rem;vertical-align: sub;"
|
|
||||||
>
|
>
|
||||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
<svg
|
||||||
<polyline points="7 10 12 15 17 10" />
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<line x1="12" y1="15" x2="12" y2="3" />
|
width="24"
|
||||||
</svg>
|
height="24"
|
||||||
{{ $t('download_certificate') }}
|
viewBox="0 0 24 24"
|
||||||
</button>
|
fill="none"
|
||||||
<button
|
stroke="currentColor"
|
||||||
type="button"
|
stroke-width="2"
|
||||||
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-red-600 hover:bg-red-700 hover:shadow-lg ml-1"
|
stroke-linecap="round"
|
||||||
@click="delete_me"
|
stroke-linejoin="round"
|
||||||
>
|
class="feather feather-download"
|
||||||
<svg
|
style="display: inline;height: 1rem;vertical-align: sub;"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
>
|
||||||
width="24"
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||||
height="24"
|
<polyline points="7 10 12 15 17 10" />
|
||||||
viewBox="0 0 24 24"
|
<line x1="12" y1="15" x2="12" y2="3" />
|
||||||
fill="none"
|
</svg>
|
||||||
stroke="currentColor"
|
{{ $t('download_certificate') }}
|
||||||
stroke-width="2"
|
</button>
|
||||||
stroke-linecap="round"
|
<button
|
||||||
stroke-linejoin="round"
|
type="button"
|
||||||
class="feather feather-download"
|
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-red-600 hover:bg-red-700 hover:shadow-lg ml-1"
|
||||||
style="display: inline;height: 1rem;vertical-align: sub;"
|
@click="() => { state.delete_active = true }"
|
||||||
>
|
>
|
||||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
<svg
|
||||||
<polyline points="7 10 12 15 17 10" />
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<line x1="12" y1="15" x2="12" y2="3" />
|
width="24"
|
||||||
</svg>
|
height="24"
|
||||||
{{ $t('delete-all-of-my-data') }}
|
viewBox="0 0 24 24"
|
||||||
</button>
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="feather feather-download"
|
||||||
|
style="display: inline;height: 1rem;vertical-align: sub;"
|
||||||
|
>
|
||||||
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||||
|
<polyline points="7 10 12 15 17 10" />
|
||||||
|
<line x1="12" y1="15" x2="12" y2="3" />
|
||||||
|
</svg>
|
||||||
|
{{ $t('delete-all-of-my-data') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div v-if="(state.delete_active === true)">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-blue-500 hover:bg-blue-600 hover:shadow-lg"
|
||||||
|
@click="() => { state.delete_active = false }"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="feather feather-download"
|
||||||
|
style="display: inline;height: 1rem;vertical-align: sub;"
|
||||||
|
>
|
||||||
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||||
|
<polyline points="7 10 12 15 17 10" />
|
||||||
|
<line x1="12" y1="15" x2="12" y2="3" />
|
||||||
|
</svg>
|
||||||
|
Cancel, keep my data
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="focus:border-black focus:ring-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md bg-red-600 hover:bg-red-700 hover:shadow-lg ml-1"
|
||||||
|
@click="delete_me"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="feather feather-download"
|
||||||
|
style="display: inline;height: 1rem;vertical-align: sub;"
|
||||||
|
>
|
||||||
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||||
|
<polyline points="7 10 12 15 17 10" />
|
||||||
|
<line x1="12" y1="15" x2="12" y2="3" />
|
||||||
|
</svg>
|
||||||
|
Confirm, delete all of my data
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -202,6 +254,7 @@ const state = reactive({
|
|||||||
scans: [],
|
scans: [],
|
||||||
group: "",
|
group: "",
|
||||||
activetab: "profile",
|
activetab: "profile",
|
||||||
|
delete_active: false,
|
||||||
})
|
})
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -230,10 +283,10 @@ axios.get(`${config.baseurl}api/runners/me/${accesstoken}/scans`)
|
|||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
toast.error("An error occured while loading your profile data");
|
toast.error("An error occured while loading your profile data");
|
||||||
})
|
})
|
||||||
function delete_me () {
|
function delete_me() {
|
||||||
toast("deletion in progress...");
|
toast("deletion in progress...");
|
||||||
const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
|
const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
|
||||||
let url = `${config.baseurl}api/runners/me/${accesstoken}?force=true`
|
let url = `${config.baseurl}api/runners/me/${accesstoken}?force=true`
|
||||||
axios.delete(url)
|
axios.delete(url)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
location.replace(`${config.baseurl_selfservice}`);
|
location.replace(`${config.baseurl_selfservice}`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user