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

Frontend checklist implementation #5460

Merged
merged 32 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3ace435
Entity Checklist
pmattmann Jun 8, 2024
764c4d9
add checklist-fixtures
pmattmann Jun 10, 2024
67b0b2b
fix unittests
pmattmann Jun 10, 2024
988f96c
add Unittests
pmattmann Jun 15, 2024
27a8118
Add ChecklistItem
pmattmann Jun 15, 2024
e2cdf14
add Unittests for ChecklistItem
pmattmann Jun 15, 2024
cc876bb
Add ChecklistNode
pmattmann Jun 16, 2024
93ea874
Add UnitTests fot checklistNode
pmattmann Jun 18, 2024
3b67e15
UnitTest: ChecklistNode add/remove ChecklistItem
pmattmann Jun 21, 2024
8151ebc
unify AssertNoLoop-Validators
pmattmann Jun 22, 2024
218e9c7
fixes according to review
pmattmann Jul 9, 2024
0cee81e
fixes according to review
pmattmann Jul 9, 2024
2297d5f
ChecklistItem text length = 256
pmattmann Jul 13, 2024
e8d58d0
fix unittest-names
pmattmann Jul 15, 2024
09c4000
fix performance-unittests
pmattmann Jul 21, 2024
ac9fa32
changes according to review
pmattmann Aug 6, 2024
bdd8b35
UnitTest ChecklistNode can only contain ChecklistItems of the same camp
pmattmann Aug 8, 2024
46b5519
changes according to review
pmattmann Aug 8, 2024
630b9ab
UnitTest ChecklistItem NoParentLoop
pmattmann Aug 8, 2024
5cf86d5
cs-fix; phpstan
pmattmann Aug 8, 2024
15187f0
Add checklist to frontend admin
manuelmeister Jun 30, 2024
c4ef98d
Create checklist contentnode
manuelmeister Jul 5, 2024
3ff74df
Sort checklist items
manuelmeister Aug 16, 2024
f104731
Merge remote-tracking branch 'upstream/devel' into feature/checklist-…
manuelmeister Aug 27, 2024
f19208d
Add feature toggle for checklist
manuelmeister Aug 27, 2024
a8303d9
Combine contentType filter
manuelmeister Sep 12, 2024
45057f5
Fix description of checklist featureToggle
manuelmeister Sep 12, 2024
98a4220
Merge remote-tracking branch 'upstream/devel' into feature/checklist-…
manuelmeister Sep 12, 2024
46651ec
Add content if empty
manuelmeister Sep 12, 2024
53c1a3a
Fix lint
manuelmeister Sep 12, 2024
d23d05c
Add camp search filter improve loading
manuelmeister Sep 12, 2024
c8998f2
Update api snapshots
manuelmeister Sep 12, 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
1 change: 1 addition & 0 deletions .github/workflows/reusable-dev-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
--set recaptcha.secret='${{ secrets.RECAPTCHA_SECRET }}' \
--set frontend.loginInfoTextKey=${{ vars.LOGIN_INFO_TEXT_KEY }} \
--set featureToggle.developer=true
--set featureToggle.checklist=true

- name: Finish the GitHub deployment
uses: bobheadxi/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .helm/deploy-to-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ for i in 1; do
values="$values --set deploymentTime=$(date -u +%s)"
values="$values --set deployedVersion=\"$(git rev-parse --short HEAD)\""
values="$values --set featureToggle.developer=true"
values="$values --set featureToggle.checklist=true"

if [ -n "$BACKUP_SCHEDULE" ]; then
values="$values --set postgresql.backup.schedule=$BACKUP_SCHEDULE"
Expand Down
1 change: 1 addition & 0 deletions .helm/ecamp3/templates/frontend_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data:
RECAPTCHA_SITE_KEY: null,
{{- end }}
FEATURE_DEVELOPER: {{ .Values.featureToggle.developer | default false }},
FEATURE_CHECKLIST: {{ .Values.featureToggle.checklist | default false }},
LOGIN_INFO_TEXT_KEY: '{{ .Values.frontend.loginInfoTextKey }}',
}
deployedVersion: {{ .Values.deployedVersion | quote }}
3 changes: 2 additions & 1 deletion .helm/ecamp3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ helpLink: # 'https://ecamp3.ch/faq'
# enable/disable feature across the complete deployment
featureToggle:
developer: false # enables various tools/features foreseen for development deployments (language switcher, form controls view, performance measurement view, etc.)
checklist: false # enables checklist feature in frontend

api:
subpath: "/api"
Expand Down Expand Up @@ -251,7 +252,7 @@ apiCache:
requests:
cpu: 10m
memory: 20Mi

manuelmeister marked this conversation as resolved.
Show resolved Hide resolved
autoscaling:
enabled: false
minReplicas: 1
Expand Down
16 changes: 16 additions & 0 deletions common/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
}
},
"contentNode": {
"checklist": {
"icon": "mdi-clipboard-list-outline",
"name": "Checkliste"
},
"columnLayout": {
"entity": {
"column": {
Expand Down Expand Up @@ -169,6 +173,18 @@
"-": "keine Nummerierung"
}
},
"checklist": {
"fields": {
"name": "Name"
},
"name": "Checkliste | Checklisten"
},
"checklistItem": {
"fields": {
"text": "Text"
},
"name": "Checklisteneintrag"
},
"contentType": {
"name": "Inhalttyp | Inhalttypen"
},
Expand Down
12 changes: 12 additions & 0 deletions common/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@
"-": "no numbering"
}
},
"checklist": {
"fields": {
"name": "Name"
},
"name": "Checklist | Checklists"
},
"checklistItem": {
"fields": {
"text": "Text"
},
"name": "Checklist entry"
},
"contentType": {
"name": "Contenttype | Contenttypes"
},
Expand Down
11 changes: 11 additions & 0 deletions common/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@
"i": "i, ii, iii - chiffres romains minuscules"
}
},
"checklist": {
"fields": {
"name": "Nom"
},
"name": "Check-list | Check-lists"
},
"checklistItem": {
"fields": {
"text": "Text"
}
},
"contentType": {
"name": "Type de contenu | Types de contenu"
},
Expand Down
21 changes: 15 additions & 6 deletions frontend/src/components/activity/ButtonNestedContentNodeAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<script>
import { camelCase } from 'lodash'
import { errorToMultiLineToast } from '@/components/toast/toasts'
import { getEnv } from '@/environment.js'

export default {
name: 'ButtonNestedContentNodeAdd',
Expand All @@ -82,7 +83,7 @@ export default {
return []
}
return this.preferredContentTypes()
.items.filter((ct) => this.showResponsiveLayout(ct))
.items.filter(this.filterContentType)
.sort(this.sortContentTypeByTranslatedName)
},
nonpreferredContentTypesItems() {
Expand All @@ -94,7 +95,7 @@ export default {
.contentTypes()
.items.filter(
(ct) =>
this.showResponsiveLayout(ct) &&
this.filterContentType(ct) &&
!this.preferredContentTypes()
.items.map((ct) => ct.id)
.includes(ct.id)
Expand All @@ -104,6 +105,9 @@ export default {
contentTypesLoading() {
return this.api.get().contentTypes()._meta.loading
},
featureChecklistEnabled() {
return getEnv().FEATURE_CHECKLIST ?? false
},
},
methods: {
contentTypeNameKey(contentType) {
Expand All @@ -112,10 +116,15 @@ export default {
contentTypeIconKey(contentType) {
return 'contentNode.' + camelCase(contentType.name) + '.icon'
},
showResponsiveLayout(contentType) {
return (
contentType.name !== 'ResponsiveLayout' || this.parentContentNode.parent === null
)
filterContentType(contentType) {
switch (contentType.name) {
case 'ResponsiveLayout':
return this.parentContentNode.parent === null
case 'Checklist':
return this.featureChecklistEnabled
default:
return true
}
},
sortContentTypeByTranslatedName(ct1, ct2) {
const ct1name = this.$i18n.tc(this.contentTypeNameKey(ct1))
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/activity/ContentNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import SafetyConsiderations from './content/SafetyConsiderations.vue'
import Storyboard from './content/Storyboard.vue'
import Storycontext from './content/Storycontext.vue'
import Checklist from './content/Checklist.vue'

const contentNodeComponents = {
ColumnLayout,
Expand All @@ -35,6 +36,7 @@
SafetyConsiderations,
Storyboard,
Storycontext,
Checklist,
}

export default {
Expand All @@ -49,7 +51,7 @@
}
</script>

<style lang="scss">

Check warning on line 54 in frontend/src/components/activity/ContentNode.vue

View workflow job for this annotation

GitHub Actions / Lint: Frontend (ESLint)

Missing attribute `scoped`
.draggable {
cursor: move;
transition: background-color 0.3s 25ms ease;
Expand Down
Loading
Loading