diff --git a/core/assets/package-lock.json b/core/assets/package-lock.json index ee01999c71..84b28ab533 100644 --- a/core/assets/package-lock.json +++ b/core/assets/package-lock.json @@ -11,7 +11,7 @@ "alpinejs": "^2.8.2", "blurhash": "^1.1.3", "lodash": "^4.17.21", - "pdfjs-dist": "^4.2.67", + "pdfjs-dist": "^3.11.174", "stringify": "^5.2.0", "trix": "^2.1.1" }, @@ -106,6 +106,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", "optional": true, "dependencies": { "delegates": "^1.0.0", @@ -222,9 +223,9 @@ "optional": true }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "optional": true, "dependencies": { "ms": "2.1.2" @@ -257,9 +258,9 @@ "optional": true }, "node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", "optional": true, "engines": { "node": ">=8" @@ -317,6 +318,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", "optional": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -337,6 +339,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "optional": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -410,6 +413,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "optional": true, "dependencies": { "once": "^1.3.0", @@ -446,18 +450,6 @@ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==" }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -559,9 +551,9 @@ "optional": true }, "node_modules/nan": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", - "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", + "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==", "optional": true }, "node_modules/ncname": { @@ -622,6 +614,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", "optional": true, "dependencies": { "are-we-there-yet": "^2.0.0", @@ -665,25 +658,25 @@ "node": ">=0.10.0" } }, - "node_modules/path2d": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/path2d/-/path2d-0.2.0.tgz", - "integrity": "sha512-KdPAykQX6kmLSOO6Jpu2KNcCED7CKjmaBNGGNuctOsG0hgYO1OdYQaan6cYXJiG0WmXOwZZPILPBimu5QAIw3A==", + "node_modules/path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", "optional": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/pdfjs-dist": { - "version": "4.2.67", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.2.67.tgz", - "integrity": "sha512-rJmuBDFpD7cqC8WIkQUEClyB4UAH05K4AsyewToMTp2gSy3Rrx8c1ydAVqlJlGv3yZSOrhEERQU/4ScQQFlLHA==", + "version": "3.11.174", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", + "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", "engines": { "node": ">=18" }, "optionalDependencies": { "canvas": "^2.11.2", - "path2d": "^0.2.0" + "path2d-polyfill": "^2.0.1" } }, "node_modules/prettier": { @@ -748,6 +741,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "optional": true, "dependencies": { "glob": "^7.1.3" @@ -780,13 +774,10 @@ "optional": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, diff --git a/core/assets/package.json b/core/assets/package.json index 2b4618e3da..3050412fbf 100644 --- a/core/assets/package.json +++ b/core/assets/package.json @@ -9,7 +9,7 @@ "alpinejs": "^2.8.2", "blurhash": "^1.1.3", "lodash": "^4.17.21", - "pdfjs-dist": "^4.2.67", + "pdfjs-dist": "^3.11.174", "stringify": "^5.2.0", "trix": "^2.1.1" }, diff --git a/core/priv/gettext/en/LC_MESSAGES/eyra-account.po b/core/priv/gettext/en/LC_MESSAGES/eyra-account.po index 12e4cd5a9e..754648bf37 100644 --- a/core/priv/gettext/en/LC_MESSAGES/eyra-account.po +++ b/core/priv/gettext/en/LC_MESSAGES/eyra-account.po @@ -28,7 +28,7 @@ msgstr "Password" #, elixir-autogen, elixir-format msgid "profile.title" -msgstr "My profile" +msgstr "Account" #, elixir-autogen, elixir-format msgid "signup.button" diff --git a/core/priv/gettext/en/LC_MESSAGES/eyra-advert.po b/core/priv/gettext/en/LC_MESSAGES/eyra-advert.po index ccc506e300..66e08f2948 100644 --- a/core/priv/gettext/en/LC_MESSAGES/eyra-advert.po +++ b/core/priv/gettext/en/LC_MESSAGES/eyra-advert.po @@ -68,11 +68,11 @@ msgstr "Rich" #, elixir-autogen, elixir-format msgid "advert.default.name" -msgstr "Advertisement" +msgstr "Panl advertisement" #, elixir-autogen, elixir-format msgid "project.item.tag" -msgstr "Advertisement" +msgstr "Panl advertisement" #, elixir-autogen, elixir-format msgid "close.button" diff --git a/core/priv/gettext/en/LC_MESSAGES/eyra-assignment.po b/core/priv/gettext/en/LC_MESSAGES/eyra-assignment.po index 7ec5ec7b0a..1c0c4acc2e 100644 --- a/core/priv/gettext/en/LC_MESSAGES/eyra-assignment.po +++ b/core/priv/gettext/en/LC_MESSAGES/eyra-assignment.po @@ -184,11 +184,11 @@ msgstr "Change logo" #, elixir-autogen, elixir-format msgid "settings.logo.title" -msgstr "Organization logo" +msgstr "Logo" #, elixir-autogen, elixir-format, fuzzy msgid "settings.branding.text" -msgstr "Use the fields below to customize the header of your participant workflow. Add the name and logo of the organisation that is responsible for the workflow. Curious to see what this will look like for participants? Click 'Preview' at the top right to check it out." +msgstr "Use the fields below to customize the header of your participant workflow. Curious to see what this will look like for participants? Click 'Preview' at the top right to check it out." #, elixir-autogen, elixir-format, fuzzy msgid "settings.branding.title" @@ -212,7 +212,7 @@ msgstr "Show" #, elixir-autogen, elixir-format, fuzzy msgid "settings.intro.body" -msgstr "Add an about page to onboard and inform your participants. Were your participants already informed in some other way? Choose 'Skip'." +msgstr "Add an about page to onboard and inform your participants or choose 'Skip'." #, elixir-autogen, elixir-format, fuzzy msgid "settings.intro.title" @@ -224,7 +224,7 @@ msgstr "About" #, elixir-autogen, elixir-format, fuzzy msgid "settings.support.body" -msgstr "This page will be shown when participants click the 'i' at the right bottom and choose 'Need help?'. Check out 'Preview' to see what this will look like. Use the text field below to inform participants about how to get support when needed. Choose 'Skip' if you are not planning to provide support." +msgstr "Use the text field below to inform participants about how to get support when needed. This page will be shown when participants click the 'i' at the right bottom. Check out 'Preview' to see what this will look like. Choose 'Skip' if you are not planning to provide support." #, elixir-autogen, elixir-format, fuzzy msgid "settings.support.title" @@ -364,23 +364,23 @@ msgstr "Enables participants to submit their method to the challenge with a GitH #, elixir-autogen, elixir-format msgid "invite.panel.annotation" -msgstr "Participants first need to create an account. After this, the url below can be used to invite participants. When participants click on this link they will be asked to sign in. After sign in, they are forwarded to your assignment." +msgstr "The url below can be used to invite people to test your study. Participants need to sign in or create an account to participate. After sign in, they are forwarded to your study." #, elixir-autogen, elixir-format, fuzzy msgid "invite.panel.title" -msgstr "Invite participants" +msgstr "Study link" #, elixir-autogen, elixir-format, fuzzy msgid "workflow_item.general_instruction.description" -msgstr "Enables you to instruct the participants on (specific parts of) the assignment." +msgstr "Provide instructions for participants." #, elixir-autogen, elixir-format, fuzzy msgid "workflow_item.onsite_experiment.description" -msgstr "Prepares participants for a visit to a lab." +msgstr "Enables participants to book a time slot for your on-site study." #, elixir-autogen, elixir-format msgid "advert.body" -msgstr "Recruit participants on Panl using an advertisement." +msgstr "This advertisement will be used to advertise your study to Panl participants and allows them to participate in your study." #, elixir-autogen, elixir-format, fuzzy msgid "advert.create.button" @@ -388,8 +388,8 @@ msgstr "Create advertisement" #, elixir-autogen, elixir-format msgid "advert.goto.button" -msgstr "Go to Advertisement" +msgstr "Go to advertisement" #, elixir-autogen, elixir-format msgid "advert.title" -msgstr "Advertise in pool" +msgstr "Panl advertisement" diff --git a/core/priv/gettext/en/LC_MESSAGES/eyra-enums.po b/core/priv/gettext/en/LC_MESSAGES/eyra-enums.po index e9b1dfef17..6eddd58cb4 100644 --- a/core/priv/gettext/en/LC_MESSAGES/eyra-enums.po +++ b/core/priv/gettext/en/LC_MESSAGES/eyra-enums.po @@ -292,7 +292,7 @@ msgstr "Department" #, elixir-autogen, elixir-format msgid "project_item_templates.data_donation" -msgstr "Data Donation" +msgstr "Data donation" #, elixir-autogen, elixir-format, fuzzy msgid "templates.data_donation" @@ -352,11 +352,11 @@ msgstr "Dutch" #, elixir-autogen, elixir-format, fuzzy msgid "project_item_templates.benchmark_challenge" -msgstr "Benchmark Challenge" +msgstr "Benchmark challenge" #, elixir-autogen, elixir-format msgid "templates.benchmark_challenge" -msgstr "Benchmark Challenge" +msgstr "Benchmark challenge" #, elixir-autogen, elixir-format msgid "assignment_workflow_item_types.donate" @@ -408,7 +408,7 @@ msgstr "Public" #, elixir-autogen, elixir-format, fuzzy msgid "project_item_templates.questionnaire" -msgstr "Panl questionnaire" +msgstr "Panl study" #, elixir-autogen, elixir-format, fuzzy msgid "assignment_workflow_item_types.general_instruction" @@ -416,11 +416,11 @@ msgstr "Participant instructions" #, elixir-autogen, elixir-format, fuzzy msgid "assignment_workflow_item_types.onsite_experiment" -msgstr "Onsite experiment" +msgstr "On-site study" #, elixir-autogen, elixir-format, fuzzy msgid "templates.questionnaire" -msgstr "Questionnaire" +msgstr "Panl study" #, elixir-autogen, elixir-format, fuzzy msgid "advert_status.concept" diff --git a/core/priv/gettext/en/LC_MESSAGES/eyra-home.po b/core/priv/gettext/en/LC_MESSAGES/eyra-home.po index 9a2bd01ac5..93eeed2c0a 100644 --- a/core/priv/gettext/en/LC_MESSAGES/eyra-home.po +++ b/core/priv/gettext/en/LC_MESSAGES/eyra-home.po @@ -12,20 +12,20 @@ msgstr "" #, elixir-autogen, elixir-format msgid "member.title" -msgstr "My homepage" +msgstr "My home" #, elixir-autogen, elixir-format msgid "visitor.title" -msgstr "Welcome visitor" +msgstr "Welcome" #, elixir-autogen, elixir-format msgid "participated.title" -msgstr "Participations" +msgstr "Contributions" #, elixir-autogen, elixir-format msgid "available.member.title" -msgstr "Available studies" +msgstr "Panl studies" #, elixir-autogen, elixir-format msgid "available.visitor.title" -msgstr "Example studies" +msgstr "Panl studies" diff --git a/core/priv/gettext/en/LC_MESSAGES/eyra-next.po b/core/priv/gettext/en/LC_MESSAGES/eyra-next.po index 21c8493786..7031f4d2df 100644 --- a/core/priv/gettext/en/LC_MESSAGES/eyra-next.po +++ b/core/priv/gettext/en/LC_MESSAGES/eyra-next.po @@ -13,7 +13,7 @@ msgstr "" #, elixir-autogen, elixir-format msgid "creator.signin.title" -msgstr "Creator" +msgstr "Researcher" #, elixir-autogen, elixir-format msgid "participant.signin.title" diff --git a/core/priv/gettext/en/LC_MESSAGES/eyra-ui.po b/core/priv/gettext/en/LC_MESSAGES/eyra-ui.po index 2971e6b903..7a454f6bb0 100644 --- a/core/priv/gettext/en/LC_MESSAGES/eyra-ui.po +++ b/core/priv/gettext/en/LC_MESSAGES/eyra-ui.po @@ -20,7 +20,7 @@ msgstr "Saved" #, elixir-autogen, elixir-format msgid "menu.item.profile" -msgstr "My profile" +msgstr "Account" #, elixir-autogen, elixir-format msgid "menu.item.signin" @@ -72,7 +72,7 @@ msgstr "Delete" #, elixir-autogen, elixir-format msgid "ok.button" -msgstr "OK" +msgstr "Ok" #, elixir-autogen, elixir-format msgid "menu.item.support" @@ -132,11 +132,11 @@ msgstr "Projects" #, elixir-autogen, elixir-format, fuzzy msgid "start.page.projects" -msgstr "Go to console" +msgstr "Go to desktop" #, elixir-autogen, elixir-format, fuzzy msgid "start.page.home" -msgstr "Go to console" +msgstr "Go to desktop" #, elixir-autogen, elixir-format, fuzzy msgid "collapse.button" diff --git a/core/priv/gettext/nl/LC_MESSAGES/eyra-account.po b/core/priv/gettext/nl/LC_MESSAGES/eyra-account.po index f0519be479..ffa987ce39 100644 --- a/core/priv/gettext/nl/LC_MESSAGES/eyra-account.po +++ b/core/priv/gettext/nl/LC_MESSAGES/eyra-account.po @@ -28,7 +28,7 @@ msgstr "Wachtwoord" #, elixir-autogen, elixir-format msgid "profile.title" -msgstr "Mijn profiel" +msgstr "Account" #, elixir-autogen, elixir-format msgid "signup.button" diff --git a/core/priv/gettext/nl/LC_MESSAGES/eyra-home.po b/core/priv/gettext/nl/LC_MESSAGES/eyra-home.po index 4ab613efa6..6023edbcb9 100644 --- a/core/priv/gettext/nl/LC_MESSAGES/eyra-home.po +++ b/core/priv/gettext/nl/LC_MESSAGES/eyra-home.po @@ -12,20 +12,20 @@ msgstr "" #, elixir-autogen, elixir-format msgid "member.title" -msgstr "Mijn startpagina" +msgstr "Mijn omgeving" #, elixir-autogen, elixir-format msgid "visitor.title" -msgstr "Welkom bezoeker" +msgstr "Welkom" #, elixir-autogen, elixir-format msgid "participated.title" -msgstr "Participaties" +msgstr "Bijdragen" #, elixir-autogen, elixir-format msgid "available.member.title" -msgstr "Beschikbare studies" +msgstr "Panl studies" #, elixir-autogen, elixir-format msgid "available.visitor.title" -msgstr "Voorbeeld studies" +msgstr "Panl studies" diff --git a/core/priv/gettext/nl/LC_MESSAGES/eyra-next.po b/core/priv/gettext/nl/LC_MESSAGES/eyra-next.po index e68f10e9a6..49160f43c7 100644 --- a/core/priv/gettext/nl/LC_MESSAGES/eyra-next.po +++ b/core/priv/gettext/nl/LC_MESSAGES/eyra-next.po @@ -13,7 +13,7 @@ msgstr "" #, elixir-autogen, elixir-format msgid "creator.signin.title" -msgstr "Maker" +msgstr "Onderzoeker" #, elixir-autogen, elixir-format msgid "participant.signin.title" @@ -21,4 +21,4 @@ msgstr "Deelnemer" #, elixir-autogen, elixir-format msgid "surfconext.signin.body" -msgstr "" +msgstr "Gebruik je organisatie login om in te loggen via Surfconext, deze optie is niet voor alle organisaties beschikbaar." diff --git a/core/priv/gettext/nl/LC_MESSAGES/eyra-ui.po b/core/priv/gettext/nl/LC_MESSAGES/eyra-ui.po index e6845074a1..5f0d5fbbe0 100644 --- a/core/priv/gettext/nl/LC_MESSAGES/eyra-ui.po +++ b/core/priv/gettext/nl/LC_MESSAGES/eyra-ui.po @@ -20,7 +20,7 @@ msgstr "Opgeslagen" #, elixir-autogen, elixir-format msgid "menu.item.profile" -msgstr "Mijn profiel" +msgstr "Account" #, elixir-autogen, elixir-format msgid "menu.item.signin" @@ -72,7 +72,7 @@ msgstr "Verwijderen" #, elixir-autogen, elixir-format msgid "ok.button" -msgstr "OK" +msgstr "Ok" #, elixir-autogen, elixir-format msgid "menu.item.support" @@ -132,11 +132,11 @@ msgstr "Projecten" #, elixir-autogen, elixir-format, fuzzy msgid "start.page.projects" -msgstr "Ga naar console" +msgstr "Ga naar bureaublad" #, elixir-autogen, elixir-format, fuzzy msgid "start.page.home" -msgstr "Ga naar console" +msgstr "Ga naar bureaublad" #, elixir-autogen, elixir-format, fuzzy msgid "collapse.button" @@ -200,4 +200,4 @@ msgstr "To-do" #, elixir-autogen, elixir-format, fuzzy msgid "menu.item.workspace" -msgstr "My workspace" +msgstr "Mijn werkplek" diff --git a/core/systems/account/_public.ex b/core/systems/account/_public.ex index e85ab1e255..6b71e8b16e 100644 --- a/core/systems/account/_public.ex +++ b/core/systems/account/_public.ex @@ -508,14 +508,12 @@ defmodule Systems.Account.Public do end # Visited Pages - def mark_as_visited(user, page) when is_atom(page), - do: mark_as_visited(user, Atom.to_string(page)) - def mark_as_visited(%User{visited_pages: nil} = user, page) do + def mark_as_visited(%User{visited_pages: nil} = user, page) when is_binary(page) do update_visited(user, [page]) end - def mark_as_visited(%User{visited_pages: visited_pages} = user, page) do + def mark_as_visited(%User{visited_pages: visited_pages} = user, page) when is_binary(page) do if visited?(user, page) do Signal.Public.dispatch(:visited_pages_updated, %{user: user, visited_pages: visited_pages}) else @@ -523,6 +521,8 @@ defmodule Systems.Account.Public do end end + def mark_as_visited(user, page), do: mark_as_visited(user, page_key(page)) + defp update_visited(user, visited_pages) do changeset = user |> User.visited_changeset(%{visited_pages: visited_pages}) @@ -534,12 +534,16 @@ defmodule Systems.Account.Public do |> Repo.transaction() end - def visited?(user, page) when is_atom(page), do: visited?(user, Atom.to_string(page)) - def visited?(%User{visited_pages: nil}, _page), do: false + def visited?(%User{visited_pages: nil}, _page_key), do: false - def visited?(%User{visited_pages: visited_pages}, page) do - Enum.member?(visited_pages, page) + def visited?(%User{visited_pages: visited_pages}, page_key) when is_binary(page_key) do + Enum.member?(visited_pages, page_key) end + + def visited?(user, page), do: visited?(user, page_key(page)) + + defp page_key(page) when is_atom(page), do: Atom.to_string(page) + defp page_key({page, id}) when is_atom(page) and is_integer(id), do: "#{page}_#{id}" end defimpl Core.Persister, for: Systems.Account.UserProfileEditModel do diff --git a/core/systems/alliance/callback_page.ex b/core/systems/alliance/callback_page.ex index 2e559adca6..5ee2ce3b30 100644 --- a/core/systems/alliance/callback_page.ex +++ b/core/systems/alliance/callback_page.ex @@ -43,7 +43,7 @@ defmodule Systems.Alliance.CallbackPage do defp activate_participant_task( %{assigns: %{vm: %{state: :participant}, model: model, current_user: user}} = socket ) do - Assignment.Public.activate_task(model, user) + Assignment.Public.complete_task(model, user) socket end diff --git a/core/systems/assignment/_director.ex b/core/systems/assignment/_director.ex index 216fd10d86..afb918c988 100644 --- a/core/systems/assignment/_director.ex +++ b/core/systems/assignment/_director.ex @@ -5,12 +5,12 @@ defmodule Systems.Assignment.Director do alias Systems.Workflow # @impl true - # def apply_member_and_activate_task(tool, user) do + # def apply_member_and_complete_task(tool, user) do # identifier = Assignment.Private.task_identifier(tool, user) # assignment = Assignment.Public.get_by_tool(tool, Assignment.Model.preload_graph(:down)) # reward_value = Directable.director(assignment).reward_value(assignment) - # Assignment.Public.apply_member_and_activate_task(assignment, user, identifier, reward_value) + # Assignment.Public.apply_member_and_complete_task(assignment, user, identifier, reward_value) # end @impl true diff --git a/core/systems/assignment/_public.ex b/core/systems/assignment/_public.ex index 3e3c4729d7..eb04d2750a 100644 --- a/core/systems/assignment/_public.ex +++ b/core/systems/assignment/_public.ex @@ -506,7 +506,7 @@ defmodule Systems.Assignment.Public do end end - # def apply_member_and_activate_task( + # def apply_member_and_complete_task( # %Assignment.Model{crew: crew} = assignment, # %User{} = user, # identifier, @@ -517,15 +517,15 @@ defmodule Systems.Assignment.Public do # apply_member(assignment, user, identifier, reward_amount) # end - # activate_task(crew, identifier) + # complete_task(crew, identifier) # end - def activate_task(%Assignment.Model{crew: crew}, [_ | _] = identifier), - do: activate_task(crew, identifier) + def complete_task(%Assignment.Model{crew: crew}, [_ | _] = identifier), + do: complete_task(crew, identifier) - def activate_task(%Crew.Model{} = crew, [_ | _] = identifier) do + def complete_task(%Crew.Model{} = crew, [_ | _] = identifier) do Crew.Public.get_task(crew, identifier) - |> Crew.Public.activate_task!() + |> Crew.Public.complete_task!() end @doc """ diff --git a/core/systems/assignment/controller.ex b/core/systems/assignment/controller.ex index d6868cc1e5..8323cbfc82 100644 --- a/core/systems/assignment/controller.ex +++ b/core/systems/assignment/controller.ex @@ -14,7 +14,7 @@ defmodule Systems.Assignment.Controller do Crew.Public.get_member(crew, user) |> then(&Assignment.Private.task_identifier(assignment, item, &1)) |> then(&Crew.Public.get_task(crew, &1)) - |> Crew.Public.activate_task!() + |> Crew.Public.complete_task!() conn |> redirect(to: ~p"/assignment/#{id}") diff --git a/core/systems/assignment/crew_page_builder.ex b/core/systems/assignment/crew_page_builder.ex index fe57e437a2..ab1ee78554 100644 --- a/core/systems/assignment/crew_page_builder.ex +++ b/core/systems/assignment/crew_page_builder.ex @@ -5,7 +5,8 @@ defmodule Systems.Assignment.CrewPageBuilder do Assignment, Crew, Workflow, - Consent + Consent, + Account } def view_model(%{crew: crew} = assignment, %{current_user: user} = assigns) do @@ -48,16 +49,20 @@ defmodule Systems.Assignment.CrewPageBuilder do defp current_flow(%{fabric: %{children: children}}), do: children defp intro_view( - %{page_refs: page_refs}, - %{fabric: fabric} + %{id: assignment_id, page_refs: page_refs}, + %{current_user: user, fabric: fabric} ) do - if intro_page_ref = Enum.find(page_refs, &(&1.key == :assignment_information)) do + visited? = Account.Public.visited?(user, {:assignment_information, assignment_id}) + intro_page_ref = Enum.find(page_refs, &(&1.key == :assignment_information)) + + if is_nil(intro_page_ref) or visited? do + nil + else Fabric.prepare_child(fabric, :onboarding_view_intro, Assignment.OnboardingView, %{ page_ref: intro_page_ref, - title: dgettext("eyra-assignment", "onboarding.intro.title") + title: dgettext("eyra-assignment", "onboarding.intro.title"), + user: user }) - else - nil end end diff --git a/core/systems/assignment/crew_work_view.ex b/core/systems/assignment/crew_work_view.ex index af16438b65..ba5a7edc70 100644 --- a/core/systems/assignment/crew_work_view.ex +++ b/core/systems/assignment/crew_work_view.ex @@ -33,6 +33,7 @@ defmodule Systems.Assignment.CrewWorkView do ) do tool_started = Map.get(socket.assigns, :tool_started, false) tool_initialized = Map.get(socket.assigns, :tool_initialized, false) + first_time? = not Map.has_key?(socket.assigns, :work_items) { :ok, @@ -60,6 +61,7 @@ defmodule Systems.Assignment.CrewWorkView do |> compose_child(:context_menu) |> update_tool_ref_view() |> update_child(:finished_view) + |> handle_finished_state(first_time?) } end @@ -449,7 +451,7 @@ defmodule Systems.Assignment.CrewWorkView do end defp handle_complete_task(%{assigns: %{selected_item: {_, task}}} = socket) do - {:ok, %{crew_task: updated_task}} = Crew.Public.activate_task(task) + {:ok, %{crew_task: updated_task}} = Crew.Public.complete_task(task) socket |> update_task(updated_task) @@ -503,13 +505,17 @@ defmodule Systems.Assignment.CrewWorkView do socket |> assign(selected_item_id: selected_item_id) end - defp handle_finished_state(%{assigns: %{panel_info: %{embedded?: true}}} = socket) do - # Dont show finished view when embedded in external panel UI + defp handle_finished_state(socket, false) do + # Dont show finished view after first load socket end - defp handle_finished_state(%{assigns: %{tasks_finished: true}} = socket) do - # Dont show finished view when task are already finished + defp handle_finished_state(socket, true) do + handle_finished_state(socket) + end + + defp handle_finished_state(%{assigns: %{panel_info: %{embedded?: true}}} = socket) do + # Dont show finished view when embedded in external panel UI socket end diff --git a/core/systems/assignment/onboarding_view.ex b/core/systems/assignment/onboarding_view.ex index 62ee5e2f5a..83748a7ecc 100644 --- a/core/systems/assignment/onboarding_view.ex +++ b/core/systems/assignment/onboarding_view.ex @@ -3,15 +3,17 @@ defmodule Systems.Assignment.OnboardingView do alias Systems.Assignment alias Systems.Content + alias Systems.Account @impl true - def update(%{page_ref: page_ref, title: title}, socket) do + def update(%{user: user, page_ref: page_ref, title: title}, socket) do { :ok, socket |> assign( page_ref: page_ref, - title: title + title: title, + user: user ) |> compose_child(:content_page) |> compose_element(:continue_button) @@ -42,7 +44,13 @@ defmodule Systems.Assignment.OnboardingView do end @impl true - def handle_event("continue", _payload, socket) do + def handle_event( + "continue", + _payload, + %{assigns: %{user: user, page_ref: %{key: key, assignment_id: assignment_id}}} = socket + ) do + Account.Public.mark_as_visited(user, {key, assignment_id}) + { :noreply, socket |> send_event(:parent, "continue") diff --git a/core/systems/assignment/template_questionnaire.ex b/core/systems/assignment/template_questionnaire.ex index 7ef939c276..29d70f432e 100644 --- a/core/systems/assignment/template_questionnaire.ex +++ b/core/systems/assignment/template_questionnaire.ex @@ -41,7 +41,7 @@ defmodule Systems.Assignment.TemplateQuestionnaire do } ] }, - initial_items: [:questionnaire] + initial_items: [] } end end diff --git a/core/systems/crew/_public.ex b/core/systems/crew/_public.ex index afde8270b8..da300d69bd 100644 --- a/core/systems/crew/_public.ex +++ b/core/systems/crew/_public.ex @@ -154,7 +154,7 @@ defmodule Systems.Crew.Public do update_task(task, %{started_at: Timestamp.naive_now()}, :locked) end - def activate_task(%Crew.TaskModel{status: status, started_at: started_at} = task) do + def complete_task(%Crew.TaskModel{status: status, started_at: started_at} = task) do timestamp = Timestamp.naive_now() case status do @@ -180,8 +180,8 @@ defmodule Systems.Crew.Public do end end - def activate_task!(%Crew.TaskModel{} = task) do - case Crew.Public.activate_task(task) do + def complete_task!(%Crew.TaskModel{} = task) do + case Crew.Public.complete_task(task) do {:ok, %{crew_task: task}} -> task _ -> nil end diff --git a/core/test/core_web/controllers/user_session_controller_test.exs b/core/test/core_web/controllers/user_session_controller_test.exs index 24305dc25b..02dc96a60a 100644 --- a/core/test/core_web/controllers/user_session_controller_test.exs +++ b/core/test/core_web/controllers/user_session_controller_test.exs @@ -42,7 +42,7 @@ defmodule Systems.Account.UserSessionControllerTest do conn = get(conn, "/") response = html_response(conn, 200) - assert response =~ "My homepage" + assert response =~ "My home" end test "logs the user in with remember me", %{conn: conn, user: user, password: password} do diff --git a/core/test/systems/crew/_public_test.exs b/core/test/systems/crew/_public_test.exs index 4e9ccc4ae5..fd0f65831a 100644 --- a/core/test/systems/crew/_public_test.exs +++ b/core/test/systems/crew/_public_test.exs @@ -658,7 +658,7 @@ defmodule Systems.Crew.PublicTest do }) assert Crew.Public.count_tasks(crew, [:completed]) == 0 - assert %{status: :completed} = Crew.Public.activate_task!(task) + assert %{status: :completed} = Crew.Public.complete_task!(task) assert Crew.Public.count_tasks(crew, [:completed]) == 1 end @@ -681,7 +681,7 @@ defmodule Systems.Crew.PublicTest do assert Crew.Public.count_tasks(crew, [:completed]) == 0 {:ok, %{crew_task: task}} = Crew.Public.accept_task(task) - assert %{status: :accepted} = Crew.Public.activate_task!(task) + assert %{status: :accepted} = Crew.Public.complete_task!(task) assert Crew.Public.count_tasks(crew, [:completed]) == 0 end @@ -710,7 +710,7 @@ defmodule Systems.Crew.PublicTest do message: "rejection message" }) - assert %{status: :rejected} = Crew.Public.activate_task!(task) + assert %{status: :rejected} = Crew.Public.complete_task!(task) assert Crew.Public.count_tasks(crew, [:completed]) == 0 end