Skip to content

Commit

Permalink
Merge pull request #623 from nearbeach/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
robotichead committed May 22, 2024
2 parents c5bf82c + a84aad6 commit d2c0d34
Show file tree
Hide file tree
Showing 24 changed files with 424 additions and 193 deletions.
1 change: 1 addition & 0 deletions NearBeach/static/NearBeach/742.min.js

Large diffs are not rendered by default.

Binary file added NearBeach/static/NearBeach/742.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/NearBeach.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/NearBeach.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/gantt-information.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/gantt-information.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/kanban-group-permissions.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified NearBeach/static/NearBeach/kanban-group-permissions.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/kanban-information.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/kanban-information.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/parent-modules.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/parent-modules.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/rfc-modules.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/rfc-modules.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
47 changes: 8 additions & 39 deletions src/js/components/card_information/CardUsers.vue
Original file line number Diff line number Diff line change
@@ -1,43 +1,9 @@
<template>
<div
class="alert alert-secondary"
v-if="objectUserList.length === 0"
>
Sorry, there are no users currently assigned to this card.
</div>
<div v-else
class="user-card-list"
>
<div
v-for="user in objectUserList"
v-bind:key="user.username"
class="user-card"
>
<img
v-bind:src="profilePicture(user.profile_picture)"
alt="default profile"
class="user-card--profile"
/>
<div class="user-card--details">
<div class="user-card--name">
{{ user.first_name }} {{ user.last_name }}
</div>
<div class="user-card--email">
{{ user.email }}
</div>
</div>
<div
class="user-card--remove"
v-if="userLevel >= 3"
>
<Icon
v-bind:icon="icons.trashCan"
v-on:click="removeUser(user.username)"
/>
</div>
</div>
<render-user-card-list
v-bind:object-user-list="objectUserList"
v-on:remove_user="removeUser"
></render-user-card-list>

</div>
<div
class="row"
v-if="userLevel > 1 && kanbanBoardStatus !== 'Closed'"
Expand All @@ -59,6 +25,7 @@ import {Icon} from "@iconify/vue";
//Vuex components
import {mapGetters} from "vuex";
import RenderUserCardList from "../render/RenderUserCardList.vue";
//Mixins
import iconMixin from "../../mixins/iconMixin";
Expand All @@ -67,13 +34,15 @@ export default {
name: "CardUsers",
components: {
Icon,
RenderUserCardList,
},
computed: {
...mapGetters({
cardId: "getCardId",
kanbanBoardStatus: "getKanbanStatus",
locationId: "getLocationId",
rootUrl: "getRootUrl",
staticUrl: "getStaticUrl",
userLevel: "getUserLevel",
objectUserList: "getObjectUserList",
}),
Expand Down Expand Up @@ -105,7 +74,7 @@ export default {
//Axios
this.axios
.post(
`${this.rootUrl}object_data/kanban_card/${this.locationId}/remove_user/`,
`${this.rootUrl}object_data/kanban_card/${this.cardId}/remove_user/`,
data_to_send
)
.then((response) => {
Expand Down
42 changes: 36 additions & 6 deletions src/js/components/gantt_chart/GanttInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ export default {
//Get the number of hours from this
const delta = Math.floor((client_x_final - this.mdClientXInitial) / 2) * (60 * 60 * 1000);
//Depending on the column, depends what functionality we are updating.
switch (this.mdColumn) {
case "end":
Expand Down Expand Up @@ -275,7 +273,15 @@ export default {
const end_date = new Date(this.mdEndDateInitial + delta);
//Do nothing if the end date is past the sprint's end date
if (this.mdEndDateInitial + delta > new Date(this.ganttEndDate).getTime()) return;
const g_e_d = DateTime.fromISO(
this.ganttEndDate
).set({
hour: 23,
minute: 59,
second: 59,
millisecond: 999,
});
if (this.mdEndDateInitial + delta > g_e_d.ts) return;
//Do nothing if the end date is less than the start date
if (this.mdEndDateInitial + delta <= this.mdStartDateInitial) return;
Expand Down Expand Up @@ -326,10 +332,26 @@ export default {
},
updateMiddle(delta) {
//Do nothing if the start date is past the sprint's start date
if (this.mdStartDateInitial + delta < new Date(this.ganttStartDate).getTime()) return;
const g_s_d = DateTime.fromISO(
this.ganttStartDate
).set({
hour: 0,
minute: 0,
second: 0,
millisecond: 0
});
if (this.mdStartDateInitial + delta < g_s_d.ts) return;
//Do nothing if the end date is past the sprint's end date
if (this.mdEndDateInitial + delta > new Date(this.ganttEndDate).getTime()) return;
const g_e_d = DateTime.fromISO(
this.ganttEndDate
).set({
hour: 23,
minute: 59,
second: 59,
millisecond: 999,
});
if (this.mdEndDateInitial + delta > g_e_d.ts) return;
//Apply the delta to the dates
const end_date = new Date(this.mdEndDateInitial + delta);
Expand All @@ -354,7 +376,15 @@ export default {
const start_date = new Date(this.mdStartDateInitial + delta);
//If the start date is less than the gantt start date - do nothing
if (this.mdStartDateInitial + delta < new Date(this.ganttStartDate).getTime()) return;
const g_s_d = DateTime.fromISO(
this.ganttStartDate
).set({
hour: 0,
minute: 0,
second: 0,
millisecond: 0
});
if (this.mdStartDateInitial + delta < g_s_d.ts) return;
//If the start date is greater or equal to the end date. Do nothing
if (this.mdStartDateInitial + delta >= this.mdEndDateInitial) return;
Expand Down
14 changes: 12 additions & 2 deletions src/js/components/gantt_chart/RenderGanttRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ import { mapGetters } from "vuex";
//Components
import { NDatePicker, NSelect } from "naive-ui";
//Datetime
import { DateTime } from "luxon";
export default {
name: "RenderGanttRow",
props: {
Expand Down Expand Up @@ -150,9 +153,16 @@ export default {
start_date = this.startDateGantt;
}
if (end_date > this.endDateGantt) {
//Adjust the end date to the END of that particular day
const g_e_d = DateTime.fromMillis(this.endDateGantt).set({
hour: 23,
minute: 59,
second: 59,
millisecond: 999,
});
if (end_date > g_e_d.ts) {
//The end date of the bar, falls outside the timeframe. Adjust to the end of the gantt chart
end_date = this.endDateGantt;
end_date = g_e_d.ts;
}
//Calculate the delta (aka number of days)
Expand Down
67 changes: 11 additions & 56 deletions src/js/components/modules/sub_modules/GroupsAndUsersModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,55 +73,13 @@
{{ destinationTitle }}. Please note - users have to be a part of the
groups list above.
</p>
<div v-if="loadingData"
class="alert alert-info"
>
Currently loading User Data.
</div>
<div
v-else-if="objectUserList.length === 0 && !addingUserStatus"
class="alert alert-dark"
>
Sorry - there are no current users active.
</div>
<div
v-else
class="user-card-list"
>
<div
v-for="user in objectUserList"
v-bind:key="user.username"
class="user-card"
>
<img
v-bind:src="profilePicture(user.profile_picture)"
alt="default profile"
class="user-card--profile"
/>
<div class="user-card--details">
<div class="user-card--name">
{{ user.first_name }} {{ user.last_name }}
</div>
<div class="user-card--email">
{{ user.email }}
</div>
</div>
<div
class="user-card--remove"
v-if="userLevel >= 3"
>
<Icon
v-bind:icon="icons.trashCan"
v-on:click="removeUser(user.username)"
/>
</div>
</div>
<div v-if="addingUserStatus"
class="user-card"
>
<div class="user-card--details">++ Adding User(s) ++</div>
</div>
</div>

<render-user-card-list
v-bind:adding-user-status="addingUserStatus"
v-bind:loading-data="loadingData"
v-bind:object-user-list="objectUserList"
v-on:remove_user="removeUser"
></render-user-card-list>

<div class="spacer"></div>

Expand Down Expand Up @@ -160,6 +118,9 @@ import ConfirmUserDelete from "../wizards/ConfirmUserDelete.vue";
//VueX
import {mapGetters} from "vuex";
//Components
import RenderUserCardList from "../../render/RenderUserCardList.vue";
export default {
name: "GroupsAndUsersModule",
components: {
Expand All @@ -168,6 +129,7 @@ export default {
ConfirmGroupDelete,
ConfirmUserDelete,
Icon,
RenderUserCardList,
},
props: {
isReadOnly: {
Expand Down Expand Up @@ -233,13 +195,6 @@ export default {
});
})
},
profilePicture(picture_uuid) {
if (picture_uuid !== null && picture_uuid !== "") {
return `${this.rootUrl}private/${picture_uuid}/`;
}
return `${this.staticUrl}NearBeach/images/placeholder/people_tax.svg`;
},
removeGroup(group_id) {
//Tell the confirmation modal what group id is being deleted
this.deleteGroupId = group_id;
Expand Down
3 changes: 0 additions & 3 deletions src/js/components/render/RenderUserCard.vue

This file was deleted.

108 changes: 108 additions & 0 deletions src/js/components/render/RenderUserCardList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<template>
<div v-if="loadingData"
class="alert alert-info"
>
Currently loading User Data.
</div>
<div
v-else-if="objectUserList.length === 0 && !addingUserStatus"
class="alert alert-dark"
>
Sorry, there are no users currently assigned to this object.
</div>
<div
v-else
class="user-card-list"
>
<div
v-for="user in objectUserList"
v-bind:key="user.username"
class="user-card"
>
<img
v-bind:src="profilePicture(user.profile_picture)"
alt="default profile"
class="user-card--profile"
/>
<div class="user-card--details">
<div class="user-card--name">
{{ user.first_name }} {{ user.last_name }}
</div>
<div class="user-card--email">
{{ user.email }}
</div>
</div>
<div
class="user-card--remove"
v-if="userLevel >= 3"
>
<Icon
v-bind:icon="icons.trashCan"
v-on:click="removeUser(user.username)"
/>
</div>
</div>
<div v-if="addingUserStatus"
class="user-card"
>
<div class="user-card--details">++ Adding User(s) ++</div>
</div>
</div>

</template>

<script>
//VueX
import { mapGetters } from "vuex";
//Components
import {Icon} from "@iconify/vue";
//Mixins
import iconMixin from "../../mixins/iconMixin";
export default {
name: "RenderUserCardList",
components: {
Icon,
},
props: {
addingUserStatus: {
type: Boolean,
default: false,
},
loadingData: {
type: Boolean,
default: false,
},
objectUserList: {
type: Array,
default: () => {
return [];
},
},
},
mixins: [
iconMixin,
],
computed: {
...mapGetters({
rootUrl: "getRootUrl",
staticUrl: "getStaticUrl",
userLevel: "getUserLevel",
}),
},
methods: {
profilePicture(picture_uuid) {
if (picture_uuid !== null && picture_uuid !== "") {
return `${this.rootUrl}private/${picture_uuid}/`;
}
return `${this.staticUrl}NearBeach/images/placeholder/people_tax.svg`;
},
removeUser(username) {
this.$emit("remove_user", username);
},
}
}
</script>
Loading

0 comments on commit d2c0d34

Please sign in to comment.