From 5ac7231be91b111f2f1e59e70fb2120bf015f190 Mon Sep 17 00:00:00 2001 From: samuelgfeller Date: Wed, 15 May 2024 18:08:23 +0200 Subject: [PATCH] Updated assets to v1.0.0 and minor divers corrections [SLE-192] --- .github/workflows/build.yml | 3 +- README.md | 94 ++++++++++--------- composer.json | 4 +- config/defaults.php | 2 +- public/assets/authentication/login-main.js | 2 +- public/assets/authentication/login.css | 1 + .../authentication/password-reset-main.js | 2 +- .../password-strength-checker.js | 6 +- .../client/create/client-create-main.js | 14 +-- .../client/create/client-create-modal.html.js | 12 +-- .../assets/client/list/client-list-loading.js | 12 +-- public/assets/client/list/client-list-main.js | 4 +- .../list/client-list-profile-card.html.js | 6 +- .../list/client-list-skeleton-loader.js | 2 +- .../client/note/client-read-create-note.js | 8 +- .../client/note/client-read-delete-note.js | 4 +- .../client-read-note-event-listener-setup.js | 10 +- .../client/note/client-read-note-loading.js | 16 ++-- .../note/client-read-note-skeleton-loader.js | 2 +- .../note/client-read-save-existing-note.js | 6 +- .../note/client-read-template-note.html.js | 2 +- public/assets/client/read/client-read-main.js | 20 ++-- .../update/client-update-contenteditable.js | 8 +- .../client/update/client-update-dropdown.js | 4 +- public/assets/dashboard/dashboard-main.js | 10 +- .../general/ajax/ajax-util/fail-handler.js | 8 +- public/assets/general/ajax/fetch-data.js | 4 +- .../general/ajax/fetch-translation-data.js | 2 +- .../general/ajax/modal-submit-request.js | 8 +- .../general/ajax/submit-delete-request.js | 4 +- .../assets/general/ajax/submit-update-data.js | 4 +- public/assets/general/dark-mode/dark-mode.js | 4 +- .../open-link-on-html-element.js | 2 +- .../general/general-js/initialization.js | 8 +- .../contenteditable/contenteditable-main.js | 6 +- .../page-component/modal/alert-modal.js | 4 +- .../page-component/modal/dropdown-request.js | 4 +- .../assets/general/template/template-util.js | 2 +- public/assets/user/create/user-create-main.js | 12 +-- .../user/create/user-create-modal.html.js | 14 +-- .../user/list/user-list-card-dom-appending.js | 2 +- .../assets/user/list/user-list-card.html.js | 4 +- public/assets/user/list/user-list-loading.js | 12 +-- public/assets/user/list/user-list-main.js | 2 +- .../user/list/user-list-skeleton-loader.js | 2 +- .../user/read/user-activity/activity-main.js | 6 +- .../assets/user/read/user-read-update-main.js | 20 ++-- .../user/read/user-update-contenteditable.js | 6 +- .../user/update/change-password-modal.html.js | 8 +- .../ClientPermissionVerifier.php | 3 +- .../ClientPrivilegeDeterminer.php | 2 +- .../email/de/password-reset.email.php | 4 +- .../email/fr/password-reset.email.php | 5 +- .../authentication/reset-password.html.php | 11 ++- templates/client/client-read.html.php | 2 +- tests/Trait/AppTestTrait.php | 1 + 56 files changed, 221 insertions(+), 209 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a7e95d7..6d82fced 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ jobs: operating-system: [ ubuntu-latest ] php-versions: [ '8.2' ] test-database: [ 'slim_example_project_test' ] + sql-time-zone: [ 'Europe/Zurich' ] name: PHP ${{ matrix.php-versions }} Test services: @@ -61,7 +62,7 @@ jobs: run: mysql -uroot -proot -e "SHOW VARIABLES LIKE 'version%';" - name: Set MySQL timezone to swiss time - run: mysql -uroot -proot -e "SET GLOBAL time_zone = '+01:00';" + run: mysql -uroot -proot -e "SET GLOBAL time_zone = '${{ matrix.sql-time-zone }}';" - name: Create database run: mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS ${{ matrix.test-database }} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' diff --git a/README.md b/README.md index 4f944c7e..5e2f4216 100644 --- a/README.md +++ b/README.md @@ -7,31 +7,32 @@ [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) Real-world example of a modern [Slim 4](https://www.slimframework.com/) web application with a scalable -structure and a variety of components and features to get started quickly. - -This project showcases the implementation of a simple yet robust -[architecture](https://github.com/samuelgfeller/slim-example-project/wiki/Architecture) -with a variety of backend and -frontend features built using the Slim 4 micro-framework. -The base for this project was the official -[Slim-Skeleton](https://github.com/slimphp/Slim-Skeleton) and Odan's [slim4-skeleton](https://github.com/odan/slim4-skeleton). +structure and a variety of components and features. +Current best practices and programming principles are applied throughout the project and +adhering to the Single Responsibility Principle +([SRP](https://github.com/samuelgfeller/slim-example-project/wiki/Single-Responsibility-Principle-(SRP))) +is a key focus. External library dependencies are [kept to a minimum](https://github.com/samuelgfeller/slim-example-project/wiki/Libraries-and-Framework) to facilitate maintenance and ensure long-term viability. -Current best practices and modern principles are applied throughout the project. -Extra care was taken to follow the -Single Responsibility Principle ([SRP](https://github.com/samuelgfeller/slim-example-project/wiki/Single-Responsibility-Principle-(SRP))). +The [architecture](https://github.com/samuelgfeller/slim-example-project/wiki/Architecture) +is inspired by the Domain Driven Design ([DDD](https://en.wikipedia.org/wiki/Domain-driven_design)) +and the [Vertical Slice Architecture](https://www.youtube.com/watch?v=L2Wnq0ChAIA). -A detailed [**documentation**](https://github.com/samuelgfeller/slim-example-project/wiki) explains the project structure, components, design choices and features. +The base for this project was the official +[Slim-Skeleton](https://github.com/slimphp/Slim-Skeleton) and the [slim4-skeleton](https://github.com/odan/slim4-skeleton). -Please read the [**installation guide**](https://github.com/samuelgfeller/slim-example-project/wiki/Installation-Guide) -to get started. +A detailed [**documentation**](https://github.com/samuelgfeller/slim-example-project/wiki) explains how the project is built, +components, design choices and features. Stripped down versions of this repository are available as skeleton templates. -With frontend [slim-starter](https://github.com/samuelgfeller/slim-starter) or just for an API: -[slim-api-starter](https://github.com/samuelgfeller/slim-api-starter). +With frontend [**slim-starter**](https://github.com/samuelgfeller/slim-starter) or just for an API: +[**slim-api-starter**](https://github.com/samuelgfeller/slim-api-starter). + +Please read the [**installation guide**](https://github.com/samuelgfeller/slim-example-project/wiki/Installation-Guide) +to get started. ## Features All the features were developed with an effort to ensure maximum user-friendliness. @@ -41,33 +42,32 @@ The backend, efficient and secure. This project is currently designed for non-profit organizations or foundations that require a platform to manage and maintain a record of communication through notes of people they help. -**Project components:** +**Technologies:** -* [Dependency Injection](https://github.com/samuelgfeller/slim-example-project/wiki/Dependency-Injection) +* [Slim 4 micro-framework](https://github.com/slimphp/Slim) +* [Dependency Injection](https://github.com/samuelgfeller/slim-example-project/wiki/Dependency-Injection) - [PHP-DI](https://php-di.org/) * [Session and flash messages](https://github.com/samuelgfeller/slim-example-project/wiki/Session-and-Flash-messages) +* [Template rendering](https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering) - [PHP-View](https://github.com/slimphp/PHP-View) +* [Logging](https://github.com/samuelgfeller/slim-example-project/wiki/Logging) - [Monolog](https://github.com/Seldaek/monolog) +* [Database migrations](https://github.com/samuelgfeller/slim-example-project/wiki/Database-Migrations) - [Phinx](https://phinx.org/) +* [Validation](https://github.com/samuelgfeller/slim-example-project/wiki/Validation) - [cakephp/validation](https://book.cakephp.org/4/en/core-libraries/validation.html) +* [Mailing](https://github.com/samuelgfeller/slim-example-project/wiki/Mailing) - [Symfony Mailer](https://symfony.com/doc/current/mailer.html) +* [Localization](https://github.com/samuelgfeller/slim-example-project/wiki/Translations) - [gettext](https://www.gnu.org/software/gettext/) +* [Query Builder](https://github.com/samuelgfeller/slim-example-project/wiki/Repository-and-Query-Builder) - [cakephp/database](https://book.cakephp.org/5/en/orm/query-builder.html) +* [Integration / unit testing](https://github.com/samuelgfeller/slim-example-project/wiki/Writing-Tests) - [PHPUnit](https://github.com/sebastianbergmann/phpunit/) - [test-traits](https://github.com/samuelgfeller/test-traits) +* [Error handling](https://github.com/samuelgfeller/slim-example-project/wiki/Error-Handling) - [slim-error-renderer](https://github.com/samuelgfeller/slim-error-renderer) +* [GitHub Actions](https://github.com/samuelgfeller/slim-example-project/wiki/GitHub-Actions) and [Scrutinizer](https://github.com/samuelgfeller/slim-example-project/wiki/How-to-set-up-Scrutinizer) +* [Coding standards fixer](https://github.com/samuelgfeller/slim-example-project/wiki/Coding-Standards-Fixer) - [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) +* [Static code analysis](https://github.com/samuelgfeller/slim-example-project/wiki/PHPStan-Static-Code-Analysis) - [PHPStan](https://github.com/phpstan/phpstan) + +**Functionalities demonstrating real-world features:** + * [Authentication](https://github.com/samuelgfeller/slim-example-project/wiki/Authentication) (login) and [authorization](https://github.com/samuelgfeller/slim-example-project/wiki/Authorization) (permissions) * Account verification and [password reset](https://github.com/samuelgfeller/slim-example-project/wiki/Authentication#password-forgotten) via email link and token * [Request throttling](https://github.com/samuelgfeller/slim-example-project/wiki/Security#request-throttling) - - protection against rapid fire and distributed brute force attacks (time throttling and captcha) -* [Localization](https://github.com/samuelgfeller/slim-example-project/wiki/Translations) - English, German and French -* [Validation](https://github.com/samuelgfeller/slim-example-project/wiki/Validation) -* [Template rendering](https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering) with native PHP syntax (easily interchangeable with twig) -* [Dark theme](https://github.com/samuelgfeller/slim-example-project/wiki/Dark-Theme) -* [Advanced error handling](https://github.com/samuelgfeller/slim-example-project/wiki/Error-Handling) -* [Integration & unit testing](https://github.com/samuelgfeller/slim-example-project/wiki/Writing-Tests) - with fixtures and data providers -* [Database migrations](https://github.com/samuelgfeller/slim-example-project/wiki/Database-Migrations) and [seeding](https://github.com/samuelgfeller/slim-example-project/wiki/Database-Migrations#seeding) -* [Query Builder](https://github.com/samuelgfeller/slim-example-project/wiki/Repository-and-Query-Builder) -* [Logging](https://github.com/samuelgfeller/slim-example-project/wiki/Logging) -* [Mailing](https://github.com/samuelgfeller/slim-example-project/wiki/Mailing) -* [Simple console commands](https://github.com/samuelgfeller/slim-example-project/wiki/Console-Commands) -* [Scrutinizer](https://github.com/samuelgfeller/slim-example-project/wiki/How-to-set-up-Scrutinizer) -* [GitHub Actions](https://github.com/samuelgfeller/slim-example-project/wiki/GitHub-Actions) - -**Functionalities demonstrating real-world features:** - + protection against brute force and password spraying attacks * User management for administrators * 4 user roles and different permissions * User activity history @@ -76,6 +76,7 @@ to manage and maintain a record of communication through notes of people they he * Note creation and mutation * Hidden notes from unauthorized users * Dashboard with panels +* [Dark / light theme](https://github.com/samuelgfeller/slim-example-project/wiki/Dark-Theme)
@@ -85,7 +86,7 @@ to manage and maintain a record of communication through notes of people they he Link: [Login](https://demo.slim-example-project.samuel-gfeller.ch) Username: `admin@user.com` Password: `12345678` -The database is reset regularly. +The database is regularly reset.
@@ -120,16 +121,16 @@ implementations of features. However, I find them often too complex, where the code makes too much "behind the scenes" and with lots of dependencies, which can lead to time-consuming refactoring on version changes. -I also dislike having to follow the propitiatory rules of a framework and +I also dislike having to follow the propitiatory rules of a framework [which often don't +follow best practices](https://www.reddit.com/r/PHP/comments/131t2k1/laravel_considered_harmful) +and much prefer the freedom of a micro-framework and carefully -[choosing the libraries](https://github.com/samuelgfeller/slim-example-project/wiki/Libraries-and-Framework#choosing-the-right-libraries) -I want to use. +[choosing the libraries](https://github.com/samuelgfeller/slim-example-project/wiki/Libraries-and-Framework#choosing-the-right-libraries) and structure +that make sense for the project. This lets me stay in control of the codebase, keep it lightweight, performant and tailored to the needs of the project, and it's easier to maintain and adapt to new requirements. -You can very well adapt it to your own needs as well, remove or add features, and change the libraries. - ## Disclaimer This project and its documentation are the result of my personal learning process in the last 6 years in trying to create the best possible template app with lots of real world examples. @@ -139,13 +140,14 @@ I made what wish I had when I started getting seriously into web development. The codebase is big and thus lots of subjective decisions had to be made that may not be the best long-term solution for everybody. -The main focus throughout the development was to make the code as dependency free as possible -so that it's long living and can be adapted to different needs and preferences. +The main focus throughout the development was to make the code as long living as possible +with best practices and few dependencies so that it can be adapted to different needs and +preferences. -Basically, this is my take on what a modern and efficient web app could look like with today's +Basically, this is my take on what an efficient, extensible, and maintainable web app could look like with today's tech. -I worked closely with the software architect +I worked closely with the software engineer and architect [Daniel Opitz](https://odan.github.io/about.html), who also reviewed this project. I learned a lot during [our exchanges](https://github.com/samuelgfeller/slim-example-project/wiki/Sources-of-knowledge#discussions) diff --git a/composer.json b/composer.json index 617ac4d2..76bd8869 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ "@add-migrations-to-git" ], "add-migrations-to-git": "git add resources/migrations/* && git add resources/schema/*", - "seed:minimal": "php vendor/bin/phinx seed:run -c config/env/env.phinx.php -s ClientStatusSeeder -s UserRoleSeeder -s AdminUserSeeder", - "seed": "php vendor/bin/phinx seed:run -c config/env/env.phinx.php" + "seed": "php vendor/bin/phinx seed:run -c config/env/env.phinx.php -s ClientStatusSeeder -s UserRoleSeeder -s AdminUserSeeder", + "seed:extended": "php vendor/bin/phinx seed:run -c config/env/env.phinx.php" } } diff --git a/config/defaults.php b/config/defaults.php index 57d5fc41..f4e21729 100644 --- a/config/defaults.php +++ b/config/defaults.php @@ -36,7 +36,7 @@ $settings['deployment'] = [ // Version string or null. If JsImportCacheBuster is enabled, `null` removes all query param versions from js // imports. - 'version' => '0.4.2', + 'version' => '1.0.0', // When true, JsImportCacheBuster is enabled and goes through all js files and changes the version number // from the imports. Should be disabled in env.prod.php. // https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering#js-import-cache-busting diff --git a/public/assets/authentication/login-main.js b/public/assets/authentication/login-main.js index fde4a4cd..30c1875e 100644 --- a/public/assets/authentication/login-main.js +++ b/public/assets/authentication/login-main.js @@ -1,4 +1,4 @@ -import {removeValidationErrorMessages} from "../general/ajax/ajax-util/fail-handler.js?v=0.4.2"; +import {removeValidationErrorMessages} from "../general/ajax/ajax-util/fail-handler.js?v=1.0.0"; const passwordForgottenBtn = document.getElementById('password-forgotten-btn'); const passwordInputDiv = document.getElementById('password-input-div'); diff --git a/public/assets/authentication/login.css b/public/assets/authentication/login.css index c6251cc8..8ff8e9f3 100644 --- a/public/assets/authentication/login.css +++ b/public/assets/authentication/login.css @@ -7,6 +7,7 @@ background: linear-gradient(to bottom right, #1dc6fd 0%, #e589b7 90%); padding: 0 10px; /*background: linear-gradient(to top left, #2e3e50 20%, #ffffff 100%);*/ + /*background: linear-gradient(to top left, #2e3e50 45%, #ffffff 45%);*/ } h2 { diff --git a/public/assets/authentication/password-reset-main.js b/public/assets/authentication/password-reset-main.js index e1390a0c..e2c30b46 100644 --- a/public/assets/authentication/password-reset-main.js +++ b/public/assets/authentication/password-reset-main.js @@ -1,4 +1,4 @@ -import {addPasswordStrengthCheck} from "./password-strength-checker.js?v=0.4.2"; +import {addPasswordStrengthCheck} from "./password-strength-checker.js?v=1.0.0"; addPasswordStrengthCheck(); diff --git a/public/assets/authentication/password-strength-checker.js b/public/assets/authentication/password-strength-checker.js index 603f5f5b..1c331e72 100644 --- a/public/assets/authentication/password-strength-checker.js +++ b/public/assets/authentication/password-strength-checker.js @@ -1,6 +1,6 @@ -import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=0.4.2"; -import {fetchTranslations} from "../general/ajax/fetch-translation-data.js?v=0.4.2"; -import {__} from "../general/general-js/functions.js?v=0.4.2"; +import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=1.0.0"; +import {fetchTranslations} from "../general/ajax/fetch-translation-data.js?v=1.0.0"; +import {__} from "../general/general-js/functions.js?v=1.0.0"; // Init vars let password1Input, password2Inp; diff --git a/public/assets/client/create/client-create-main.js b/public/assets/client/create/client-create-main.js index 1c4858ca..8267ef7d 100644 --- a/public/assets/client/create/client-create-main.js +++ b/public/assets/client/create/client-create-main.js @@ -1,10 +1,10 @@ -import {displayClientCreateModal} from "./client-create-modal.html.js?v=0.4.2"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.2"; -import {displayValidationErrorMessage} from "../../general/validation/form-validation.js?v=0.4.2"; -import {fetchAndLoadClients} from "../list/client-list-loading.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; -import {submitModalForm} from "../../general/ajax/modal-submit-request.js?v=0.4.2"; +import {displayClientCreateModal} from "./client-create-modal.html.js?v=1.0.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=1.0.0"; +import {displayValidationErrorMessage} from "../../general/validation/form-validation.js?v=1.0.0"; +import {fetchAndLoadClients} from "../list/client-list-loading.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; +import {submitModalForm} from "../../general/ajax/modal-submit-request.js?v=1.0.0"; // Init event listeners if button is present document.getElementById('create-client-btn')?.addEventListener('click', displayClientCreateModal); diff --git a/public/assets/client/create/client-create-modal.html.js b/public/assets/client/create/client-create-modal.html.js index 43477f8e..9a102bcb 100644 --- a/public/assets/client/create/client-create-modal.html.js +++ b/public/assets/client/create/client-create-modal.html.js @@ -1,9 +1,9 @@ -import {createModal} from "../../general/page-component/modal/modal.js?v=0.4.2"; -import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.4.2"; -import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.4.2"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; +import {createModal} from "../../general/page-component/modal/modal.js?v=1.0.0"; +import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=1.0.0"; +import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=1.0.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; // List of words that are used in modal box and need to be translated let wordsToTranslate = [ diff --git a/public/assets/client/list/client-list-loading.js b/public/assets/client/list/client-list-loading.js index c1cba185..9439e5f1 100644 --- a/public/assets/client/list/client-list-loading.js +++ b/public/assets/client/list/client-list-loading.js @@ -1,17 +1,17 @@ -import {getClientProfileCardHtml} from "./client-list-profile-card.html.js?v=0.4.2"; +import {getClientProfileCardHtml} from "./client-list-profile-card.html.js?v=1.0.0"; import { displayClientProfileCardSkeletonLoader, removeClientCardSkeletonLoader -} from "./client-list-skeleton-loader.js?v=0.4.2"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.4.2"; +} from "./client-list-skeleton-loader.js?v=1.0.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=1.0.0"; import { disableMouseWheelClickScrolling, openLinkOnHtmlElement -} from "../../general/event-handler/open-link-on-html-element.js?v=0.4.2"; +} from "../../general/event-handler/open-link-on-html-element.js?v=1.0.0"; import { triggerClickOnHtmlElementEnterKeypress -} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; +} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; // When searching clients, a request is made on each keyup and only the final result should be shown to the user, // not a response from a previous request. diff --git a/public/assets/client/list/client-list-main.js b/public/assets/client/list/client-list-main.js index bf7c201d..def05ef8 100644 --- a/public/assets/client/list/client-list-main.js +++ b/public/assets/client/list/client-list-main.js @@ -1,5 +1,5 @@ -import {fetchAndLoadClients, fetchAndLoadClientsEventHandler} from "./client-list-loading.js?v=0.4.2"; -import {initFilterChipEventListeners} from "../../general/page-component/filter-chip/filter-chip.js?v=0.4.2"; +import {fetchAndLoadClients, fetchAndLoadClientsEventHandler} from "./client-list-loading.js?v=1.0.0"; +import {initFilterChipEventListeners} from "../../general/page-component/filter-chip/filter-chip.js?v=1.0.0"; // Load clients at page startup fetchAndLoadClients(); diff --git a/public/assets/client/list/client-list-profile-card.html.js b/public/assets/client/list/client-list-profile-card.html.js index 475a7c6e..18c91967 100644 --- a/public/assets/client/list/client-list-profile-card.html.js +++ b/public/assets/client/list/client-list-profile-card.html.js @@ -1,6 +1,6 @@ -import {getAvatarPath} from "../util/client-template-util.js?v=0.4.2"; -import {html} from "../../general/general-js/functions.js?v=0.4.2"; -import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.4.2"; +import {getAvatarPath} from "../util/client-template-util.js?v=1.0.0"; +import {html} from "../../general/general-js/functions.js?v=1.0.0"; +import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=1.0.0"; /** * HTML code for client profile card diff --git a/public/assets/client/list/client-list-skeleton-loader.js b/public/assets/client/list/client-list-skeleton-loader.js index 5e032d44..953e6db7 100644 --- a/public/assets/client/list/client-list-skeleton-loader.js +++ b/public/assets/client/list/client-list-skeleton-loader.js @@ -1,4 +1,4 @@ -import {getClientProfileCardSkeletonLoaderHtml} from "./client-list-profile-card.html.js?v=0.4.2"; +import {getClientProfileCardSkeletonLoaderHtml} from "./client-list-profile-card.html.js?v=1.0.0"; /** * Display client skeleton loaders diff --git a/public/assets/client/note/client-read-create-note.js b/public/assets/client/note/client-read-create-note.js index 5ef3e189..347de8d4 100644 --- a/public/assets/client/note/client-read-create-note.js +++ b/public/assets/client/note/client-read-create-note.js @@ -1,15 +1,15 @@ -import {basePath} from "../../general/general-js/config.js?v=0.4.2"; +import {basePath} from "../../general/general-js/config.js?v=1.0.0"; import { addDeleteNoteBtnEventListener, addHideNoteBtnEventListener, addTextareaInputEventListener, hideCheckmarkLoader, toggleReadOnlyAndBtnAboveNote -} from "./client-read-note-event-listener-setup.js?v=0.4.2"; -import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.2"; +} from "./client-read-note-event-listener-setup.js?v=1.0.0"; +import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=1.0.0"; import { initAutoResizingTextareaElements -} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.4.2"; +} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=1.0.0"; let noteCreationHideCheckMarkTimeout = []; diff --git a/public/assets/client/note/client-read-delete-note.js b/public/assets/client/note/client-read-delete-note.js index 9e22f046..2b9813ea 100644 --- a/public/assets/client/note/client-read-delete-note.js +++ b/public/assets/client/note/client-read-delete-note.js @@ -4,8 +4,8 @@ * @param noteId * @param noteContainer */ -import {hideCheckmarkLoader} from "./client-read-note-event-listener-setup.js?v=0.4.2"; -import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.4.2"; +import {hideCheckmarkLoader} from "./client-read-note-event-listener-setup.js?v=1.0.0"; +import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=1.0.0"; /** * Make ajax delete request diff --git a/public/assets/client/note/client-read-note-event-listener-setup.js b/public/assets/client/note/client-read-note-event-listener-setup.js index 0e7f7838..8f398212 100644 --- a/public/assets/client/note/client-read-note-event-listener-setup.js +++ b/public/assets/client/note/client-read-note-event-listener-setup.js @@ -1,8 +1,8 @@ -import {disableHideCheckMarkTimeoutOnUpdate, saveNoteChangeToDb} from "./client-read-save-existing-note.js?v=0.4.2"; -import {disableHideCheckMarkTimeoutOnCreation, insertNewNoteToDb} from "./client-read-create-note.js?v=0.4.2"; -import {makeDeleteNoteRequest} from "./client-read-delete-note.js?v=0.4.2"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; +import {disableHideCheckMarkTimeoutOnUpdate, saveNoteChangeToDb} from "./client-read-save-existing-note.js?v=1.0.0"; +import {disableHideCheckMarkTimeoutOnCreation, insertNewNoteToDb} from "./client-read-create-note.js?v=1.0.0"; +import {makeDeleteNoteRequest} from "./client-read-delete-note.js?v=1.0.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; // To display the checkmark loader only when the user expects that his content is saved we have to know if he/she is diff --git a/public/assets/client/note/client-read-note-loading.js b/public/assets/client/note/client-read-note-loading.js index 18ffcbc1..20fc4015 100644 --- a/public/assets/client/note/client-read-note-loading.js +++ b/public/assets/client/note/client-read-note-loading.js @@ -1,16 +1,16 @@ -import {getNoteHtml} from "./client-read-template-note.html.js?v=0.4.2"; +import {getNoteHtml} from "./client-read-template-note.html.js?v=1.0.0"; import { displayClientNoteSkeletonLoader, removeClientNoteSkeletonLoader -} from "./client-read-note-skeleton-loader.js?v=0.4.2"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.4.2"; -import {initNotesEventListeners} from "./client-read-note-event-listener-setup.js?v=0.4.2"; +} from "./client-read-note-skeleton-loader.js?v=1.0.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=1.0.0"; +import {initNotesEventListeners} from "./client-read-note-event-listener-setup.js?v=1.0.0"; import { initAutoResizingTextareaElements -} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.4.2"; -import {scrollToAnchor} from "../../general/page-behaviour/scroll-to-anchor.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; +} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=1.0.0"; +import {scrollToAnchor} from "../../general/page-behaviour/scroll-to-anchor.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; /** * Loading notes into dom diff --git a/public/assets/client/note/client-read-note-skeleton-loader.js b/public/assets/client/note/client-read-note-skeleton-loader.js index 67330232..772c5022 100644 --- a/public/assets/client/note/client-read-note-skeleton-loader.js +++ b/public/assets/client/note/client-read-note-skeleton-loader.js @@ -1,4 +1,4 @@ -import {getClientNoteSkeletonLoaderHtml} from "./client-read-template-note.html.js?v=0.4.2"; +import {getClientNoteSkeletonLoaderHtml} from "./client-read-template-note.html.js?v=1.0.0"; /** * Display client note skeleton loaders diff --git a/public/assets/client/note/client-read-save-existing-note.js b/public/assets/client/note/client-read-save-existing-note.js index 2defb666..0a9d2294 100644 --- a/public/assets/client/note/client-read-save-existing-note.js +++ b/public/assets/client/note/client-read-save-existing-note.js @@ -1,10 +1,10 @@ -import {basePath} from "../../general/general-js/config.js?v=0.4.2"; +import {basePath} from "../../general/general-js/config.js?v=1.0.0"; import { changeUserIsTyping, hideCheckmarkLoader, userIsTypingOnNoteId -} from "./client-read-note-event-listener-setup.js?v=0.4.2"; -import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.2"; +} from "./client-read-note-event-listener-setup.js?v=1.0.0"; +import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=1.0.0"; let noteSaveHideCheckMarkTimeout = []; diff --git a/public/assets/client/note/client-read-template-note.html.js b/public/assets/client/note/client-read-template-note.html.js index d8ee722c..a711499d 100644 --- a/public/assets/client/note/client-read-template-note.html.js +++ b/public/assets/client/note/client-read-template-note.html.js @@ -1,4 +1,4 @@ -import {html} from "../../general/general-js/functions.js?v=0.4.2"; +import {html} from "../../general/general-js/functions.js?v=1.0.0"; export function getNoteHtml(note) { // Thanks https://www.youtube.com/watch?v=Mus_vwhTCq0 for this syntax diff --git a/public/assets/client/read/client-read-main.js b/public/assets/client/read/client-read-main.js index e57e7c73..3da2d779 100644 --- a/public/assets/client/read/client-read-main.js +++ b/public/assets/client/read/client-read-main.js @@ -1,13 +1,13 @@ -import {loadAvailablePersonalInfoIconsDiv} from "./client-read-personal-info.js?v=0.4.2"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.4.2"; -import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; -import {fetchAndLoadClientNotes} from "../note/client-read-note-loading.js?v=0.4.2"; -import {addNewNoteTextarea} from "../note/client-read-create-note.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; -import {makeClientFieldEditable} from "../update/client-update-contenteditable.js?v=0.4.2"; -import {makeFieldSelectValueEditable} from "../update/client-update-dropdown.js?v=0.4.2"; +import {loadAvailablePersonalInfoIconsDiv} from "./client-read-personal-info.js?v=1.0.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=1.0.0"; +import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; +import {fetchAndLoadClientNotes} from "../note/client-read-note-loading.js?v=1.0.0"; +import {addNewNoteTextarea} from "../note/client-read-create-note.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; +import {makeClientFieldEditable} from "../update/client-update-contenteditable.js?v=1.0.0"; +import {makeFieldSelectValueEditable} from "../update/client-update-dropdown.js?v=1.0.0"; const clientId = document.getElementById('client-id').value; diff --git a/public/assets/client/update/client-update-contenteditable.js b/public/assets/client/update/client-update-contenteditable.js index fba264a7..4c3cf96f 100644 --- a/public/assets/client/update/client-update-contenteditable.js +++ b/public/assets/client/update/client-update-contenteditable.js @@ -2,14 +2,14 @@ import { addIconToAvailableDiv, removeIconFromAvailableDiv, showPersonalInfoContainerIfHidden -} from "../read/client-read-personal-info.js?v=0.4.2"; -import {removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.2"; +} from "../read/client-read-personal-info.js?v=1.0.0"; +import {removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=1.0.0"; import { contentEditableFieldValueIsValid, disableEditableField, makeFieldEditable -} from "../../general/page-component/contenteditable/contenteditable-main.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; +} from "../../general/page-component/contenteditable/contenteditable-main.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; function preventLinkOpening(e) { /* Prevent link from being opened */ diff --git a/public/assets/client/update/client-update-dropdown.js b/public/assets/client/update/client-update-dropdown.js index f24d8773..128da3cf 100644 --- a/public/assets/client/update/client-update-dropdown.js +++ b/public/assets/client/update/client-update-dropdown.js @@ -2,8 +2,8 @@ import { addIconToAvailableDiv, removeIconFromAvailableDiv, showPersonalInfoContainerIfHidden -} from "../read/client-read-personal-info.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; +} from "../read/client-read-personal-info.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; /** * Make personal info field editable by adding a dropdown diff --git a/public/assets/dashboard/dashboard-main.js b/public/assets/dashboard/dashboard-main.js index abfd0e6a..7a51bf26 100644 --- a/public/assets/dashboard/dashboard-main.js +++ b/public/assets/dashboard/dashboard-main.js @@ -1,8 +1,8 @@ -import {fetchAndLoadClients} from "../client/list/client-list-loading.js?v=0.4.2"; -import {fetchAndLoadClientNotes} from "../client/note/client-read-note-loading.js?v=0.4.2"; -import {initFilterChipEventListeners} from "../general/page-component/filter-chip/filter-chip.js?v=0.4.2"; -import {loadUserActivities} from "../user/read/user-activity/activity-main.js?v=0.4.2"; -import {submitUpdate} from "../general/ajax/submit-update-data.js?v=0.4.2"; +import {fetchAndLoadClients} from "../client/list/client-list-loading.js?v=1.0.0"; +import {fetchAndLoadClientNotes} from "../client/note/client-read-note-loading.js?v=1.0.0"; +import {initFilterChipEventListeners} from "../general/page-component/filter-chip/filter-chip.js?v=1.0.0"; +import {loadUserActivities} from "../user/read/user-activity/activity-main.js?v=1.0.0"; +import {submitUpdate} from "../general/ajax/submit-update-data.js?v=1.0.0"; // Toggle enable / disable panel const panelToggleButtons = document.getElementsByClassName('dashboard-panel-toggle-btn'); diff --git a/public/assets/general/ajax/ajax-util/fail-handler.js b/public/assets/general/ajax/ajax-util/fail-handler.js index a4abf039..f784c58d 100644 --- a/public/assets/general/ajax/ajax-util/fail-handler.js +++ b/public/assets/general/ajax/ajax-util/fail-handler.js @@ -1,7 +1,7 @@ -import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.4.2"; -import {displayFlashMessage} from "../../page-component/flash-message/flash-message.js?v=0.4.2"; -import {__} from "../../general-js/functions.js?v=0.4.2"; -import {fetchTranslations} from "../fetch-translation-data.js?v=0.4.2"; +import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=1.0.0"; +import {displayFlashMessage} from "../../page-component/flash-message/flash-message.js?v=1.0.0"; +import {__} from "../../general-js/functions.js?v=1.0.0"; +import {fetchTranslations} from "../fetch-translation-data.js?v=1.0.0"; // List of words that are used in modal box and need to be translated let wordsToTranslate = [ diff --git a/public/assets/general/ajax/fetch-data.js b/public/assets/general/ajax/fetch-data.js index 1c98b782..c1ec0f01 100644 --- a/public/assets/general/ajax/fetch-data.js +++ b/public/assets/general/ajax/fetch-data.js @@ -1,5 +1,5 @@ -import {basePath} from "../general-js/config.js?v=0.4.2"; -import {handleFail} from "./ajax-util/fail-handler.js?v=0.4.2"; +import {basePath} from "../general-js/config.js?v=1.0.0"; +import {handleFail} from "./ajax-util/fail-handler.js?v=1.0.0"; /** * Sends a GET request and returns result in promise. diff --git a/public/assets/general/ajax/fetch-translation-data.js b/public/assets/general/ajax/fetch-translation-data.js index a445d49e..6ca3fdd9 100644 --- a/public/assets/general/ajax/fetch-translation-data.js +++ b/public/assets/general/ajax/fetch-translation-data.js @@ -1,4 +1,4 @@ -import {fetchData} from "./fetch-data.js?v=0.4.2"; +import {fetchData} from "./fetch-data.js?v=1.0.0"; /** * Fetch serverside translation for given words. diff --git a/public/assets/general/ajax/modal-submit-request.js b/public/assets/general/ajax/modal-submit-request.js index cdeed2aa..9b81aaf5 100644 --- a/public/assets/general/ajax/modal-submit-request.js +++ b/public/assets/general/ajax/modal-submit-request.js @@ -1,7 +1,7 @@ -import {getFormData, toggleEnableDisableForm} from "../page-component/modal/modal-form.js?v=0.4.2"; -import {basePath} from "../general-js/config.js?v=0.4.2"; -import {handleFail} from "./ajax-util/fail-handler.js?v=0.4.2"; -import {closeModal} from "../page-component/modal/modal.js?v=0.4.2"; +import {getFormData, toggleEnableDisableForm} from "../page-component/modal/modal-form.js?v=1.0.0"; +import {basePath} from "../general-js/config.js?v=1.0.0"; +import {handleFail} from "./ajax-util/fail-handler.js?v=1.0.0"; +import {closeModal} from "../page-component/modal/modal.js?v=1.0.0"; /** * Retrieves form data, checks form validity, disables form, submits modal form and closes it on success. diff --git a/public/assets/general/ajax/submit-delete-request.js b/public/assets/general/ajax/submit-delete-request.js index 3fcb7be5..36927312 100644 --- a/public/assets/general/ajax/submit-delete-request.js +++ b/public/assets/general/ajax/submit-delete-request.js @@ -1,5 +1,5 @@ -import {basePath} from "../general-js/config.js?v=0.4.2"; -import {handleFail} from "./ajax-util/fail-handler.js?v=0.4.2"; +import {basePath} from "../general-js/config.js?v=1.0.0"; +import {handleFail} from "./ajax-util/fail-handler.js?v=1.0.0"; /** diff --git a/public/assets/general/ajax/submit-update-data.js b/public/assets/general/ajax/submit-update-data.js index 0d9629b2..b93eb04d 100644 --- a/public/assets/general/ajax/submit-update-data.js +++ b/public/assets/general/ajax/submit-update-data.js @@ -1,5 +1,5 @@ -import {basePath} from "../general-js/config.js?v=0.4.2"; -import {handleFail, removeValidationErrorMessages} from "./ajax-util/fail-handler.js?v=0.4.2"; +import {basePath} from "../general-js/config.js?v=1.0.0"; +import {handleFail, removeValidationErrorMessages} from "./ajax-util/fail-handler.js?v=1.0.0"; /** diff --git a/public/assets/general/dark-mode/dark-mode.js b/public/assets/general/dark-mode/dark-mode.js index 8d15c73a..d262db5a 100644 --- a/public/assets/general/dark-mode/dark-mode.js +++ b/public/assets/general/dark-mode/dark-mode.js @@ -1,5 +1,5 @@ -import {submitUpdate} from "../ajax/submit-update-data.js?v=0.4.2"; -import {displayFlashMessage} from "../page-component/flash-message/flash-message.js?v=0.4.2"; +import {submitUpdate} from "../ajax/submit-update-data.js?v=1.0.0"; +import {displayFlashMessage} from "../page-component/flash-message/flash-message.js?v=1.0.0"; // Get the toggle switch element const toggleSwitch = document.querySelector('#dark-mode-toggle-checkbox'); diff --git a/public/assets/general/event-handler/open-link-on-html-element.js b/public/assets/general/event-handler/open-link-on-html-element.js index 52085e3a..a5161dc7 100644 --- a/public/assets/general/event-handler/open-link-on-html-element.js +++ b/public/assets/general/event-handler/open-link-on-html-element.js @@ -1,4 +1,4 @@ -import {basePath} from "../general-js/config.js?v=0.4.2"; +import {basePath} from "../general-js/config.js?v=1.0.0"; /** * Open link when click or focus and enter key press diff --git a/public/assets/general/general-js/initialization.js b/public/assets/general/general-js/initialization.js index 875815b4..575c56f1 100644 --- a/public/assets/general/general-js/initialization.js +++ b/public/assets/general/general-js/initialization.js @@ -1,7 +1,7 @@ -import {displayServerSideFlashMessages} from "../page-component/flash-message/flash-message.js?v=0.4.2"; -import {initAutoResizingTextareaElements} from "../page-component/textarea/auto-resizing-textarea.js?v=0.4.2"; -import {scrollToAnchor} from "../page-behaviour/scroll-to-anchor.js?v=0.4.2"; -import {countDownThrottleTimer} from "../../authentication/throttle-timer.js?v=0.4.2"; +import {displayServerSideFlashMessages} from "../page-component/flash-message/flash-message.js?v=1.0.0"; +import {initAutoResizingTextareaElements} from "../page-component/textarea/auto-resizing-textarea.js?v=1.0.0"; +import {scrollToAnchor} from "../page-behaviour/scroll-to-anchor.js?v=1.0.0"; +import {countDownThrottleTimer} from "../../authentication/throttle-timer.js?v=1.0.0"; // This file is responsible for initializing elements for every loaded page. diff --git a/public/assets/general/page-component/contenteditable/contenteditable-main.js b/public/assets/general/page-component/contenteditable/contenteditable-main.js index b079257a..1f134ad5 100644 --- a/public/assets/general/page-component/contenteditable/contenteditable-main.js +++ b/public/assets/general/page-component/contenteditable/contenteditable-main.js @@ -1,6 +1,6 @@ -import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.4.2"; -import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=0.4.2"; -import {__} from "../../general-js/functions.js?v=0.4.2"; +import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=1.0.0"; +import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=1.0.0"; +import {__} from "../../general-js/functions.js?v=1.0.0"; /** * Make field value editable, add save button and focus it. diff --git a/public/assets/general/page-component/modal/alert-modal.js b/public/assets/general/page-component/modal/alert-modal.js index 4a20e3df..8ee03b10 100644 --- a/public/assets/general/page-component/modal/alert-modal.js +++ b/public/assets/general/page-component/modal/alert-modal.js @@ -1,5 +1,5 @@ -import {__} from "../../general-js/functions.js?v=0.4.2"; -import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=0.4.2"; +import {__} from "../../general-js/functions.js?v=1.0.0"; +import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=1.0.0"; function initAlertModalEventListeners() { // Event delegation. Add event listeners to non-existent elements during page loads but loaded dynamically diff --git a/public/assets/general/page-component/modal/dropdown-request.js b/public/assets/general/page-component/modal/dropdown-request.js index e7bbdc3c..f7937117 100644 --- a/public/assets/general/page-component/modal/dropdown-request.js +++ b/public/assets/general/page-component/modal/dropdown-request.js @@ -1,5 +1,5 @@ -import {basePath} from "../../general-js/config.js?v=0.4.2"; -import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.4.2"; +import {basePath} from "../../general-js/config.js?v=1.0.0"; +import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=1.0.0"; /** * This function is used to request dropdown options from a specific module route. diff --git a/public/assets/general/template/template-util.js b/public/assets/general/template/template-util.js index 20da6a8f..6ec8f9bf 100644 --- a/public/assets/general/template/template-util.js +++ b/public/assets/general/template/template-util.js @@ -1,4 +1,4 @@ -import {html} from "../general-js/functions.js?v=0.4.2"; +import {html} from "../general-js/functions.js?v=1.0.0"; /** * @param {object} allEntries database key has to be object key and value is name diff --git a/public/assets/user/create/user-create-main.js b/public/assets/user/create/user-create-main.js index cbbd971d..4dc977e3 100644 --- a/public/assets/user/create/user-create-main.js +++ b/public/assets/user/create/user-create-main.js @@ -1,9 +1,9 @@ -import {displayUserCreateModal} from "./user-create-modal.html.js?v=0.4.2"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.2"; -import {loadUserList} from "../list/user-list-loading.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; -import {submitModalForm} from "../../general/ajax/modal-submit-request.js?v=0.4.2"; +import {displayUserCreateModal} from "./user-create-modal.html.js?v=1.0.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=1.0.0"; +import {loadUserList} from "../list/user-list-loading.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; +import {submitModalForm} from "../../general/ajax/modal-submit-request.js?v=1.0.0"; // List of words that are used in modal box and need to be translated let wordsToTranslate = [ diff --git a/public/assets/user/create/user-create-modal.html.js b/public/assets/user/create/user-create-modal.html.js index f9a9adfa..32db9732 100644 --- a/public/assets/user/create/user-create-modal.html.js +++ b/public/assets/user/create/user-create-modal.html.js @@ -1,10 +1,10 @@ -import {createModal} from "../../general/page-component/modal/modal.js?v=0.4.2"; -import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.4.2"; -import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.4.2"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.2"; -import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; +import {createModal} from "../../general/page-component/modal/modal.js?v=1.0.0"; +import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=1.0.0"; +import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=1.0.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=1.0.0"; +import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; // List of words that are used in modal box and need to be translated let wordsToTranslate = [ diff --git a/public/assets/user/list/user-list-card-dom-appending.js b/public/assets/user/list/user-list-card-dom-appending.js index 5c5d8cc0..5bc95305 100644 --- a/public/assets/user/list/user-list-card-dom-appending.js +++ b/public/assets/user/list/user-list-card-dom-appending.js @@ -1,4 +1,4 @@ -import {getUserCardHtml} from "./user-list-card.html.js?v=0.4.2"; +import {getUserCardHtml} from "./user-list-card.html.js?v=1.0.0"; /** * Add user elements to the page. diff --git a/public/assets/user/list/user-list-card.html.js b/public/assets/user/list/user-list-card.html.js index 34b15b3e..4b6ce0f1 100644 --- a/public/assets/user/list/user-list-card.html.js +++ b/public/assets/user/list/user-list-card.html.js @@ -1,5 +1,5 @@ -import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.4.2"; -import {html} from "../../general/general-js/functions.js?v=0.4.2"; +import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=1.0.0"; +import {html} from "../../general/general-js/functions.js?v=1.0.0"; /** * HTML code for user profile card diff --git a/public/assets/user/list/user-list-loading.js b/public/assets/user/list/user-list-loading.js index 76972b95..9fc6d09d 100644 --- a/public/assets/user/list/user-list-loading.js +++ b/public/assets/user/list/user-list-loading.js @@ -1,14 +1,14 @@ -import {displayUserCardSkeletonLoader, removeUserCardSkeletonLoader} from "./user-list-skeleton-loader.js?v=0.4.2"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.4.2"; -import {addUsersToDom} from "./user-list-card-dom-appending.js?v=0.4.2"; +import {displayUserCardSkeletonLoader, removeUserCardSkeletonLoader} from "./user-list-skeleton-loader.js?v=1.0.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=1.0.0"; +import {addUsersToDom} from "./user-list-card-dom-appending.js?v=1.0.0"; import { disableMouseWheelClickScrolling, openLinkOnHtmlElement -} from "../../general/event-handler/open-link-on-html-element.js?v=0.4.2"; +} from "../../general/event-handler/open-link-on-html-element.js?v=1.0.0"; import { triggerClickOnHtmlElementEnterKeypress -} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; +} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; /** * Load user list into DOM diff --git a/public/assets/user/list/user-list-main.js b/public/assets/user/list/user-list-main.js index 3bc7563c..364f7a0e 100644 --- a/public/assets/user/list/user-list-main.js +++ b/public/assets/user/list/user-list-main.js @@ -1,4 +1,4 @@ -import {loadUserList} from "./user-list-loading.js?v=0.4.2"; +import {loadUserList} from "./user-list-loading.js?v=1.0.0"; // Load users at page startup - this function cannot be in this file as it's used by the dashboard for loading in tailored wrapper loadUserList(); \ No newline at end of file diff --git a/public/assets/user/list/user-list-skeleton-loader.js b/public/assets/user/list/user-list-skeleton-loader.js index 96a51570..b44c1077 100644 --- a/public/assets/user/list/user-list-skeleton-loader.js +++ b/public/assets/user/list/user-list-skeleton-loader.js @@ -1,4 +1,4 @@ -import {getUserCardSkeletonLoaderHtml} from "./user-list-card.html.js?v=0.4.2"; +import {getUserCardSkeletonLoaderHtml} from "./user-list-card.html.js?v=1.0.0"; /** * Display skeleton loaders diff --git a/public/assets/user/read/user-activity/activity-main.js b/public/assets/user/read/user-activity/activity-main.js index 25eca880..9bc7e379 100644 --- a/public/assets/user/read/user-activity/activity-main.js +++ b/public/assets/user/read/user-activity/activity-main.js @@ -1,6 +1,6 @@ -import {fetchData} from "../../../general/ajax/fetch-data.js?v=0.4.2"; -import {getUserActivityListHtml} from "./user-activtiy-list.html.js?v=0.4.2"; -import {initCollapsible} from "../../../general/page-component/collapsible/collapsible.js?v=0.4.2"; +import {fetchData} from "../../../general/ajax/fetch-data.js?v=1.0.0"; +import {getUserActivityListHtml} from "./user-activtiy-list.html.js?v=1.0.0"; +import {initCollapsible} from "../../../general/page-component/collapsible/collapsible.js?v=1.0.0"; /** diff --git a/public/assets/user/read/user-read-update-main.js b/public/assets/user/read/user-read-update-main.js index cfbb231c..c8e6bbb5 100644 --- a/public/assets/user/read/user-read-update-main.js +++ b/public/assets/user/read/user-read-update-main.js @@ -1,13 +1,13 @@ -import {makeUserFieldEditable} from "./user-update-contenteditable.js?v=0.4.2"; -import {displayChangePasswordModal} from "../update/change-password-modal.html.js?v=0.4.2"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.2"; -import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.4.2"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.4.2"; -import {loadUserActivities} from "./user-activity/activity-main.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; -import {submitModalForm} from "../../general/ajax/modal-submit-request.js?v=0.4.2"; +import {makeUserFieldEditable} from "./user-update-contenteditable.js?v=1.0.0"; +import {displayChangePasswordModal} from "../update/change-password-modal.html.js?v=1.0.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=1.0.0"; +import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=1.0.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=1.0.0"; +import {loadUserActivities} from "./user-activity/activity-main.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; +import {submitModalForm} from "../../general/ajax/modal-submit-request.js?v=1.0.0"; const userId = document.getElementById('user-id').value; const isOwnProfile = document.getElementById('is-own-profile').value; diff --git a/public/assets/user/read/user-update-contenteditable.js b/public/assets/user/read/user-update-contenteditable.js index 46aa5f91..a86a1159 100644 --- a/public/assets/user/read/user-update-contenteditable.js +++ b/public/assets/user/read/user-update-contenteditable.js @@ -1,10 +1,10 @@ -import {removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.2"; +import {removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=1.0.0"; import { contentEditableFieldValueIsValid, disableEditableField, makeFieldEditable -} from "../../general/page-component/contenteditable/contenteditable-main.js?v=0.4.2"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.2"; +} from "../../general/page-component/contenteditable/contenteditable-main.js?v=1.0.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=1.0.0"; /** * Make text value as editable and attach event listeners diff --git a/public/assets/user/update/change-password-modal.html.js b/public/assets/user/update/change-password-modal.html.js index 6cd1e8e7..c9efe05e 100644 --- a/public/assets/user/update/change-password-modal.html.js +++ b/public/assets/user/update/change-password-modal.html.js @@ -1,7 +1,7 @@ -import {createModal} from "../../general/page-component/modal/modal.js?v=0.4.2"; -import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.4.2"; -import {__} from "../../general/general-js/functions.js?v=0.4.2"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.2"; +import {createModal} from "../../general/page-component/modal/modal.js?v=1.0.0"; +import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=1.0.0"; +import {__} from "../../general/general-js/functions.js?v=1.0.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=1.0.0"; // List of words that are used in modal box and need to be translated let wordsToTranslate = [ diff --git a/src/Domain/Client/Service/Authorization/ClientPermissionVerifier.php b/src/Domain/Client/Service/Authorization/ClientPermissionVerifier.php index 4c7dd857..e256b6c3 100644 --- a/src/Domain/Client/Service/Authorization/ClientPermissionVerifier.php +++ b/src/Domain/Client/Service/Authorization/ClientPermissionVerifier.php @@ -175,10 +175,11 @@ public function isGrantedToUpdate(array $clientDataToUpdate, ?int $ownerId, bool $grantedUpdateKeys[] = 'client_status_id'; } } + // Things that only managing_advisor and higher privileged are allowed to do if ($authenticatedUserRoleHierarchy <= $userRoleHierarchies['managing_advisor'] // isGrantedToAssignUserToClient CANNOT be used as it expects a real user_id which is not provided - // in the case where user_id value is the string "value" from (ClientAuthGetter) to check if + // in the case where user_id value is the string "value" from (ClientPrivilegeDeterminer) to check if // the authenticated user is allowed to change the assigned user. (To enable/disable html