From c874496f3c58a52e10982d721bce3955121aa617 Mon Sep 17 00:00:00 2001 From: robotichead Date: Sun, 31 Mar 2024 13:12:46 +1100 Subject: [PATCH 01/10] Bugfix - nearbeach-1323 Uploading document to a kanban card - causes an error --- src/js/components/modules/wizards/AddLinkWizard.vue | 9 +++++---- .../components/modules/wizards/UploadDocumentWizard.vue | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/components/modules/wizards/AddLinkWizard.vue b/src/js/components/modules/wizards/AddLinkWizard.vue index f57403564..276f4a1e3 100644 --- a/src/js/components/modules/wizards/AddLinkWizard.vue +++ b/src/js/components/modules/wizards/AddLinkWizard.vue @@ -103,6 +103,7 @@ import {mapGetters} from "vuex"; //Mixins import iconMixin from "../../../mixins/iconMixin"; +import reopenCardInformation from "../../../mixins/reopenCardInformation" //Validation import useVuelidate from "@vuelidate/core"; @@ -110,9 +111,6 @@ import {required, url} from "@vuelidate/validators"; import ValidationRendering from "../../validation/ValidationRendering.vue"; import {Modal} from "bootstrap"; -//Mixins -import reopenCardInformation from "../../../mixins/reopenCardInformation" - export default { name: "AddLinkWizard", setup() { @@ -132,7 +130,10 @@ export default { default: 0, }, }, - mixins: [iconMixin], + mixins: [ + iconMixin, + reopenCardInformation, + ], data() { return { linkModel: "", diff --git a/src/js/components/modules/wizards/UploadDocumentWizard.vue b/src/js/components/modules/wizards/UploadDocumentWizard.vue index 778e1d32e..c124c05f9 100644 --- a/src/js/components/modules/wizards/UploadDocumentWizard.vue +++ b/src/js/components/modules/wizards/UploadDocumentWizard.vue @@ -184,7 +184,6 @@ export default { name: "UploadDocumentWizard", components: { Icon, - reopenCardInformation, }, props: { overrideDestination: { @@ -196,7 +195,7 @@ export default { default: 0, }, }, - mixins: [iconMixin], + mixins: [iconMixin, reopenCardInformation], data() { return { disableUploadButton: true, From 80a3a86fd77894601f46e842f8769f3cf0582cd4 Mon Sep 17 00:00:00 2001 From: robotichead Date: Sun, 31 Mar 2024 13:31:11 +1100 Subject: [PATCH 02/10] Bugfix - nearbeach-1319 Implement a colour for the failed change tasks --- .../request_for_change/modules/ChangeTaskList.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/components/request_for_change/modules/ChangeTaskList.vue b/src/js/components/request_for_change/modules/ChangeTaskList.vue index 99b7e967e..4e7c8ed33 100644 --- a/src/js/components/request_for_change/modules/ChangeTaskList.vue +++ b/src/js/components/request_for_change/modules/ChangeTaskList.vue @@ -13,8 +13,8 @@
+ v-bind:class="detailClasses(changeTask.change_task_status)" + > @@ -326,6 +326,14 @@ export default { }); }); }, + detailClasses(status) { + //If status is fail (9), then return the change-task--fail + if (parseInt(status) === 9) { + return "row change-task--detail bg-danger"; + } + + return "row change-task--detail"; + }, getRunSheetList() { this.axios.post( `${this.rootUrl}rfc_information/${this.locationId}/change_task_list/` From 323ce72ed4726a46f9663d92230c00e8b1dddf50 Mon Sep 17 00:00:00 2001 From: Luke Clarke Date: Mon, 1 Apr 2024 13:34:54 +1100 Subject: [PATCH 03/10] Bugfix - nearbeach-1318 Saving Change Task will cause data issues --- NearBeach/forms.py | 6 +++--- NearBeach/views/change_task_views.py | 7 ------- .../components/change_task/ChangeTaskInformation.vue | 10 +++++----- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/NearBeach/forms.py b/NearBeach/forms.py index 1a037e1f4..1a71fbf72 100644 --- a/NearBeach/forms.py +++ b/NearBeach/forms.py @@ -243,13 +243,13 @@ class Meta: fields = [ "change_task_assigned_user", "change_task_title", - "change_task_description", + # "change_task_description", "change_task_start_date", "change_task_end_date", "change_task_seconds", - "change_task_required_by", + # "change_task_required_by", "change_task_qa_user", - "is_downtime", + # "is_downtime", ] diff --git a/NearBeach/views/change_task_views.py b/NearBeach/views/change_task_views.py index 8465e6e39..fcdfdc662 100644 --- a/NearBeach/views/change_task_views.py +++ b/NearBeach/views/change_task_views.py @@ -102,18 +102,11 @@ def change_task_save(request, change_task_id, *args, **kwargs): # Update the values change_task_update.change_task_title = form.cleaned_data["change_task_title"] - change_task_update.change_task_description = form.cleaned_data[ - "change_task_description" - ] change_task_update.change_task_start_date = form.cleaned_data[ "change_task_start_date" ] change_task_update.change_task_end_date = form.cleaned_data["change_task_end_date"] change_task_update.change_task_seconds = form.cleaned_data["change_task_seconds"] - change_task_update.change_task_required_by = form.cleaned_data[ - "change_task_required_by" - ] - change_task_update.is_downtime = form.cleaned_data["is_downtime"] change_task_update.change_task_qa_user = form.cleaned_data["change_task_qa_user"] change_task_update.change_task_assigned_user = form.cleaned_data[ "change_task_assigned_user" diff --git a/src/js/components/change_task/ChangeTaskInformation.vue b/src/js/components/change_task/ChangeTaskInformation.vue index a1e130359..d8f354d65 100644 --- a/src/js/components/change_task/ChangeTaskInformation.vue +++ b/src/js/components/change_task/ChangeTaskInformation.vue @@ -315,11 +315,11 @@ export default { this.assignedUserModel ); data_to_send.set("change_task_qa_user", this.qaUserModel); - data_to_send.set( - "change_task_required_by", - this.changeStakeholderModel - ); - data_to_send.set("is_downtime", this.changeIsDowntimeModel); + // data_to_send.set( + // "change_task_required_by", + // this.changeStakeholderModel + // ); + // data_to_send.set("is_downtime", this.changeIsDowntimeModel); this.axios .post( From ffec2d4a2da8dad5c6ebc7420402a9604a2455e8 Mon Sep 17 00:00:00 2001 From: nearbeach Date: Mon, 1 Apr 2024 17:05:36 +1100 Subject: [PATCH 04/10] Bugfix - nearbeach-1307 New RFC - data loss when going previous --- .../NewRequestForChange.vue | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/js/components/request_for_change/NewRequestForChange.vue b/src/js/components/request_for_change/NewRequestForChange.vue index acbb6d019..227e879f3 100644 --- a/src/js/components/request_for_change/NewRequestForChange.vue +++ b/src/js/components/request_for_change/NewRequestForChange.vue @@ -13,7 +13,7 @@ v-on:update_values="updateValues($event)" v-on:update_validation="updateValidation($event)" v-bind:static-url="staticUrl" - v-if="currentTab===0" + v-bind:style="displayTab(0)" > @@ -23,7 +23,7 @@ v-bind:user-group-results="userGroupResults" v-on:update_validation="updateValidation($event)" v-on:update_values="updateValues($event)" - v-if="currentTab===1" + v-bind:style="displayTab(1)" > @@ -31,7 +31,7 @@ v-bind:uuid="uuid" v-on:update_values="updateValues($event)" v-on:update_validation="updateValidation($event)" - v-if="currentTab===2" + v-bind:style="displayTab(2)" > @@ -39,7 +39,7 @@ v-bind:uuid="uuid" v-on:update_values="updateValues($event)" v-on:update_validation="updateValidation($event)" - v-if="currentTab===3" + v-bind:style="displayTab(3)" > @@ -47,7 +47,7 @@ v-bind:uuid="uuid" v-on:update_values="updateValues($event)" v-on:update_validation="updateValidation($event)" - v-if="currentTab===4" + v-bind:style="displayTab(4)" > @@ -55,7 +55,7 @@ v-bind:uuid="uuid" v-on:update_values="updateValues($event)" v-on:update_validation="updateValidation($event)" - v-if="currentTab===5" + v-bind:style="displayTab(5)" > @@ -178,6 +178,15 @@ export default { }, }), methods: { + displayTab(tab_id) { + if (parseInt(tab_id) === parseInt(this.currentTab)) { + //We want to display this tab + return ""; + } + + //We want to hide this tab + return "display:none;"; + }, nextTab() { //Do nothing if tab >= 5 if (this.currentTab >= 5) return; From 7da59a23c1b9dafe43c01aecc2d74e8c380a8281 Mon Sep 17 00:00:00 2001 From: nearbeach Date: Mon, 1 Apr 2024 17:09:42 +1100 Subject: [PATCH 05/10] Bugfix - nearbeach-1320 Read only user can add object to sprint --- src/js/components/modules/sub_modules/AssignedSprints.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/components/modules/sub_modules/AssignedSprints.vue b/src/js/components/modules/sub_modules/AssignedSprints.vue index 803d4d4f2..8811b6d0f 100644 --- a/src/js/components/modules/sub_modules/AssignedSprints.vue +++ b/src/js/components/modules/sub_modules/AssignedSprints.vue @@ -34,6 +34,7 @@
@@ -103,6 +104,7 @@ export default { destination: "getDestination", locationId: "getLocationId", rootUrl: "getRootUrl", + userLevel: "getUserLevel", }), }, methods: { From 9003322b24668a29c60657f4dbef41b76d351a54 Mon Sep 17 00:00:00 2001 From: nearbeach Date: Mon, 1 Apr 2024 17:12:07 +1100 Subject: [PATCH 06/10] Bugfix - nearbeach-1321 Read only user can untick the 'Is Active' for public links --- src/js/components/modules/sub_modules/ListPublicLinks.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/components/modules/sub_modules/ListPublicLinks.vue b/src/js/components/modules/sub_modules/ListPublicLinks.vue index 9f48b8b8f..787953e7b 100644 --- a/src/js/components/modules/sub_modules/ListPublicLinks.vue +++ b/src/js/components/modules/sub_modules/ListPublicLinks.vue @@ -41,6 +41,7 @@ type="checkbox" v-bind:checked="link.public_link_is_active" v-bind:data-public-link-id="link.public_link_id" + v-bind:disabled="userLevel<=1" v-on:change="updateIsActive" /> From 6e9873537c34b0b9b648031dc21e2b60d12d5d6b Mon Sep 17 00:00:00 2001 From: nearbeach Date: Mon, 1 Apr 2024 18:01:15 +1100 Subject: [PATCH 07/10] Bugfix - nearbeach-1322 Read Only user can update fields of kanban card - no save available --- .../components/card_information/CardDescription.vue | 13 +++++++++++-- src/js/components/card_information/CardDetails.vue | 7 ++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/js/components/card_information/CardDescription.vue b/src/js/components/card_information/CardDescription.vue index fe48b9cf5..bf8679b93 100644 --- a/src/js/components/card_information/CardDescription.vue +++ b/src/js/components/card_information/CardDescription.vue @@ -23,7 +23,7 @@ content_css: `${this.contentCss}` }" v-model="cardDescription" - v-bind:disabled="kanbanStatus === 'Closed'" + v-bind:disabled="editorIsDisabled" />
@@ -76,7 +76,9 @@ export default { }, props: {}, data() { - return {}; + return { + editorIsDisabled: true, + }; }, computed: { ...mapGetters({ @@ -110,5 +112,12 @@ export default { }); }, }, + mounted() { + //BUG - if we use the following condition it won't work. We need to wait at least 500ms before apply it. + //I hate this :'( + setInterval(() => { + this.editorIsDisabled = this.kanbanStatus === "Closed" || this.userLevel <= 1; + }, 500); + } }; diff --git a/src/js/components/card_information/CardDetails.vue b/src/js/components/card_information/CardDetails.vue index e2bd48db0..b27d4e24a 100644 --- a/src/js/components/card_information/CardDetails.vue +++ b/src/js/components/card_information/CardDetails.vue @@ -29,6 +29,7 @@
@@ -46,7 +47,7 @@ @@ -69,7 +70,7 @@ v-bind:options="listColumns" label="column" v-model:value="cardColumn" - :disabled="kanbanStatus === 'Closed'" + :disabled="kanbanStatus === 'Closed' || userLevel <= 1" > @@ -79,7 +80,7 @@ v-bind:options="listLevels" label="level" v-model:value="cardLevel" - :disabled="kanbanStatus === 'Closed'" + :disabled="kanbanStatus === 'Closed' || userLevel <= 1" > From fb82ad7372a2b5a16bfdc88d4bb7e0ee540ab231 Mon Sep 17 00:00:00 2001 From: nearbeach Date: Mon, 1 Apr 2024 18:11:02 +1100 Subject: [PATCH 08/10] Bugfix - nearbeach-1325 Read only user can create tags --- NearBeach/templates/NearBeach/search/search_tags.html | 1 + NearBeach/views/search_views.py | 1 + src/js/components/search/SearchTags.vue | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/NearBeach/templates/NearBeach/search/search_tags.html b/NearBeach/templates/NearBeach/search/search_tags.html index 264d048b7..66b6e94c5 100644 --- a/NearBeach/templates/NearBeach/search/search_tags.html +++ b/NearBeach/templates/NearBeach/search/search_tags.html @@ -3,5 +3,6 @@ {% block content %} {% endblock %} diff --git a/NearBeach/views/search_views.py b/NearBeach/views/search_views.py index 9400d0562..cf7b862e0 100644 --- a/NearBeach/views/search_views.py +++ b/NearBeach/views/search_views.py @@ -632,6 +632,7 @@ def search_tag(request, *args, **kwargs): "need_tinymce": False, "tag_results": serializers.serialize("json", tag_results), "theme": get_theme(request), + "user_level": kwargs["user_level"], } # Send back json data diff --git a/src/js/components/search/SearchTags.vue b/src/js/components/search/SearchTags.vue index bf51f59de..2a4eb8759 100644 --- a/src/js/components/search/SearchTags.vue +++ b/src/js/components/search/SearchTags.vue @@ -46,6 +46,7 @@ href="javascript:void(0)" class="btn btn-primary save-changes" v-on:click="addTag" + v-if="userLevel >= 2" >Add Tag @@ -91,6 +92,10 @@ export default { return []; }, }, + userLevel: { + type: Number, + default: 0, + }, }, data() { return { From 302db8b48f2fca09355041f8587900d0108b81cc Mon Sep 17 00:00:00 2001 From: nearbeach Date: Mon, 1 Apr 2024 18:17:22 +1100 Subject: [PATCH 09/10] Bugfix - nearbeach-1327 Read only can interact with sprint information --- NearBeach/views/sprint_views.py | 2 +- src/js/components/sprints/SprintInformation.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NearBeach/views/sprint_views.py b/NearBeach/views/sprint_views.py index 23cd7fd7f..60d7ce5aa 100644 --- a/NearBeach/views/sprint_views.py +++ b/NearBeach/views/sprint_views.py @@ -278,7 +278,7 @@ def sprint_information(request, sprint_id, *args, **kwargs): "nearbeach_title": f"Sprint Information {sprint_id}", "need_tinymce": False, "sprint_results": json.dumps(list(sprint_results), cls=DjangoJSONEncoder), - "user_level": 4, #TODO: Fix this - as we need to check the permissions + "user_level": kwargs["user_level"], "theme": get_theme(request), # TEMP CODE diff --git a/src/js/components/sprints/SprintInformation.vue b/src/js/components/sprints/SprintInformation.vue index d186c4803..f2173a8c0 100644 --- a/src/js/components/sprints/SprintInformation.vue +++ b/src/js/components/sprints/SprintInformation.vue @@ -72,7 +72,10 @@
-
+