Skip to content
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 category from other category or from activity #4823

Merged
merged 7 commits into from Mar 30, 2024

Conversation

carlobeltrame
Copy link
Member

Similar to #3993, but for pasting and duplicating categories. A pasted category can be based on another category (from the same or a different camp), or on an activity (from the same or a different camp).

Backend implementation is hilariously simple with the system we already have set up, props to @pmattmann!

I did this because it is a requested feature (with medium prio), and also I felt the need myself when setting up a camp recently.

@carlobeltrame carlobeltrame added the deploy! Creates a feature branch deployment for this PR label Mar 26, 2024
Copy link

github-actions bot commented Mar 26, 2024

Feature branch deployment currently inactive.

If the PR is still open, you can add the deploy! label to this PR to trigger a feature branch deployment.

Copy link
Member

@manuelmeister manuelmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool functionality

<v-btn v-show="clipboardPermission === 'prompt'" v-on="on">
<v-icon left>mdi-information-outline</v-icon>
{{
$tc('components.campAdmin.dialogCategoryCreate.copyPasteCategoryOrActivity')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is too verbose

Bildschirmfoto 2024-03-26 um 21 32 06

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 81a5694

@@ -23,10 +104,17 @@ import { categoryRoute } from '@/router.js'
import DialogForm from '@/components/dialog/DialogForm.vue'
import DialogBase from '@/components/dialog/DialogBase.vue'
import DialogCategoryForm from './DialogCategoryForm.vue'
import PopoverPrompt from '../prompt/PopoverPrompt.vue'
import router from '../../router.js'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an absolute import?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7fe7f5f

)
})
.then(async (url) => {
this.copyActivitySource = await (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this better?
i think 2 lines would make this easier to read

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7fe7f5f

@@ -272,7 +272,7 @@ export default {
async copyUrlToClipboard() {
try {
const res = await navigator.permissions.query({ name: 'clipboard-read' })
if (res.state == 'prompt') {
if (res.state === 'prompt') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a lint rule for that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be good.

@@ -16,14 +16,24 @@

<template #title-actions>
<TogglePaperSize v-model="isPaperDisplaySize" />
<v-menu v-if="isManager" offset-y>
<v-menu offset-y>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, like this you can copy categories from camps where you are not a manager, nice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. Same as for the activities which we already allow to copy. Sharing is caring.

@carlobeltrame carlobeltrame added this pull request to the merge queue Mar 30, 2024
Merged via the queue into ecamp:devel with commit 37794d5 Mar 30, 2024
32 checks passed
@carlobeltrame carlobeltrame deleted the copy-category branch March 30, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! Creates a feature branch deployment for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants