diff --git a/config/local/defaults.env.php b/config/local/defaults.env.php index 6df7b1ec..926c40a7 100644 --- a/config/local/defaults.env.php +++ b/config/local/defaults.env.php @@ -28,10 +28,10 @@ $settings['deployment'] = [ // Version `null` or string. If JsImportVersionAdder is enabled, `null` removes all query param versions from js imports - 'version' => '0.3.1', + 'version' => '0.4.0', // When true, JsImportVersionAdder is enabled and goes through all js files and changes the version number from the imports 'update_imports_version' => true, // Disable in prod - 'assets_path' => __DIR__ . '/../../public/assets', + 'assets_path' => $settings['root_dir'] . '/public/assets', ]; $settings['locale'] = [ @@ -57,7 +57,7 @@ // If 3600, the requests in the past hour will be evaluated and compared to the set thresholds below 'timespan' => 3600, // key = request amount (fail: x + 1 as check is done at beginning of next request); value = delay; Lowest to highest - /** When changed, update @see UserRequestCaseProvider */ + /** When changed, update @see UserRequestProvider */ // Login threshold and matching throttle concerning specific user or coming from same ip (successes and failures) // If threshold is 4, there need to be already 4 failures for the check to fail as it's done before evaluating the // login request, the next check will be at the beginning of the 5th @@ -66,8 +66,7 @@ // If login successes should be throttled the same way failures ars (if login_throttle is [4 => 10, 9 => 120, ...] // it means that after the 4th login success, each following success requests (in the given timespan) have to be in // a 10s interval. After 9 it's 120s and so on) - 'throttle_login_success' => false, - // bool + 'throttle_login_success' => false, // bool // Percentage of login requests that may be failures (threshold) 'login_failure_percentage' => 20, diff --git a/config/local/env.dev.php b/config/local/env.dev.php index 13b301f0..4f273fd3 100644 --- a/config/local/env.dev.php +++ b/config/local/env.dev.php @@ -18,8 +18,6 @@ // Error handler. More controlled than ini $settings['error']['display_error_details'] = $settings['dev']; -$settings['deployment']['assets_path'] = __DIR__ . '/../public/assets'; - // Database $settings['db']['database'] = 'slim_example_project'; diff --git a/public/assets/authentication/password-reset-main.js b/public/assets/authentication/password-reset-main.js index c8646f44..634f2420 100644 --- a/public/assets/authentication/password-reset-main.js +++ b/public/assets/authentication/password-reset-main.js @@ -1,3 +1,3 @@ -import {addPasswordStrengthCheck} from "./password-strength-checker.js?v=0.3.1"; +import {addPasswordStrengthCheck} from "./password-strength-checker.js?v=0.4.0"; addPasswordStrengthCheck() \ No newline at end of file diff --git a/public/assets/authentication/password-strength-checker.js b/public/assets/authentication/password-strength-checker.js index fb6b6a5c..2948fca0 100644 --- a/public/assets/authentication/password-strength-checker.js +++ b/public/assets/authentication/password-strength-checker.js @@ -1,7 +1,7 @@ // Init vars -import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=0.3.1"; -import {fetchTranslations} from "../general/ajax/fetch-translation-data.js?v=0.3.1"; -import {__} from "../general/general-js/functions.js?v=0.3.1"; +import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=0.4.0"; +import {fetchTranslations} from "../general/ajax/fetch-translation-data.js?v=0.4.0"; +import {__} from "../general/general-js/functions.js?v=0.4.0"; let password1Input, password2Inp; diff --git a/public/assets/client/create/client-create-main.js b/public/assets/client/create/client-create-main.js index 2e857045..268e602b 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.3.1"; -import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.3.1"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.3.1"; -import {displayValidationErrorMessage} from "../../general/validation/form-validation.js?v=0.3.1"; -import {fetchAndLoadClients} from "../list/client-list-loading.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; +import {displayClientCreateModal} from "./client-create-modal.html.js?v=0.4.0"; +import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.4.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.0"; +import {displayValidationErrorMessage} from "../../general/validation/form-validation.js?v=0.4.0"; +import {fetchAndLoadClients} from "../list/client-list-loading.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.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 dda4a043..626e4bbc 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.3.1"; -import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.3.1"; -import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.3.1"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; +import {createModal} from "../../general/page-component/modal/modal.js?v=0.4.0"; +import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.4.0"; +import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.4.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.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-content-placeholder.js b/public/assets/client/list/client-list-content-placeholder.js index ca0e6a39..fdc10892 100644 --- a/public/assets/client/list/client-list-content-placeholder.js +++ b/public/assets/client/list/client-list-content-placeholder.js @@ -1,4 +1,4 @@ -import {getClientProfileCardLoadingPlaceholderHtml} from "./client-list-profile-card.html.js?v=0.3.1"; +import {getClientProfileCardLoadingPlaceholderHtml} from "./client-list-profile-card.html.js?v=0.4.0"; /** * Display client content placeholders diff --git a/public/assets/client/list/client-list-loading.js b/public/assets/client/list/client-list-loading.js index 5bd928db..23c57da4 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.3.1"; +import {getClientProfileCardHtml} from "./client-list-profile-card.html.js?v=0.4.0"; import { displayClientProfileCardLoadingPlaceholder, removeClientCardContentPlaceholder -} from "./client-list-content-placeholder.js?v=0.3.1"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.3.1"; +} from "./client-list-content-placeholder.js?v=0.4.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=0.4.0"; import { disableMouseWheelClickScrolling, openLinkOnHtmlElement -} from "../../general/event-handler/open-link-on-html-element.js?v=0.3.1"; +} from "../../general/event-handler/open-link-on-html-element.js?v=0.4.0"; import { triggerClickOnHtmlElementEnterKeypress -} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.3.1"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.3.1"; +} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.4.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.0"; // When searching clients a request is made on each keyup and we want to show only the final result to the user, // not a flickering between content placeholders, the result of the first typed key, then the second and so on. diff --git a/public/assets/client/list/client-list-main.js b/public/assets/client/list/client-list-main.js index 9befaffb..b64e8a89 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.3.1"; -import {initFilterChipEventListeners} from "../../general/page-component/filter-chip/filter-chip.js?v=0.3.1"; +import {fetchAndLoadClients, fetchAndLoadClientsEventHandler} from "./client-list-loading.js?v=0.4.0"; +import {initFilterChipEventListeners} from "../../general/page-component/filter-chip/filter-chip.js?v=0.4.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 89dcf92c..315a196f 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.3.1"; -import {escapeHtml} from "../../general/general-js/functions.js?v=0.3.1"; -import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.3.1"; +import {getAvatarPath} from "../util/client-template-util.js?v=0.4.0"; +import {escapeHtml} from "../../general/general-js/functions.js?v=0.4.0"; +import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.4.0"; /** * HTML code for client profile card diff --git a/public/assets/client/note/client-read-create-note.js b/public/assets/client/note/client-read-create-note.js index 1df011b0..bece8834 100644 --- a/public/assets/client/note/client-read-create-note.js +++ b/public/assets/client/note/client-read-create-note.js @@ -1,13 +1,13 @@ -import {basePath} from "../../general/general-js/config.js?v=0.3.1"; +import {basePath} from "../../general/general-js/config.js?v=0.4.0"; import { addDeleteNoteBtnEventListener, addHideNoteBtnEventListener, addTextareaInputEventListener, hideCheckmarkLoader, toggleReadOnlyAndBtnAboveNote -} from "./client-read-note-event-listener-setup.js?v=0.3.1"; -import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.3.1"; -import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.3.1"; +} from "./client-read-note-event-listener-setup.js?v=0.4.0"; +import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.0"; +import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.4.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 31f3d9e1..91771501 100644 --- a/public/assets/client/note/client-read-delete-note.js +++ b/public/assets/client/note/client-read-delete-note.js @@ -4,9 +4,9 @@ * @param noteId * @param noteContainer */ -import {basePath} from "../../general/general-js/config.js?v=0.3.1"; -import {hideCheckmarkLoader} from "./client-read-note-event-listener-setup.js?v=0.3.1"; -import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.3.1"; +import {basePath} from "../../general/general-js/config.js?v=0.4.0"; +import {hideCheckmarkLoader} from "./client-read-note-event-listener-setup.js?v=0.4.0"; +import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.0"; /** * Make delete request to db 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 6e7b6216..6afd21eb 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.3.1"; -import {disableHideCheckMarkTimeoutOnCreation, insertNewNoteToDb} from "./client-read-create-note.js?v=0.3.1"; -import {deleteNoteRequestToDb} from "./client-read-delete-note.js?v=0.3.1"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.3.1"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.3.1"; +import {disableHideCheckMarkTimeoutOnUpdate, saveNoteChangeToDb} from "./client-read-save-existing-note.js?v=0.4.0"; +import {disableHideCheckMarkTimeoutOnCreation, insertNewNoteToDb} from "./client-read-create-note.js?v=0.4.0"; +import {deleteNoteRequestToDb} from "./client-read-delete-note.js?v=0.4.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.4.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.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-placeholder.js b/public/assets/client/note/client-read-note-loading-placeholder.js index b3197d51..de4b28ab 100644 --- a/public/assets/client/note/client-read-note-loading-placeholder.js +++ b/public/assets/client/note/client-read-note-loading-placeholder.js @@ -1,4 +1,4 @@ -import {getClientNoteLoadingPlaceholderHtml} from "./client-read-template-note.html.js?v=0.3.1"; +import {getClientNoteLoadingPlaceholderHtml} from "./client-read-template-note.html.js?v=0.4.0"; /** * Display client note content placeholders diff --git a/public/assets/client/note/client-read-note-loading.js b/public/assets/client/note/client-read-note-loading.js index 5c8492dd..3064bc1c 100644 --- a/public/assets/client/note/client-read-note-loading.js +++ b/public/assets/client/note/client-read-note-loading.js @@ -1,14 +1,14 @@ -import {getNoteHtml} from "./client-read-template-note.html.js?v=0.3.1"; +import {getNoteHtml} from "./client-read-template-note.html.js?v=0.4.0"; import { displayClientNoteLoadingPlaceholder, removeClientNoteContentPlaceholder -} from "./client-read-note-loading-placeholder.js?v=0.3.1"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.3.1"; -import {initNotesEventListeners} from "./client-read-note-event-listener-setup.js?v=0.3.1"; -import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.3.1"; -import {scrollToAnchor} from "../../general/page-behaviour/scroll-to-anchor.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; +} from "./client-read-note-loading-placeholder.js?v=0.4.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=0.4.0"; +import {initNotesEventListeners} from "./client-read-note-event-listener-setup.js?v=0.4.0"; +import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.4.0"; +import {scrollToAnchor} from "../../general/page-behaviour/scroll-to-anchor.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.0"; /** * Loading notes into dom 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 3e8a8dad..21fabe75 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.3.1"; +import {basePath} from "../../general/general-js/config.js?v=0.4.0"; import { changeUserIsTyping, hideCheckmarkLoader, userIsTypingOnNoteId -} from "./client-read-note-event-listener-setup.js?v=0.3.1"; -import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.3.1"; +} from "./client-read-note-event-listener-setup.js?v=0.4.0"; +import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.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 3e3766d8..586d40f9 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 {escapeHtml} from "../../general/general-js/functions.js?v=0.3.1"; +import {escapeHtml} from "../../general/general-js/functions.js?v=0.4.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 28449cc5..dcdcc031 100644 --- a/public/assets/client/read/client-read-main.js +++ b/public/assets/client/read/client-read-main.js @@ -1,13 +1,13 @@ -import {makeClientFieldEditable} from "./update/client-update-contenteditable.js?v=0.3.1"; -import {makeFieldSelectValueEditable} from "./update/client-update-dropdown.js?v=0.3.1"; -import {loadAvailablePersonalInfoIconsDiv} from "./client-read-personal-info.js?v=0.3.1"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.3.1"; -import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.3.1"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.3.1"; -import {fetchAndLoadClientNotes} from "../note/client-read-note-loading.js?v=0.3.1"; -import {addNewNoteTextarea} from "../note/client-read-create-note.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; +import {makeClientFieldEditable} from "./update/client-update-contenteditable.js?v=0.4.0"; +import {makeFieldSelectValueEditable} from "./update/client-update-dropdown.js?v=0.4.0"; +import {loadAvailablePersonalInfoIconsDiv} from "./client-read-personal-info.js?v=0.4.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.4.0"; +import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.4.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.0"; +import {fetchAndLoadClientNotes} from "../note/client-read-note-loading.js?v=0.4.0"; +import {addNewNoteTextarea} from "../note/client-read-create-note.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.0"; const clientId = document.getElementById('client-id').value; diff --git a/public/assets/client/read/client-read-save-dropdown-change.js b/public/assets/client/read/client-read-save-dropdown-change.js index d198783a..2ff6c9f2 100644 --- a/public/assets/client/read/client-read-save-dropdown-change.js +++ b/public/assets/client/read/client-read-save-dropdown-change.js @@ -1,5 +1,5 @@ -import {basePath} from "../../general/general-js/config.js?v=0.3.1"; -import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.3.1"; +import {basePath} from "../../general/general-js/config.js?v=0.4.0"; +import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.0"; export function saveClientReadDropdownChange() { // Make ajax call diff --git a/public/assets/client/read/update/client-update-contenteditable.js b/public/assets/client/read/update/client-update-contenteditable.js index 8819a4ce..56a29b19 100644 --- a/public/assets/client/read/update/client-update-contenteditable.js +++ b/public/assets/client/read/update/client-update-contenteditable.js @@ -1,15 +1,15 @@ -import {removeValidationErrorMessages} from "../../../general/ajax/ajax-util/fail-handler.js?v=0.3.1"; +import {removeValidationErrorMessages} from "../../../general/ajax/ajax-util/fail-handler.js?v=0.4.0"; import { addIconToAvailableDiv, removeIconFromAvailableDiv, showPersonalInfoContainerIfHidden -} from "../client-read-personal-info.js?v=0.3.1"; +} from "../client-read-personal-info.js?v=0.4.0"; import { contentEditableFieldValueIsValid, disableEditableField, makeFieldEditable -} from "../../../general/page-component/contenteditable/contenteditable-main.js?v=0.3.1"; -import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.3.1"; +} from "../../../general/page-component/contenteditable/contenteditable-main.js?v=0.4.0"; +import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.4.0"; function preventLinkOpening(e) { /* Prevent link from being opened */ diff --git a/public/assets/client/read/update/client-update-dropdown.js b/public/assets/client/read/update/client-update-dropdown.js index 64d19989..bcb2bda6 100644 --- a/public/assets/client/read/update/client-update-dropdown.js +++ b/public/assets/client/read/update/client-update-dropdown.js @@ -2,8 +2,8 @@ import { addIconToAvailableDiv, removeIconFromAvailableDiv, showPersonalInfoContainerIfHidden -} from "../client-read-personal-info.js?v=0.3.1"; -import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.3.1"; +} from "../client-read-personal-info.js?v=0.4.0"; +import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.4.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 15006dbe..e87581a4 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.3.1"; -import {fetchAndLoadClientNotes} from "../client/note/client-read-note-loading.js?v=0.3.1"; -import {initFilterChipEventListeners} from "../general/page-component/filter-chip/filter-chip.js?v=0.3.1"; -import {loadUserActivities} from "../user/read/user-activity/activity-main.js?v=0.3.1"; -import {submitUpdate} from "../general/ajax/submit-update-data.js?v=0.3.1"; +import {fetchAndLoadClients} from "../client/list/client-list-loading.js?v=0.4.0"; +import {fetchAndLoadClientNotes} from "../client/note/client-read-note-loading.js?v=0.4.0"; +import {initFilterChipEventListeners} from "../general/page-component/filter-chip/filter-chip.js?v=0.4.0"; +import {loadUserActivities} from "../user/read/user-activity/activity-main.js?v=0.4.0"; +import {submitUpdate} from "../general/ajax/submit-update-data.js?v=0.4.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 0fbad847..264d1ca9 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.3.1"; -import {displayFlashMessage} from "../../page-component/flash-message/flash-message.js?v=0.3.1"; -import {__} from "../../general-js/functions.js?v=0.3.1"; -import {fetchTranslations} from "../fetch-translation-data.js?v=0.3.1"; +import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.4.0"; +import {displayFlashMessage} from "../../page-component/flash-message/flash-message.js?v=0.4.0"; +import {__} from "../../general-js/functions.js?v=0.4.0"; +import {fetchTranslations} from "../fetch-translation-data.js?v=0.4.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 46b40eb4..22499ee5 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.3.1"; -import {handleFail} from "./ajax-util/fail-handler.js?v=0.3.1"; +import {basePath} from "../general-js/config.js?v=0.4.0"; +import {handleFail} from "./ajax-util/fail-handler.js?v=0.4.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 832fa56f..256c22fb 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.3.1"; +import {fetchData} from "./fetch-data.js?v=0.4.0"; /** * Fetch serverside translation for given words diff --git a/public/assets/general/ajax/submit-delete-request.js b/public/assets/general/ajax/submit-delete-request.js index 80f4dfd2..757f3072 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.3.1"; -import {handleFail} from "./ajax-util/fail-handler.js?v=0.3.1"; +import {basePath} from "../general-js/config.js?v=0.4.0"; +import {handleFail} from "./ajax-util/fail-handler.js?v=0.4.0"; /** diff --git a/public/assets/general/ajax/submit-update-data.js b/public/assets/general/ajax/submit-update-data.js index 624d6e7c..73cbffa8 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.3.1"; -import {handleFail, removeValidationErrorMessages} from "./ajax-util/fail-handler.js?v=0.3.1"; +import {basePath} from "../general-js/config.js?v=0.4.0"; +import {handleFail, removeValidationErrorMessages} from "./ajax-util/fail-handler.js?v=0.4.0"; /** diff --git a/public/assets/general/dark-mode/dark-mode.js b/public/assets/general/dark-mode/dark-mode.js index a6681df6..07ed5d0f 100644 --- a/public/assets/general/dark-mode/dark-mode.js +++ b/public/assets/general/dark-mode/dark-mode.js @@ -1,6 +1,6 @@ // Get the toggle switch element -import {submitUpdate} from "../ajax/submit-update-data.js?v=0.3.1"; -import {displayFlashMessage} from "../page-component/flash-message/flash-message.js?v=0.3.1"; +import {submitUpdate} from "../ajax/submit-update-data.js?v=0.4.0"; +import {displayFlashMessage} from "../page-component/flash-message/flash-message.js?v=0.4.0"; 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 8fd3e4e7..60081d7b 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.3.1"; +import {basePath} from "../general-js/config.js?v=0.4.0"; /** * Open link when click or focus and enter key press diff --git a/public/assets/general/general-js/default.js b/public/assets/general/general-js/default.js index 8b613cf6..78d783b8 100644 --- a/public/assets/general/general-js/default.js +++ b/public/assets/general/general-js/default.js @@ -1,7 +1,7 @@ -import {displayServerSideFlashMessages} from "../page-component/flash-message/flash-message.js?v=0.3.1"; -import {initAutoResizingTextareas} from "../page-component/textarea/auto-resizing-textarea.js?v=0.3.1"; -import {scrollToAnchor} from "../page-behaviour/scroll-to-anchor.js?v=0.3.1"; -import {countDownThrottleTimer} from "../../authentication/throttle-timer.js?v=0.3.1"; +import {displayServerSideFlashMessages} from "../page-component/flash-message/flash-message.js?v=0.4.0"; +import {initAutoResizingTextareas} from "../page-component/textarea/auto-resizing-textarea.js?v=0.4.0"; +import {scrollToAnchor} from "../page-behaviour/scroll-to-anchor.js?v=0.4.0"; +import {countDownThrottleTimer} from "../../authentication/throttle-timer.js?v=0.4.0"; // displayFlashMessage('success', 'This is a success flash message.'); // displayFlashMessage('info', 'This is an info flash message.'); diff --git a/public/assets/general/page-component/contenteditable/contenteditable-main.js b/public/assets/general/page-component/contenteditable/contenteditable-main.js index 29e83837..aee24af1 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.3.1"; -import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=0.3.1"; -import {__} from "../../general-js/functions.js?v=0.3.1"; +import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.4.0"; +import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=0.4.0"; +import {__} from "../../general-js/functions.js?v=0.4.0"; /** * Make field value editable diff --git a/public/assets/general/page-component/modal/alert-modal.js b/public/assets/general/page-component/modal/alert-modal.js index afd18275..20225d20 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.3.1"; -import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=0.3.1"; +import {__} from "../../general-js/functions.js?v=0.4.0"; +import {fetchTranslations} from "../../ajax/fetch-translation-data.js?v=0.4.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 6f72c131..274436e4 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.3.1"; -import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.3.1"; +import {basePath} from "../../general-js/config.js?v=0.4.0"; +import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.4.0"; /** * @param {string} moduleRoute name of the module for the route preceding "/dropdown-options" diff --git a/public/assets/general/page-component/modal/modal-submit-request.js b/public/assets/general/page-component/modal/modal-submit-request.js index dc1d9bbe..839a00fd 100644 --- a/public/assets/general/page-component/modal/modal-submit-request.js +++ b/public/assets/general/page-component/modal/modal-submit-request.js @@ -1,7 +1,7 @@ -import {getFormData, toggleEnableDisableForm} from "./modal-form.js?v=0.3.1"; -import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.3.1"; -import {closeModal} from "./modal.js?v=0.3.1"; -import {basePath} from "../../general-js/config.js?v=0.3.1"; +import {getFormData, toggleEnableDisableForm} from "./modal-form.js?v=0.4.0"; +import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.4.0"; +import {closeModal} from "./modal.js?v=0.4.0"; +import {basePath} from "../../general-js/config.js?v=0.4.0"; /** * Retrieves form data, checks form validity, disables form, submits modal form and closes it on success diff --git a/public/assets/general/template/template-util.js b/public/assets/general/template/template-util.js index d48a0ae2..288024a2 100644 --- a/public/assets/general/template/template-util.js +++ b/public/assets/general/template/template-util.js @@ -5,7 +5,7 @@ * @param {number|string} selectedKey optional selected key. If not found, no option is selected * @return {string} */ -import {escapeHtml} from "../general-js/functions.js?v=0.3.1"; +import {escapeHtml} from "../general-js/functions.js?v=0.4.0"; /** * @param {Object} allEntries diff --git a/public/assets/user/create/user-create-main.js b/public/assets/user/create/user-create-main.js index f2cd1400..a58b40de 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.3.1"; -import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.3.1"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.3.1"; -import {loadUserList} from "../list/user-list-loading.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; +import {displayUserCreateModal} from "./user-create-modal.html.js?v=0.4.0"; +import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.4.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.0"; +import {loadUserList} from "../list/user-list-loading.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.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 f195a537..4d4f0ae1 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.3.1"; -import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.3.1"; -import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.3.1"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.3.1"; -import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; +import {createModal} from "../../general/page-component/modal/modal.js?v=0.4.0"; +import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.4.0"; +import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.4.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.0"; +import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.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 dee99773..0fc4c6f4 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.3.1"; +import {getUserCardHtml} from "./user-list-card.html.js?v=0.4.0"; /** * Add elements to page diff --git a/public/assets/user/list/user-list-card.html.js b/public/assets/user/list/user-list-card.html.js index d4cfe5d4..d42b83f0 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.3.1"; -import {escapeHtml} from "../../general/general-js/functions.js?v=0.3.1"; +import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.4.0"; +import {escapeHtml} from "../../general/general-js/functions.js?v=0.4.0"; /** * HTML code for client profile card diff --git a/public/assets/user/list/user-list-content-placeholder.js b/public/assets/user/list/user-list-content-placeholder.js index 89b7693f..e4f9592b 100644 --- a/public/assets/user/list/user-list-content-placeholder.js +++ b/public/assets/user/list/user-list-content-placeholder.js @@ -1,4 +1,4 @@ -import {getUserCardLoadingPlaceholderHtml} from "./user-list-card.html.js?v=0.3.1"; +import {getUserCardLoadingPlaceholderHtml} from "./user-list-card.html.js?v=0.4.0"; /** * Display content placeholders diff --git a/public/assets/user/list/user-list-loading.js b/public/assets/user/list/user-list-loading.js index cddf6cb1..d0cc38ea 100644 --- a/public/assets/user/list/user-list-loading.js +++ b/public/assets/user/list/user-list-loading.js @@ -1,17 +1,17 @@ import { displayUserCardLoadingPlaceholder, removeUserCardContentPlaceholder -} from "./user-list-content-placeholder.js?v=0.3.1"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.3.1"; -import {addUsersToDom} from "./user-list-card-dom-appending.js?v=0.3.1"; +} from "./user-list-content-placeholder.js?v=0.4.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=0.4.0"; +import {addUsersToDom} from "./user-list-card-dom-appending.js?v=0.4.0"; import { disableMouseWheelClickScrolling, openLinkOnHtmlElement -} from "../../general/event-handler/open-link-on-html-element.js?v=0.3.1"; +} from "../../general/event-handler/open-link-on-html-element.js?v=0.4.0"; import { triggerClickOnHtmlElementEnterKeypress -} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.3.1"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.3.1"; +} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.4.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.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 c8f25d9b..6834df17 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.3.1"; +import {loadUserList} from "./user-list-loading.js?v=0.4.0"; // Load users at page startup - this function cannot be here 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/read/user-activity/activity-main.js b/public/assets/user/read/user-activity/activity-main.js index 49a2d6af..4255d278 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.3.1"; -import {getUserActivityListHtml} from "./user-activtiy-list.html.js?v=0.3.1"; -import {initCollapsible} from "../../../general/page-component/collapsible/collapsible.js?v=0.3.1"; +import {fetchData} from "../../../general/ajax/fetch-data.js?v=0.4.0"; +import {getUserActivityListHtml} from "./user-activtiy-list.html.js?v=0.4.0"; +import {initCollapsible} from "../../../general/page-component/collapsible/collapsible.js?v=0.4.0"; /** diff --git a/public/assets/user/read/user-read-update-main.js b/public/assets/user/read/user-read-update-main.js index 2b2dfd4c..13ecbef7 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.3.1"; -import {displayChangePasswordModal} from "../update/change-password-modal.html.js?v=0.3.1"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.3.1"; -import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.3.1"; -import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.3.1"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.3.1"; -import {loadUserActivities} from "./user-activity/activity-main.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.3.1"; +import {makeUserFieldEditable} from "./user-update-contenteditable.js?v=0.4.0"; +import {displayChangePasswordModal} from "../update/change-password-modal.html.js?v=0.4.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.4.0"; +import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.4.0"; +import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.4.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.4.0"; +import {loadUserActivities} from "./user-activity/activity-main.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.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 53439565..0a33968b 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.3.1"; +import {removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.4.0"; import { contentEditableFieldValueIsValid, disableEditableField, makeFieldEditable -} from "../../general/page-component/contenteditable/contenteditable-main.js?v=0.3.1"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.3.1"; +} from "../../general/page-component/contenteditable/contenteditable-main.js?v=0.4.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.4.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 0c547795..9e732cc3 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.3.1"; -import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.3.1"; -import {__} from "../../general/general-js/functions.js?v=0.3.1"; -import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.3.1"; +import {createModal} from "../../general/page-component/modal/modal.js?v=0.4.0"; +import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.4.0"; +import {__} from "../../general/general-js/functions.js?v=0.4.0"; +import {fetchTranslations} from "../../general/ajax/fetch-translation-data.js?v=0.4.0"; // List of words that are used in modal box and need to be translated let wordsToTranslate = [ diff --git a/src/Application/Actions/Note/Ajax/NoteCreateSubmitAction.php b/src/Application/Actions/Note/Ajax/NoteCreateSubmitAction.php index 4eda6933..ae662ebd 100644 --- a/src/Application/Actions/Note/Ajax/NoteCreateSubmitAction.php +++ b/src/Application/Actions/Note/Ajax/NoteCreateSubmitAction.php @@ -76,7 +76,7 @@ public function __invoke( } catch (ForbiddenException $forbiddenException) { return $this->responder->respondWithJson( $response, - [// Response content asserted in ClientReadCaseProvider.php + [ 'status' => 'error', 'message' => __(sprintf('Not allowed to create %s', __('note'))), ], diff --git a/src/Application/Actions/Note/Ajax/NoteUpdateSubmitAction.php b/src/Application/Actions/Note/Ajax/NoteUpdateSubmitAction.php index 22f35d19..3e0f7e59 100644 --- a/src/Application/Actions/Note/Ajax/NoteUpdateSubmitAction.php +++ b/src/Application/Actions/Note/Ajax/NoteUpdateSubmitAction.php @@ -84,7 +84,7 @@ public function __invoke( return $this->responder->respondWithJson( $response, [ - // Response content asserted in ClientReadCaseProvider.php + // Response content asserted in NoteProvider.php 'status' => 'error', 'message' => 'Not allowed to change note.', ], diff --git a/src/Domain/Client/Service/ClientValidator.php b/src/Domain/Client/Service/ClientValidator.php index ddb8fef9..3a10b529 100644 --- a/src/Domain/Client/Service/ClientValidator.php +++ b/src/Domain/Client/Service/ClientValidator.php @@ -29,14 +29,14 @@ public function __construct( * Validate client creation. * Validate client values as array and not object to prevent exception on * invalid data such as datetime is used in the constructor. - * * All keys that may not be in the request body (malformedRequestBodyChecker - optional keys) - * * such radio buttons have to be accessed with null coalescing alternative: $values['key'] ?? null. + * *All keys that may not be in the request body (malformedRequestBodyChecker - optional keys) + * *such as radio buttons have to be accessed with null coalescing alternative: $values['key'] ?? null. * * @param array $clientValues */ public function validateClientCreation(array $clientValues): void { - // Exact validation error tested in ClientCreateActionTest + // Validation error message asserted in ClientCreateActionTest $validationResult = new ValidationResult('There is something in the client data that couldn\'t be validated'); $this->validateClientStatusId($clientValues['client_status_id'], $validationResult, true); @@ -78,7 +78,7 @@ public function validateClientCreation(array $clientValues): void */ public function validateClientUpdate(array $clientValues): void { - // Exact validation error tested in PostCaseProvider.php::providePostCreateInvalidData() + // Validation error message asserted in ClientUpdateActionTest $validationResult = new ValidationResult('There is something in the client data that couldn\'t be validated'); // Using array_key_exists instead of isset as isset returns false if value is null and key exists diff --git a/src/Domain/Note/Service/NoteValidator.php b/src/Domain/Note/Service/NoteValidator.php index ae7d2b4f..9de98cb3 100644 --- a/src/Domain/Note/Service/NoteValidator.php +++ b/src/Domain/Note/Service/NoteValidator.php @@ -41,7 +41,7 @@ public function __construct( */ public function validateNoteCreation(NoteData $note): void { - // Exact validation error tested in NoteCaseProvider.php::provideNoteCreateInvalidData() + // Validation error message asserted via NoteProvider.php $validationResult = new ValidationResult('There is something in the note data that couldn\'t be validated'); if ($note->isMain === 1) { @@ -65,7 +65,7 @@ public function validateNoteCreation(NoteData $note): void */ public function validateNoteUpdate(NoteData $note): void { - // Exact validation error tested in NoteCaseProvider.php::provideNoteCreateInvalidData() + // Validation error message asserted via NoteProvider.php $validationResult = new ValidationResult('There is something in the note data that couldn\'t be validated'); if (null !== $note->message) { diff --git a/tests/Integration/Note/NoteCreateActionTest.php b/tests/Integration/Note/NoteCreateActionTest.php index 7cd627b8..28b40df9 100644 --- a/tests/Integration/Note/NoteCreateActionTest.php +++ b/tests/Integration/Note/NoteCreateActionTest.php @@ -145,11 +145,8 @@ public function testNoteSubmitCreateActionUnauthenticated(): void /** * Test note creation on client-read page with invalid data. - * Fixture dependencies: - * - 1 client - * - 1 user linked to client. * - * @dataProvider \App\Test\Provider\Note\NoteProvider::clientCreationInvalidNoteAndExpectedResponseProvider() + * @dataProvider \App\Test\Provider\Note\NoteProvider::invalidNoteCreationAndExpectedResponseProvider() * * @param array $invalidRequestBody * @param bool $existingMainNote @@ -157,7 +154,7 @@ public function testNoteSubmitCreateActionUnauthenticated(): void * * @return void */ - public function testNoteSubmitCreateActionInvalid( + public function testNoteCreateSubmitActionInvalid( array $invalidRequestBody, bool $existingMainNote, array $expectedResponseData diff --git a/tests/Provider/Note/NoteProvider.php b/tests/Provider/Note/NoteProvider.php index aaeed24b..20ac7e21 100644 --- a/tests/Provider/Note/NoteProvider.php +++ b/tests/Provider/Note/NoteProvider.php @@ -313,7 +313,7 @@ public static function noteCUDUserAttributesAndExpectedResultProvider(): array * * @return array */ - public static function clientCreationInvalidNoteAndExpectedResponseProvider(): array + public static function invalidNoteCreationAndExpectedResponseProvider(): array { return [ [