-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates Access Control Section for Analyses (#160)
- Loading branch information
Showing
8 changed files
with
187 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<script setup lang="ts"> | ||
const { newModalVisibilityState } = useModal() | ||
const { computedBooleanLocalStorageValue } = useLocalStorage() | ||
const { t } = useI18n() | ||
interface Props { | ||
value: boolean | ||
} | ||
const props = defineProps<Props>() | ||
interface Emits { | ||
(e: 'update:value', value: boolean): void | ||
} | ||
const emit = defineEmits<Emits>() | ||
const prefix = 'components/SharedToPublicToggleButton' | ||
const tt = (s: string) => t(`${prefix}.${s}`) | ||
const everAcked = computedBooleanLocalStorageValue(`${prefix}.everAcked`, false) | ||
const model = computed({ | ||
get: () => props.value, | ||
set: (value: boolean) => { | ||
if (value && !everAcked.value) { | ||
visible.value = true | ||
return | ||
} else { | ||
emit('update:value', value) | ||
} | ||
}, | ||
}) | ||
const ack = () => { | ||
everAcked.value = true | ||
model.value = true | ||
visible.value = false | ||
} | ||
const noAck = () => { | ||
model.value = false | ||
} | ||
const visible = newModalVisibilityState('SharedToPublicWarning') | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<ExplicitInputSwitch | ||
v-model:value="model" | ||
:on-label="tt('Shared to Public')" | ||
:off-label="tt('Not Shared')" | ||
/> | ||
<StandardModal | ||
v-model:visible="visible" | ||
:header="tt('ModalHeading')" | ||
:sub-header="tt('ModalSubheading')" | ||
> | ||
<p> | ||
{{ tt('Paragraph1') }} | ||
</p> | ||
<p> | ||
{{ tt('Paragraph2') }} | ||
</p> | ||
<div class="flex pt-3 gap-2 justify-content-between align-items-center flex-wrap"> | ||
<PVButton | ||
:label="tt('No Ack')" | ||
icon="pi pi-arrow-left" | ||
class="p-button-secondary" | ||
@click="noAck" | ||
/> | ||
<PVButton | ||
:label="tt('Ack')" | ||
icon="pi pi-arrow-right" | ||
icon-pos="right" | ||
@click="ack" | ||
/> | ||
</div> | ||
</StandardModal> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters