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

devel to staging #6044

Merged
merged 22 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c3d46d6
render checklists in react pdf
usu Sep 29, 2024
a147aa3
Merge remote-tracking branch 'ecamp/devel' into feat/activity-list-pr…
usu Sep 29, 2024
8e3b865
Fix overflow in camp admin checklist
manuelmeister Sep 29, 2024
1c9d86e
initial draft for activity list in react print
usu Sep 29, 2024
e1c86e3
Fix overflow in checklist node detailpane
manuelmeister Sep 29, 2024
85d0f46
fix translation-keys
pmattmann Sep 29, 2024
0dd3e5b
add contentTypeName if instanceName was overridden
usu Sep 29, 2024
7a5730b
Merge pull request #6042 from pmattmann/bugfix/register-form
pmattmann Sep 29, 2024
6233ac9
Merge pull request #6040 from usu/feat/checklist-print-react
pmattmann Sep 29, 2024
07bbbfe
Add a close button to checklist detailpane
manuelmeister Sep 29, 2024
b267dc7
Merge pull request #6041 from manuelmeister/feature/ui-checklists-imp…
pmattmann Sep 29, 2024
110c8e2
extract ScheduleEntry title into separate component
usu Sep 29, 2024
02698e2
improve checklist rendering
usu Sep 29, 2024
80cafd0
Make checklist contendnode respect acl
manuelmeister Sep 29, 2024
68c7d23
fix translation key
usu Sep 29, 2024
5b55302
fix: error message when deleting material list
simfeld Sep 29, 2024
3938401
Merge pull request #6047 from manuelmeister/feature/permissions-check…
pmattmann Sep 29, 2024
a7057ab
Update frontend/src/locales/de.json
simfeld Sep 29, 2024
a2ab70c
Merge pull request #6048 from simfeld/fix/material-list-delete-error
pmattmann Sep 29, 2024
1fb71e9
Merge remote-tracking branch 'ecamp/devel' into feat/activity-list-pr…
usu Sep 29, 2024
e49df4f
update snapshots
usu Sep 29, 2024
4ba5011
Merge pull request #6045 from usu/feat/activity-list-print-react
pmattmann Sep 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default [
'error',
{
ignoreKeysRegex:
'^(global|entity|contentNode\\.[a-z][a-zA-Z]+|print\\.(global|activity|cover|picasso|program|config|summary|toc))\\..+',
'^(global|entity|contentNode\\.[a-z][a-zA-Z]+|print\\.(global|activity|cover|picasso|program|config|summary|toc|activityList))\\..+',
translationKeyPropRegex: '[a-zA-Z0-9]-i18n-key$',
},
],
Expand Down
57 changes: 19 additions & 38 deletions frontend/src/components/activity/content/Checklist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
<ContentNodeCard class="ec-checklist-node" v-bind="$props">
<template #outer>
<DetailPane
v-if="!disabled && !layoutMode"
v-model="showDialog"
icon="mdi-clipboard-list-outline"
:title="$tc('components.activity.content.checklist.title')"
:cancel-action="close"
:cancel-visible="false"
>
<template #activator="{ on }">
<button
Expand All @@ -19,36 +22,10 @@
{{ $tc('global.button.edit') }}
</v-list-item-title>
</v-list-item>
<div
v-for="{ checklist, items } in activeChecklists"
:key="checklist._meta.self"
class="w-100"
>
<h3 class="px-4">{{ checklist.name }}</h3>
<v-list-item
v-for="{ item, parents } in items"
:key="item._meta.self"
class="min-h-0"
:disabled="layoutMode"
>
<v-list-item-content class="py-2">
<v-list-item-subtitle v-if="parents.length > 0" class="d-flex gap-1">
<template v-for="(parent, index) in parents">
<span v-if="index" :key="parent._meta.self + 'divider'">/</span>
<span
:key="parent._meta.self"
class="e-checklist-item-parent-name"
>{{ parent.text }}</span
>
</template>
</v-list-item-subtitle>
<v-list-item-title>
{{ parents.map(({ position }) => position + 1 + '.').join('')
}}{{ item.position + 1 }}. {{ item.text }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</div>
<ChecklistItems
:active-checklists="activeChecklists"
:layout-mode="layoutMode"
/>
</button>
</template>
<div class="ma-n4">
Expand Down Expand Up @@ -88,6 +65,12 @@
</v-expansion-panels>
</div>
</DetailPane>
<ChecklistItems
v-else
class="mb-1"
:active-checklists="activeChecklists"
:layout-mode="layoutMode"
/>
</template>
</ContentNodeCard>
</template>
Expand All @@ -97,13 +80,14 @@ import ContentNodeCard from '@/components/activity/content/layout/ContentNodeCar
import { contentNodeMixin } from '@/mixins/contentNodeMixin.js'
import DetailPane from '@/components/generic/DetailPane.vue'
import ChecklistItem from './checklist/ChecklistItem.vue'
import ChecklistItems from './checklist/ChecklistItems.vue'
import { serverErrorToString } from '@/helpers/serverError.js'
import { debounce, isEqual, sortBy, uniq } from 'lodash'
import { computed } from 'vue'

export default {
name: 'Checklist',
components: { DetailPane, ContentNodeCard, ChecklistItem },
components: { ChecklistItems, DetailPane, ContentNodeCard, ChecklistItem },
mixins: [contentNodeMixin],
provide() {
return {
Expand Down Expand Up @@ -257,14 +241,11 @@ export default {
this.uncheckedItems = []
this.dirty = false
},
close() {
this.showDialog = false
},
},
}
</script>

<style scoped>
.e-checklist-item-parent-name {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<style scoped></style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<div class="w-100">
<template v-for="{ checklist, items } in activeChecklists">
<h3 :key="checklist._meta.self" class="px-4">{{ checklist.name }}</h3>
<v-list-item
v-for="{ item, parents } in items"
:key="item._meta.self"
class="min-h-0"
:disabled="layoutMode"
>
<v-list-item-content class="py-2">
<v-list-item-subtitle v-if="parents.length > 0" class="d-flex gap-1">
<template v-for="(parent, index) in parents">
<span v-if="index" :key="parent._meta.self + 'divider'">/</span>
<span :key="parent._meta.self" class="e-checklist-item-parent-name">{{
parent.text
}}</span>
</template>
</v-list-item-subtitle>
<v-list-item-title class="ec-checklist--item-title">
{{ parents.map(({ position }) => position + 1 + '.').join('')
}}{{ item.position + 1 }}. {{ item.text }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</template>
</div>
</template>
<script>
export default {
name: 'ChecklistItems',
props: {
activeChecklists: {
type: Array,
required: true,
},
layoutMode: {
type: Boolean,
default: false,
},
},
}
</script>
<style scoped>
.e-checklist-item-parent-name {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}

.ec-checklist--item-title {
white-space: normal;
line-height: 1.33;
}
</style>
9 changes: 9 additions & 0 deletions frontend/src/components/campAdmin/DialogMaterialListEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PromptEntityDelete
:entity="entityUri"
:warning-text-entity="materialList.name"
:error-handler="deleteErrorHandler"
position="top"
align="left"
/>
Expand Down Expand Up @@ -50,6 +51,14 @@ export default {
}
},
},
methods: {
deleteErrorHandler(e) {
if (e?.response?.status === 422 /* Validation Error */) {
return this.$tc('components.campAdmin.dialogMaterialListEdit.deleteError')
}
return null
},
},
}
</script>

Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/checklist/SortableChecklist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,15 @@ export default {
padding-bottom: 6px;
display: grid;
}
.e-checklist-dragarea--inner {
min-width: 0;
}
.e-checklist-dragarea.dragging:deep(.e-checklist-dragarea) {
background: rgba(0, 130, 236, 0.15);
padding-bottom: 0;
}
.e-sortable-checklist-item__add {
min-width: 0;
padding-top: 2px;
padding-bottom: 2px;
}
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/dialog/DialogBottomSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,12 @@ export default {
.error-area:empty {
display: none;
}
:deep(.ec-dialog-form.v-bottom-sheet.v-dialog) {
overflow-y: auto;
}
.ec-dialog-toolbar {
position: sticky;
z-index: 10;
top: 0;
}
</style>
7 changes: 2 additions & 5 deletions frontend/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
"createMaterialList": "Materialliste erstellen",
"title": "Materiallisten"
},
"campMaterialListsItem": {
"deleteError": "Materialliste konnte nicht gelöscht werden. Überprüfe vor dem Löschen, dass die Liste leer ist.",
"deleteWarning": "Möchtest du diese Materialliste wirklich löschen?"
},
"campPeriods": {
"createPeriod": "Lagerabschnitt erstellen",
"title": "Lagerabschnitt | Lagerabschnitte"
Expand Down Expand Up @@ -135,7 +131,8 @@
"title": "Materialliste erstellen"
},
"dialogMaterialListEdit": {
"title": "Materialliste bearbeiten"
"title": "Materialliste bearbeiten",
"deleteError": "Materialliste konnte nicht gelöscht werden. Überprüfe vor dem Löschen, dass die Liste leer ist."
},
"dialogPeriodCreate": {
"title": "Lagerabschnitt erstellen"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
"createMaterialList": "Create material list",
"title": "Material lists"
},
"campMaterialListsItem": {
"deleteError": "Could not delete the material list. Check if the list is empty before deleting it.",
"deleteWarning": "Do you really want to delete this material list?"
},
"campPeriods": {
"createPeriod": "Create period",
"title": "Period | Periods"
Expand Down Expand Up @@ -135,7 +131,8 @@
"title": "Create material list"
},
"dialogMaterialListEdit": {
"title": "Edit material list"
"title": "Edit material list",
"deleteError": "Could not delete the material list. Check if the list is empty before deleting it."
},
"dialogPeriodCreate": {
"title": "Create period"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@
"createMaterialList": "Créer une liste de matériel",
"title": "Listes de matériel"
},
"campMaterialListsItem": {
"deleteError": "Impossible de supprimer la liste de matériel. Vérifie que la liste soit vide avant de la supprimer.",
"deleteWarning": "Veux-tu vraiment supprimer cette liste de matériel ?"
},
"campPeriods": {
"createPeriod": "Créer une période",
"title": "Période | Périodes"
Expand Down Expand Up @@ -124,7 +120,8 @@
"title": "Créer une liste de matériel"
},
"dialogMaterialListEdit": {
"title": "Modifier la liste de matériel"
"title": "Modifier la liste de matériel",
"deleteError": "Impossible de supprimer la liste de matériel. Vérifie que la liste soit vide avant de la supprimer."
},
"dialogPeriodCreate": {
"title": "Créer une période"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@
"createMaterialList": "Crea l'elenco dei materiali",
"title": "Elenchi di materiali"
},
"campMaterialListsItem": {
"deleteError": "Impossibile eliminare l'elenco dei materiali. Controlla che l'elenco sia vuoto prima di eliminarlo.",
"deleteWarning": "Vuoi davvero cancellare questo elenco di materiali?"
},
"campPeriods": {
"createPeriod": "Creare il periodo",
"title": "Periodo | Periodi"
Expand Down Expand Up @@ -116,7 +112,8 @@
"title": "Crea l'elenco dei materiali"
},
"dialogMaterialListEdit": {
"title": "Modifica elenco materiali"
"title": "Modifica elenco materiali",
"deleteError": "Impossibile eliminare l'elenco dei materiali. Controlla che l'elenco sia vuoto prima di eliminarlo."
},
"dialogPeriodCreate": {
"title": "Creare il periodo"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/rm.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
"createMaterialList": "Crear ina glista da material",
"title": "Glistas da material"
},
"campMaterialListsItem": {
"deleteError": "Impussibel da stizzar la glista da material. Verifitgescha che la glista è vida avant che stizzar.",
"deleteWarning": "Vuls ti propi stizzar questa glista da material?"
},
"campPeriods": {
"createPeriod": "Crear ina part dal champ",
"title": "Part dal champ | Parts dal champ"
Expand Down Expand Up @@ -109,7 +105,8 @@
"title": "Crear ina glista da material"
},
"dialogMaterialListEdit": {
"title": "Modifitgar la glista da material"
"title": "Modifitgar la glista da material",
"deleteError": "Impussibel da stizzar la glista da material. Verifitgescha che la glista è vida avant che stizzar."
},
"dialogPeriodCreate": {
"title": "Craer ina part dal champ"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/auth/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<auth-container>
<h1 class="display-1 text-center">{{ $tc('views.auth.register.title') }}</h1>
<validation-observer v-slot="{ handleSubmit }">
<e-form name="user">
<e-form name="profile">
<v-form @submit.prevent="handleSubmit(register)">
<e-text-field
v-model="firstname"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/auth/ResendActivation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
>
<e-text-field
v-model="email"
:label="$tc('entity.user.fields.email')"
:label="$tc('entity.profile.fields.email')"
name="email"
vee-rules="email"
append-icon="mdi-at"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/auth/ResetPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</v-alert>

<validation-observer v-slot="{ handleSubmit }">
<e-form name="user">
<e-form name="profile">
<v-form
v-if="status == 'loaded' || status == 'reseting'"
@submit.prevent="handleSubmit(resetPassword)"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/auth/ResetPasswordRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
>
<e-text-field
v-model="email"
:label="$tc('entity.user.fields.email')"
:label="$tc('entity.profile.fields.email')"
name="email"
vee-rules="email"
append-icon="mdi-at"
Expand Down
2 changes: 1 addition & 1 deletion pdf/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default [
'error',
{
ignoreKeysRegex:
'^(global|entity|contentNode\\.[a-z][a-zA-Z]+|print\\.(global|activity|cover|picasso|program|config|summary|toc))\\..+',
'^(global|entity|contentNode\\.[a-z][a-zA-Z]+|print\\.(global|activity|cover|picasso|program|config|summary|toc|activityList))\\..+',
translationKeyPropRegex: '[a-zA-Z0-9]-i18n-key$',
},
],
Expand Down
2 changes: 2 additions & 0 deletions pdf/src/CampPrint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Story from '@/campPrint/summary/Story.vue'
import SafetyConsiderations from '@/campPrint/summary/SafetyConsiderations.vue'
import Program from '@/campPrint/program/Program.vue'
import Activity from '@/campPrint/activity/Activity.vue'
import ActivityList from '@/campPrint/activityList/ActivityList.vue'
import { wordHyphenation } from '@react-pdf/textkit'

const originalHyphenationCallback = wordHyphenation()
Expand All @@ -47,6 +48,7 @@ export default {
Activity,
Story,
SafetyConsiderations,
ActivityList,
}
},
},
Expand Down
Loading
Loading