Skip to content

Commit

Permalink
Bugfix - nearbeach-1085 Wide screen kanban - UI/UX - switch to enable…
Browse files Browse the repository at this point in the history
…/disable dragging seems out of place | nearbeach-1086 Kanban Board - UI/UX - Level headers do not line up exactly with heading
  • Loading branch information
robotichead committed Sep 15, 2023
1 parent 08e2b3d commit 078b634
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NearBeach/views/customer_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def customer_update_profile(request, customer_id, *args, **kwargs):
file = form.cleaned_data["file"]
document_description = str(file)

# Check file size
if file.size > 250 * 1024:
return HttpResponseBadRequest("File size too large")

# Upload the document
document_submit, _ = handle_document_permissions(
request,
Expand Down
4 changes: 4 additions & 0 deletions NearBeach/views/organisation_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ def organisation_update_profile(request, organisation_id, *args, **kwargs):
file = form.cleaned_data["file"]
document_description = str(file)

# Check the file size
if file.size > 250 * 1024:
return HttpResponseBadRequest("File size too large")

# Upload the document
document_submit, _ = handle_document_permissions(
request,
Expand Down
4 changes: 4 additions & 0 deletions NearBeach/views/profile_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def update_profile(request):
file = form.cleaned_data["file"]
document_description = str(file)

# Check file size
if file.size > 250 * 1024:
return HttpResponseBadRequest("Profile Picture too large. Please use 250Kb")

# Upload the document
document_submit, _ = handle_document_permissions(
request,
Expand Down
1 change: 1 addition & 0 deletions src/js/components/customers/CustomerInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'X-CSRFTOKEN': getToken('csrftoken'),
}"
:data="{}"
@error="showErrorModal('Profile Picture was not updated','Profile Picture','')"
@finish="updateProfilePicture"
>
<n-button>Update Profile Picture</n-button>
Expand Down
11 changes: 10 additions & 1 deletion src/js/components/kanban/KanbanBoard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ import { nextTick } from 'vue';
},
resizeProcedure() {
// Get the screen size and the columns width
const columns_width = this.columnResults.length * 400;
const little_adjustment = 2 * (this.columnResults.length - 1)
const columns_width = this.columnResults.length * 400 + little_adjustment;
const container_element = document.getElementsByClassName("kanban-container")[0];
const kanban_container_width = container_element.clientWidth;
Expand All @@ -115,22 +116,30 @@ import { nextTick } from 'vue';
// that smaller size
if (columns_width < kanban_container_width) {
//Add in the width restrictions
var header_element = document.getElementsByClassName("kanban-edit-text")[0];
var elements = document.getElementsByClassName("kanban-level-div");
//Loop through each element
Array.from(elements).forEach((element) => {
element.style = `max-width: ${columns_width}px;`;
});
//Adjust the size of the header element
header_element.style = `max-width: ${columns_width}px`;
} else {
//The columns width is greater than the container width.
//So we need to use the scroll width of the container
const scroll_width = container_element.scrollWidth;
var header_element = document.getElementsByClassName("kanban-edit-text")[0];
let elements = document.getElementsByClassName("kanban-level-div");
//Loop through each element
Array.from(elements).forEach((element) => {
element.style = `width: ${scroll_width}px;`;
});
//Adjust the size of the header element
header_element.style = `max-width: ${scroll_width}px`;
}
},
scrollProcedure() {
Expand Down
6 changes: 4 additions & 2 deletions src/js/components/profile/UpdateProfilePicture.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
class="organisation-profile-image"
/>
<br />
<!--<button class="btn btn-primary">Update Profile...</button>-->
<n-upload
:action="`${rootUrl}profile_information/update_profile/`"
:headers="{
'X-CSRFTOKEN': getToken('csrftoken'),
}"
:data="{}"
:max="1"
@error="showErrorModal('Profile Picture was not updated','Profile Picture','')"
@finish="updateProfilePicture"
>
<n-button>Update Profile Picture</n-button>
Expand All @@ -39,6 +40,7 @@
import { mapGetters } from "vuex";
//Mixins
import errorModalMixin from "../../mixins/errorModalMixin";
import getToken from "../../mixins/getTokenMixin";
import getThemeMixin from "../../mixins/getThemeMixin";
Expand Down Expand Up @@ -71,7 +73,7 @@
rootUrl: "getRootUrl",
}),
},
mixins: [getToken, getThemeMixin],
mixins: [errorModalMixin, getToken, getThemeMixin],
methods: {
setProfilePicture() {
//Set the default
Expand Down

0 comments on commit 078b634

Please sign in to comment.