-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy & paste activity #3993
Merged
Merged
Copy & paste activity #3993
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
264ee4b
Add 'Copy Activity'-Function to Copy ScheduleEntry-Url
pmattmann 04d854b
update snapshot
pmattmann 84bef9a
code-review
pmattmann 618b40e
fix comment
pmattmann da3fd09
firefox-compatible
pmattmann 7ac7fc5
firefox and safari compatible
pmattmann 0e02f56
visual improvments; copy location & category
pmattmann bbcbde6
fix async loading
pmattmann b330ff5
await writeText()
pmattmann 0cfd3b2
loading-spinner
pmattmann 04cf90d
fix coloring; allow paste when clipboard-access is denied
pmattmann 29ef650
fix naming; use const
pmattmann 3e9ef0a
add translations
pmattmann fd46abe
fix button-text
pmattmann ee5bd25
Merge remote-tracking branch 'upstream/devel' into feature/copy-activity
manuelmeister 4ea6fd0
Implement review feedback
manuelmeister fccf59d
Merge pull request #7 from manuelmeister/feature/copy-activity
pmattmann 9d46cfc
Update ScheduleEntry.vue
pmattmann de53d84
update snapshot
pmattmann c8b15ec
Merge remote-tracking branch 'upstream/devel' into feature/copy-activity
manuelmeister File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: |
||
{{ $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', | ||
pmattmann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}, | ||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the source start with a capital letter