From 916571674c940125f841cad55dd5c89f0cc476c3 Mon Sep 17 00:00:00 2001 From: Samuel Gfeller Date: Sun, 12 Feb 2023 15:46:58 +0100 Subject: [PATCH] Attempt to fix incorrect deployment js import version --- config/defaults.php | 2 +- .../authentication/password-reset-main.js | 2 +- .../password-strength-checker.js | 2 +- .../client/create/client-create-main.js | 10 ++++---- .../client/create/client-create-modal.html.js | 8 +++---- .../list/client-list-content-placeholder.js | 2 +- .../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 ++--- .../client/note/client-read-create-note.js | 8 +++---- .../client/note/client-read-delete-note.js | 6 ++--- .../client-read-note-event-listener-setup.js | 10 ++++---- .../client-read-note-loading-placeholder.js | 2 +- .../client/note/client-read-note-loading.js | 12 +++++----- .../note/client-read-save-existing-note.js | 6 ++--- .../note/client-read-template-note.html.js | 2 +- public/assets/client/read/client-read-main.js | 18 +++++++-------- .../read/client-read-save-dropdown-change.js | 4 ++-- .../update/client-update-contenteditable.js | 8 +++---- .../read/update/client-update-dropdown.js | 4 ++-- public/assets/dashboard/dashboard-main.js | 10 ++++---- .../general/ajax/ajax-util/fail-handler.js | 4 ++-- public/assets/general/ajax/fetch-data.js | 4 ++-- .../general/ajax/submit-delete-request.js | 4 ++-- .../ajax/submit-field-change-with-flash.js | 6 ++--- .../assets/general/ajax/submit-update-data.js | 4 ++-- .../open-link-on-html-element.js | 2 +- public/assets/general/general-js/default.js | 8 +++---- .../contenteditable/contenteditable-main.js | 2 +- .../page-component/modal/dropdown-request.js | 4 ++-- .../modal/modal-submit-request.js | 8 +++---- .../assets/general/template/template-util.js | 2 +- public/assets/user/create/user-create-main.js | 8 +++---- .../user/create/user-create-modal.html.js | 10 ++++---- .../user/list/user-list-card-dom-appending.js | 2 +- .../assets/user/list/user-list-card.html.js | 4 ++-- .../list/user-list-content-placeholder.js | 2 +- public/assets/user/list/user-list-loading.js | 12 +++++----- public/assets/user/list/user-list-main.js | 2 +- public/assets/user/profile.js | 4 ++-- .../user/read/user-activity/activity-main.js | 6 ++--- .../assets/user/read/user-read-update-main.js | 16 ++++++------- .../user/read/user-update-contenteditable.js | 6 ++--- .../user/update/change-password-modal.html.js | 4 ++-- readme.md | 23 ++++++++++++------- 45 files changed, 146 insertions(+), 139 deletions(-) diff --git a/config/defaults.php b/config/defaults.php index 65aab4bb..450d1edc 100644 --- a/config/defaults.php +++ b/config/defaults.php @@ -29,7 +29,7 @@ $settings['deployment'] = [ // Version `null` or string. If JsImportVersionAdder is enabled, `null` removes all query param versions from js imports // $settings['deployment']['version'] = random_int(0, 100); - 'version' => '0.2.0', + 'version' => '0.1.0', 'assetsPath' => __DIR__ . '/../public/assets', ]; diff --git a/public/assets/authentication/password-reset-main.js b/public/assets/authentication/password-reset-main.js index 20393698..9d24ee28 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.2.0"; +import {addPasswordStrengthCheck} from "./password-strength-checker.js?v=0.1.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 b6e7518d..98e9f4eb 100644 --- a/public/assets/authentication/password-strength-checker.js +++ b/public/assets/authentication/password-strength-checker.js @@ -1,5 +1,5 @@ // Init vars -import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=0.2.0"; +import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=0.1.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 787dead0..073d42e4 100644 --- a/public/assets/client/create/client-create-main.js +++ b/public/assets/client/create/client-create-main.js @@ -1,8 +1,8 @@ -import {displayClientCreateModal} from "./client-create-modal.html.js?v=0.2.0"; -import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.2.0"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.2.0"; -import {displayValidationErrorMessage} from "../../general/validation/form-validation.js?v=0.2.0"; -import {fetchAndLoadClients} from "../list/client-list-loading.js?v=0.2.0"; +import {displayClientCreateModal} from "./client-create-modal.html.js?v=0.1.0"; +import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.1.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.1.0"; +import {displayValidationErrorMessage} from "../../general/validation/form-validation.js?v=0.1.0"; +import {fetchAndLoadClients} from "../list/client-list-loading.js?v=0.1.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 e27dfb96..82773cd9 100644 --- a/public/assets/client/create/client-create-modal.html.js +++ b/public/assets/client/create/client-create-modal.html.js @@ -1,7 +1,7 @@ -import {createModal} from "../../general/page-component/modal/modal.js?v=0.2.0"; -import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.2.0"; -import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.2.0"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.2.0"; +import {createModal} from "../../general/page-component/modal/modal.js?v=0.1.0"; +import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.1.0"; +import {getDropdownAsHtmlOptions, getRadioButtonsAsHtml} from "../../general/template/template-util.js?v=0.1.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.1.0"; /** * Create and display modal box to create a new client diff --git a/public/assets/client/list/client-list-content-placeholder.js b/public/assets/client/list/client-list-content-placeholder.js index d13c9093..a22455ab 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.2.0"; +import {getClientProfileCardLoadingPlaceholderHtml} from "./client-list-profile-card.html.js?v=0.1.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 338c500c..686b1626 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.2.0"; +import {getClientProfileCardHtml} from "./client-list-profile-card.html.js?v=0.1.0"; import { displayClientProfileCardLoadingPlaceholder, removeClientCardContentPlaceholder -} from "./client-list-content-placeholder.js?v=0.2.0"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.2.0"; +} from "./client-list-content-placeholder.js?v=0.1.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=0.1.0"; import { disableMouseWheelClickScrolling, openLinkOnHtmlElement -} from "../../general/event-handler/open-link-on-html-element.js?v=0.2.0"; +} from "../../general/event-handler/open-link-on-html-element.js?v=0.1.0"; import { triggerClickOnHtmlElementEnterKeypress -} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.2.0"; -import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.2.0"; +} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.1.0"; +import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.1.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 608094ff..a87c4947 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.2.0"; -import {initFilterChipEventListeners} from "../../general/page-component/filter-chip/filter-chip.js?v=0.2.0"; +import {fetchAndLoadClients, fetchAndLoadClientsEventHandler} from "./client-list-loading.js?v=0.1.0"; +import {initFilterChipEventListeners} from "../../general/page-component/filter-chip/filter-chip.js?v=0.1.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 a5be64ac..eabeac78 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.2.0"; -import {escapeHtml} from "../../general/general-js/functions.js?v=0.2.0"; -import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.2.0"; +import {getAvatarPath} from "../util/client-template-util.js?v=0.1.0"; +import {escapeHtml} from "../../general/general-js/functions.js?v=0.1.0"; +import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.1.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 e9e62c70..b2a31ea2 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.2.0"; +import {basePath} from "../../general/general-js/config.js?v=0.1.0"; import { addDeleteNoteBtnEventListener, addHideNoteBtnEventListener, addTextareaInputEventListener, hideCheckmarkLoader, toggleReadOnlyAndBtnAboveNote -} from "./client-read-note-event-listener-setup.js?v=0.2.0"; -import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.2.0"; -import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.2.0"; +} from "./client-read-note-event-listener-setup.js?v=0.1.0"; +import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.1.0"; +import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.1.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 c0afc3f0..7193da57 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.2.0"; -import {hideCheckmarkLoader} from "./client-read-note-event-listener-setup.js?v=0.2.0"; -import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.2.0"; +import {basePath} from "../../general/general-js/config.js?v=0.1.0"; +import {hideCheckmarkLoader} from "./client-read-note-event-listener-setup.js?v=0.1.0"; +import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.1.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 f0d5c7e8..a2b805f1 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.2.0"; -import {disableHideCheckMarkTimeoutOnCreation, insertNewNoteToDb} from "./client-read-create-note.js?v=0.2.0"; -import {deleteNoteRequestToDb} from "./client-read-delete-note.js?v=0.2.0"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.2.0"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.2.0"; +import {disableHideCheckMarkTimeoutOnUpdate, saveNoteChangeToDb} from "./client-read-save-existing-note.js?v=0.1.0"; +import {disableHideCheckMarkTimeoutOnCreation, insertNewNoteToDb} from "./client-read-create-note.js?v=0.1.0"; +import {deleteNoteRequestToDb} from "./client-read-delete-note.js?v=0.1.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.1.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.1.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 296a3d5a..b88977d7 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.2.0"; +import {getClientNoteLoadingPlaceholderHtml} from "./client-read-template-note.html.js?v=0.1.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 d9e4239c..f9db8297 100644 --- a/public/assets/client/note/client-read-note-loading.js +++ b/public/assets/client/note/client-read-note-loading.js @@ -1,12 +1,12 @@ -import {getNoteHtml} from "./client-read-template-note.html.js?v=0.2.0"; +import {getNoteHtml} from "./client-read-template-note.html.js?v=0.1.0"; import { displayClientNoteLoadingPlaceholder, removeClientNoteContentPlaceholder -} from "./client-read-note-loading-placeholder.js?v=0.2.0"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.2.0"; -import {initNotesEventListeners} from "./client-read-note-event-listener-setup.js?v=0.2.0"; -import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.2.0"; -import {scrollToAnchor} from "../../general/page-behaviour/scroll-to-anchor.js?v=0.2.0"; +} from "./client-read-note-loading-placeholder.js?v=0.1.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=0.1.0"; +import {initNotesEventListeners} from "./client-read-note-event-listener-setup.js?v=0.1.0"; +import {initAutoResizingTextareas} from "../../general/page-component/textarea/auto-resizing-textarea.js?v=0.1.0"; +import {scrollToAnchor} from "../../general/page-behaviour/scroll-to-anchor.js?v=0.1.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 3a2295d2..e28a2cbb 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.2.0"; +import {basePath} from "../../general/general-js/config.js?v=0.1.0"; import { changeUserIsTyping, hideCheckmarkLoader, userIsTypingOnNoteId -} from "./client-read-note-event-listener-setup.js?v=0.2.0"; -import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.2.0"; +} from "./client-read-note-event-listener-setup.js?v=0.1.0"; +import {handleFail, removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.1.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 c3daceae..6a68628f 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.2.0"; +import {escapeHtml} from "../../general/general-js/functions.js?v=0.1.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 19b51936..ff4e9ae5 100644 --- a/public/assets/client/read/client-read-main.js +++ b/public/assets/client/read/client-read-main.js @@ -1,12 +1,12 @@ -import {makeClientFieldEditable} from "./update/client-update-contenteditable.js?v=0.2.0"; -import {makeFieldSelectValueEditable} from "./update/client-update-dropdown.js?v=0.2.0"; -import {loadAvailablePersonalInfoIconsDiv} from "./client-read-personal-info.js?v=0.2.0"; -import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.2.0"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.2.0"; -import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.2.0"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.2.0"; -import {fetchAndLoadClientNotes} from "../note/client-read-note-loading.js?v=0.2.0"; -import {addNewNoteTextarea} from "../note/client-read-create-note.js?v=0.2.0"; +import {makeClientFieldEditable} from "./update/client-update-contenteditable.js?v=0.1.0"; +import {makeFieldSelectValueEditable} from "./update/client-update-dropdown.js?v=0.1.0"; +import {loadAvailablePersonalInfoIconsDiv} from "./client-read-personal-info.js?v=0.1.0"; +import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.1.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.1.0"; +import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.1.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.1.0"; +import {fetchAndLoadClientNotes} from "../note/client-read-note-loading.js?v=0.1.0"; +import {addNewNoteTextarea} from "../note/client-read-create-note.js?v=0.1.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 f1e5532e..1e19c806 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.2.0"; -import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.2.0"; +import {basePath} from "../../general/general-js/config.js?v=0.1.0"; +import {handleFail} from "../../general/ajax/ajax-util/fail-handler.js?v=0.1.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 efcbcb56..e40ea0fa 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.2.0"; +import {removeValidationErrorMessages} from "../../../general/ajax/ajax-util/fail-handler.js?v=0.1.0"; import { addIconToAvailableDiv, removeIconFromAvailableDiv, showPersonalInfoContainerIfHidden -} from "../client-read-personal-info.js?v=0.2.0"; +} from "../client-read-personal-info.js?v=0.1.0"; import { contentEditableFieldValueIsValid, disableEditableField, makeFieldEditable -} from "../../../general/page-component/contenteditable/contenteditable-main.js?v=0.2.0"; -import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.2.0"; +} from "../../../general/page-component/contenteditable/contenteditable-main.js?v=0.1.0"; +import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.1.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 22a1cfe9..06cdb62e 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.2.0"; -import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.2.0"; +} from "../client-read-personal-info.js?v=0.1.0"; +import {submitUpdate} from "../../../general/ajax/submit-update-data.js?v=0.1.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 8acf1de5..20209378 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.2.0"; -import {fetchAndLoadClientNotes} from "../client/note/client-read-note-loading.js?v=0.2.0"; -import {initFilterChipEventListeners} from "../general/page-component/filter-chip/filter-chip.js?v=0.2.0"; -import {loadUserActivities} from "../user/read/user-activity/activity-main.js?v=0.2.0"; -import {submitUpdate} from "../general/ajax/submit-update-data.js?v=0.2.0"; +import {fetchAndLoadClients} from "../client/list/client-list-loading.js?v=0.1.0"; +import {fetchAndLoadClientNotes} from "../client/note/client-read-note-loading.js?v=0.1.0"; +import {initFilterChipEventListeners} from "../general/page-component/filter-chip/filter-chip.js?v=0.1.0"; +import {loadUserActivities} from "../user/read/user-activity/activity-main.js?v=0.1.0"; +import {submitUpdate} from "../general/ajax/submit-update-data.js?v=0.1.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 5edc4617..4ff72d2a 100644 --- a/public/assets/general/ajax/ajax-util/fail-handler.js +++ b/public/assets/general/ajax/ajax-util/fail-handler.js @@ -1,5 +1,5 @@ -import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.2.0"; -import {displayFlashMessage} from "../../page-component/flash-message/flash-message.js?v=0.2.0"; +import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.1.0"; +import {displayFlashMessage} from "../../page-component/flash-message/flash-message.js?v=0.1.0"; /** * If a request fails this function can be called which gives the user diff --git a/public/assets/general/ajax/fetch-data.js b/public/assets/general/ajax/fetch-data.js index f4a286a1..de078bf3 100644 --- a/public/assets/general/ajax/fetch-data.js +++ b/public/assets/general/ajax/fetch-data.js @@ -1,5 +1,5 @@ -import {handleFail} from "./ajax-util/fail-handler.js?v=0.2.0"; -import {basePath} from "../general-js/config.js?v=0.2.0"; +import {handleFail} from "./ajax-util/fail-handler.js?v=0.1.0"; +import {basePath} from "../general-js/config.js?v=0.1.0"; /** * Sends a GET request and returns result in promise diff --git a/public/assets/general/ajax/submit-delete-request.js b/public/assets/general/ajax/submit-delete-request.js index ea12785c..81f2d8dd 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.2.0"; -import {handleFail} from "./ajax-util/fail-handler.js?v=0.2.0"; +import {basePath} from "../general-js/config.js?v=0.1.0"; +import {handleFail} from "./ajax-util/fail-handler.js?v=0.1.0"; /** diff --git a/public/assets/general/ajax/submit-field-change-with-flash.js b/public/assets/general/ajax/submit-field-change-with-flash.js index dee42292..7f7e486c 100644 --- a/public/assets/general/ajax/submit-field-change-with-flash.js +++ b/public/assets/general/ajax/submit-field-change-with-flash.js @@ -1,7 +1,7 @@ // In square brackets to be evaluated -import {submitUpdate} from "./submit-update-data.js?v=0.2.0"; -import {displayFlashMessage} from "../page-component/flash-message/flash-message.js?v=0.2.0"; -import {removeSpecialChars} from "../general-js/functions.js?v=0.2.0"; +import {submitUpdate} from "./submit-update-data.js?v=0.1.0"; +import {displayFlashMessage} from "../page-component/flash-message/flash-message.js?v=0.1.0"; +import {removeSpecialChars} from "../general-js/functions.js?v=0.1.0"; /** * diff --git a/public/assets/general/ajax/submit-update-data.js b/public/assets/general/ajax/submit-update-data.js index 5a31a0c5..af54f772 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.2.0"; -import {handleFail, removeValidationErrorMessages} from "./ajax-util/fail-handler.js?v=0.2.0"; +import {basePath} from "../general-js/config.js?v=0.1.0"; +import {handleFail, removeValidationErrorMessages} from "./ajax-util/fail-handler.js?v=0.1.0"; /** 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 f9ef12d3..00e3d8c0 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.2.0"; +import {basePath} from "../general-js/config.js?v=0.1.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 1bc92086..5d167f2a 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.2.0"; -import {initAutoResizingTextareas} from "../page-component/textarea/auto-resizing-textarea.js?v=0.2.0"; -import {scrollToAnchor} from "../page-behaviour/scroll-to-anchor.js?v=0.2.0"; -import {countDownThrottleTimer} from "../../authentication/throttle-timer.js?v=0.2.0"; +import {displayServerSideFlashMessages} from "../page-component/flash-message/flash-message.js?v=0.1.0"; +import {initAutoResizingTextareas} from "../page-component/textarea/auto-resizing-textarea.js?v=0.1.0"; +import {scrollToAnchor} from "../page-behaviour/scroll-to-anchor.js?v=0.1.0"; +import {countDownThrottleTimer} from "../../authentication/throttle-timer.js?v=0.1.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 326f1cac..c622c6b4 100644 --- a/public/assets/general/page-component/contenteditable/contenteditable-main.js +++ b/public/assets/general/page-component/contenteditable/contenteditable-main.js @@ -1,4 +1,4 @@ -import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.2.0"; +import {displayValidationErrorMessage} from "../../validation/form-validation.js?v=0.1.0"; /** * Make field value editable diff --git a/public/assets/general/page-component/modal/dropdown-request.js b/public/assets/general/page-component/modal/dropdown-request.js index fcdfeb68..dac19e07 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.2.0"; -import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.2.0"; +import {basePath} from "../../general-js/config.js?v=0.1.0"; +import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.1.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 164b6143..12f3d87e 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.2.0"; -import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.2.0"; -import {closeModal} from "./modal.js?v=0.2.0"; -import {basePath} from "../../general-js/config.js?v=0.2.0"; +import {getFormData, toggleEnableDisableForm} from "./modal-form.js?v=0.1.0"; +import {handleFail} from "../../ajax/ajax-util/fail-handler.js?v=0.1.0"; +import {closeModal} from "./modal.js?v=0.1.0"; +import {basePath} from "../../general-js/config.js?v=0.1.0"; /** * Check form validity, disable form, submit modal form and close it on success diff --git a/public/assets/general/template/template-util.js b/public/assets/general/template/template-util.js index 7347bcf0..ec17fb9c 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.2.0"; +import {escapeHtml} from "../general-js/functions.js?v=0.1.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 c8b52dca..763f4743 100644 --- a/public/assets/user/create/user-create-main.js +++ b/public/assets/user/create/user-create-main.js @@ -1,7 +1,7 @@ -import {displayUserCreateModal} from "./user-create-modal.html.js?v=0.2.0"; -import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.2.0"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.2.0"; -import {loadUserList} from "../list/user-list-loading.js?v=0.2.0"; +import {displayUserCreateModal} from "./user-create-modal.html.js?v=0.1.0"; +import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.1.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.1.0"; +import {loadUserList} from "../list/user-list-loading.js?v=0.1.0"; document.querySelector('#create-user-btn').addEventListener('click', displayUserCreateModal); diff --git a/public/assets/user/create/user-create-modal.html.js b/public/assets/user/create/user-create-modal.html.js index d591d923..33343867 100644 --- a/public/assets/user/create/user-create-modal.html.js +++ b/public/assets/user/create/user-create-modal.html.js @@ -1,8 +1,8 @@ -import {createModal} from "../../general/page-component/modal/modal.js?v=0.2.0"; -import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.2.0"; -import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.2.0"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.2.0"; -import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.2.0"; +import {createModal} from "../../general/page-component/modal/modal.js?v=0.1.0"; +import {requestDropdownOptions} from "../../general/page-component/modal/dropdown-request.js?v=0.1.0"; +import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.1.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.1.0"; +import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.1.0"; /** * Create and display modal box to create a new client 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 d8660b80..54dcf392 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.2.0"; +import {getUserCardHtml} from "./user-list-card.html.js?v=0.1.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 c07ca519..518b81f0 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.2.0"; -import {escapeHtml} from "../../general/general-js/functions.js?v=0.2.0"; +import {getDropdownAsHtmlOptions} from "../../general/template/template-util.js?v=0.1.0"; +import {escapeHtml} from "../../general/general-js/functions.js?v=0.1.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 e72aea84..7c7bf33a 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.2.0"; +import {getUserCardLoadingPlaceholderHtml} from "./user-list-card.html.js?v=0.1.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 83d4252b..251b6f38 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.2.0"; -import {fetchData} from "../../general/ajax/fetch-data.js?v=0.2.0"; -import {addUsersToDom} from "./user-list-card-dom-appending.js?v=0.2.0"; +} from "./user-list-content-placeholder.js?v=0.1.0"; +import {fetchData} from "../../general/ajax/fetch-data.js?v=0.1.0"; +import {addUsersToDom} from "./user-list-card-dom-appending.js?v=0.1.0"; import { disableMouseWheelClickScrolling, openLinkOnHtmlElement -} from "../../general/event-handler/open-link-on-html-element.js?v=0.2.0"; +} from "../../general/event-handler/open-link-on-html-element.js?v=0.1.0"; import { triggerClickOnHtmlElementEnterKeypress -} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.2.0"; -import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.2.0"; +} from "../../general/event-handler/trigger-click-on-enter-keypress.js?v=0.1.0"; +import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.1.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 15b596f1..fe531ba2 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.2.0"; +import {loadUserList} from "./user-list-loading.js?v=0.1.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/profile.js b/public/assets/user/profile.js index 9b11f41c..78038833 100644 --- a/public/assets/user/profile.js +++ b/public/assets/user/profile.js @@ -1,6 +1,6 @@ // First name -import {createAlertModal} from "../general/page-component/modal/alert-modal.js?v=0.2.0"; -import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=0.2.0"; +import {createAlertModal} from "../general/page-component/modal/alert-modal.js?v=0.1.0"; +import {handleFail} from "../general/ajax/ajax-util/fail-handler.js?v=0.1.0"; let firstNameEditIco = document.getElementById('edit-first-name-ico'); firstNameEditIco.addEventListener('click', function () { diff --git a/public/assets/user/read/user-activity/activity-main.js b/public/assets/user/read/user-activity/activity-main.js index c0df622b..723f5a79 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.2.0"; -import {getUserActivityListHtml} from "./user-activtiy-list.html.js?v=0.2.0"; -import {initCollapsible} from "../../../general/page-component/collapsible/collapsible.js?v=0.2.0"; +import {fetchData} from "../../../general/ajax/fetch-data.js?v=0.1.0"; +import {getUserActivityListHtml} from "./user-activtiy-list.html.js?v=0.1.0"; +import {initCollapsible} from "../../../general/page-component/collapsible/collapsible.js?v=0.1.0"; /** diff --git a/public/assets/user/read/user-read-update-main.js b/public/assets/user/read/user-read-update-main.js index f7bf1e6e..d1da69fc 100644 --- a/public/assets/user/read/user-read-update-main.js +++ b/public/assets/user/read/user-read-update-main.js @@ -1,11 +1,11 @@ -import {makeUserFieldEditable} from "./user-update-contenteditable.js?v=0.2.0"; -import {displayChangePasswordModal} from "../update/change-password-modal.html.js?v=0.2.0"; -import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.2.0"; -import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.2.0"; -import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.2.0"; -import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.2.0"; -import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.2.0"; -import {loadUserActivities} from "./user-activity/activity-main.js?v=0.2.0"; +import {makeUserFieldEditable} from "./user-update-contenteditable.js?v=0.1.0"; +import {displayChangePasswordModal} from "../update/change-password-modal.html.js?v=0.1.0"; +import {displayFlashMessage} from "../../general/page-component/flash-message/flash-message.js?v=0.1.0"; +import {submitModalForm} from "../../general/page-component/modal/modal-submit-request.js?v=0.1.0"; +import {submitFieldChangeWithFlash} from "../../general/ajax/submit-field-change-with-flash.js?v=0.1.0"; +import {submitDelete} from "../../general/ajax/submit-delete-request.js?v=0.1.0"; +import {createAlertModal} from "../../general/page-component/modal/alert-modal.js?v=0.1.0"; +import {loadUserActivities} from "./user-activity/activity-main.js?v=0.1.0"; const userId = document.getElementById('user-id').value; diff --git a/public/assets/user/read/user-update-contenteditable.js b/public/assets/user/read/user-update-contenteditable.js index 85697754..9afd9939 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.2.0"; +import {removeValidationErrorMessages} from "../../general/ajax/ajax-util/fail-handler.js?v=0.1.0"; import { contentEditableFieldValueIsValid, disableEditableField, makeFieldEditable -} from "../../general/page-component/contenteditable/contenteditable-main.js?v=0.2.0"; -import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.2.0"; +} from "../../general/page-component/contenteditable/contenteditable-main.js?v=0.1.0"; +import {submitUpdate} from "../../general/ajax/submit-update-data.js?v=0.1.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 3e611a69..77572ed2 100644 --- a/public/assets/user/update/change-password-modal.html.js +++ b/public/assets/user/update/change-password-modal.html.js @@ -1,5 +1,5 @@ -import {createModal} from "../../general/page-component/modal/modal.js?v=0.2.0"; -import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.2.0"; +import {createModal} from "../../general/page-component/modal/modal.js?v=0.1.0"; +import {addPasswordStrengthCheck} from "../../authentication/password-strength-checker.js?v=0.1.0"; /** * Create and display modal box to change password diff --git a/readme.md b/readme.md index 6d3a05f6..1b1616a1 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ # Slim example project Lightweight example project of a backend and frontend done with the [Slim](https://www.slimframework.com/) -micro-framework. +micro-framework. It can be used as a template when creating new projects or just serve as inspiration. ### [Demo](https://demo.slim-example-project.samuel-gfeller.ch/) @@ -41,7 +41,8 @@ feature to quickly create a repository with the code of this project. Checkout this repository in your preferred IDE before proceeding. ### 2. Set up the database -Rename the file `config/env.example.php` to `env.php` and fill in your database credentials. +After opening the project in your IDE, rename the file `config/env.example.php` to `env.php` +and fill in your database credentials. Then, create your database and update the `config/env.dev.php` file with the name of your database, like this: @@ -80,7 +81,8 @@ composer seed:minimal **Deployment** If you are not planning on -deploying your app at this time, delete or comment out the contents of the `master.yml` file. +deploying your app at this time, delete or comment out the contents of the +`.github/workflows/master.yml` file. To deploy your app, update the `.github/workflows/master.yml` file according to your needs and add your server's credentials to GitHub's @@ -89,8 +91,8 @@ add your server's credentials to GitHub's **Build testing** To run the project's tests automatically when pushing, update the `.github/workflows/develop.yml` file. -Replace the matrix value "test-database" `slim_example_project_test` with the name of -your test database as specified in `config/env.test.php`. +**Replace the matrix value "test-database" `slim_example_project_test` with the name of +your test database** as specified in `config/env.test.php`. If you are not using SonarCloud, remove the "SonarCloud Scan" step from the workflow. ### Done! @@ -102,8 +104,12 @@ directory and share it on a version control such as GitHub. ## Functionalities -It will grow into a usable application for non-profit organizations that need a platform to manage the people they -are helping. +The goal of this project is to provide a comprehensive set of versatile features that can +serve as examples for learning or be adapted for other use cases when building new +applications. +It is currently designed for non-profit organizations or foundations that require a +platform for managing the peoples they're helping and maintaining a record of communication +through notes. This project is done in collaboration with the foundation Retter in der Not. * Authentication (login) @@ -115,6 +121,7 @@ This project is done in collaboration with the foundation Retter in der Not. captcha) - [docs](https://github.com/samuelgfeller/slim-example-project/blob/master/docs/security-concept.md) * [Custom error handler](https://github.com/samuelgfeller/slim-example-project/blob/master/docs/error-handling.md) * Integration testing with fixtures and data providers +* Database migrations ## Technologies @@ -122,7 +129,7 @@ This project is done in collaboration with the foundation Retter in der Not. #### Languages & libraries -Mainly **Vanilla JS** to be as "native" as possible and E6 JavaScript supports a lot +Mainly **Vanilla JS** to be as "native" as possible and E6 JavaScript supports a lot. #### Template renderer: **[slimphp/PHP-View](https://github.com/slimphp/PHP-View)**