-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3993 from pmattmann/feature/copy-activity
Copy & paste activity
- Loading branch information
Showing
15 changed files
with
583 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
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
75 changes: 75 additions & 0 deletions
75
frontend/src/components/activity/CopyActivityInfoDialog.vue
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,75 @@ | ||
<template> | ||
<dialog-form | ||
v-model="showDialog" | ||
icon="mdi-content-copy" | ||
:title="$tc('components.activity.copyActivityInfoDialog.title')" | ||
:cancel-action="cancel" | ||
:cancel-label="$tc('global.button.close')" | ||
> | ||
<template #activator="scope"> | ||
<slot name="activator" v-bind="scope" /> | ||
</template> | ||
|
||
<p> | ||
{{ $tc('components.activity.copyActivityInfoDialog.description') }} | ||
</p> | ||
<p v-if="clipboardReadState === 'prompt'"> | ||
<center> | ||
<v-btn color="success" @click="requestClipboardAccess"> | ||
{{ $tc('components.activity.copyActivityInfoDialog.allow') }} | ||
</v-btn> | ||
</center> | ||
</p> | ||
<p v-if="clipboardReadState === 'granted'"> | ||
{{ $tc('components.activity.copyActivityInfoDialog.granted') }} | ||
</p> | ||
<p v-if="clipboardReadState === 'denied'"> | ||
{{ $tc('components.activity.copyActivityInfoDialog.denied') }} | ||
</p> | ||
</dialog-form> | ||
</template> | ||
|
||
<script> | ||
import DialogForm from '@/components/dialog/DialogForm.vue' | ||
import DialogBase from '@/components/dialog/DialogBase.vue' | ||
export default { | ||
name: 'CopyActivityInfoDialog', | ||
components: { | ||
DialogForm, | ||
}, | ||
extends: DialogBase, | ||
data() { | ||
return { | ||
clipboardReadState: 'unknown', | ||
} | ||
}, | ||
async mounted() { | ||
try { | ||
// read current permission | ||
const res = await navigator.permissions.query({ name: 'clipboard-read' }) | ||
this.clipboardReadState = res.state | ||
} catch { | ||
console.warn('clipboard permission not requestable') | ||
} | ||
}, | ||
methods: { | ||
cancel() { | ||
this.close() | ||
}, | ||
async requestClipboardAccess() { | ||
// if permission is not yet requested, request it | ||
if (this.clipboardReadState === 'prompt') { | ||
try { | ||
await navigator.clipboard.readText() | ||
} catch { | ||
console.log('clipboard read is denied') | ||
} | ||
const res = await navigator.permissions.query({ name: 'clipboard-read' }) | ||
this.clipboardReadState = res.state | ||
} | ||
}, | ||
}, | ||
} | ||
</script> |
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
1 change: 1 addition & 0 deletions
1
frontend/src/components/collaborator/PromptCollaboratorDeactivate.vue
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
Oops, something went wrong.