Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions resources/js/tasks/components/TasksPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,14 @@
<b-button
v-if="allowReassignment"
v-b-tooltip.hover
class="btn text-secondary icon-button"
class="btn text-secondary icon-button preview-reassign-btn"
variant="light"
:aria-label="$t('Reassign')"
:title="$t('Reassign')"
:disabled="isTaskCompleted"
@click="openReassignment()"
>
<i class="fas fa-user-friends" />
<i class="fas fa-user-friends preview-reassign-btn__icon" />
</b-button>
<b-button
v-b-tooltip.hover
Expand Down Expand Up @@ -284,6 +285,26 @@ export default {
},
mixins: [PreviewMixin, autosaveMixins, reassignMixin],
props: ["tooltipButton", "propPreview"],
computed: {
/**
* TasksList replaces status with HTML; API uses CLOSED for completed.
*/
isTaskCompleted() {
const status = this.task?.status;
if (status === undefined || status === null) {
return false;
}
if (typeof status === "string") {
if (status === "CLOSED" || status === "Completed") {
Comment thread
CarliPinell marked this conversation as resolved.
return true;
}
if (status.includes("badge-primary") && status.includes("status-primary")) {
return true;
}
}
return false;
},
},
data() {
return {
};
Expand Down Expand Up @@ -414,6 +435,9 @@ export default {
});
},
openReassignment() {
if (this.isTaskCompleted) {
return;
}
this.showReassignment = !this.showReassignment;
},
getTaskDefinitionForReassignmentPermission() {
Expand Down Expand Up @@ -493,6 +517,25 @@ export default {
height: 16px;
}

/* Reassign disabled: keep same border as other icon-buttons; mute only the icon */
.tasks-preview .preview-group-button .preview-reassign-btn.btn-light:disabled,
.tasks-preview .preview-group-button .preview-reassign-btn.btn-light.disabled {
opacity: 1;
background-color: #fff;
border: 1px solid #ccc !important;
border-top-color: #ccc !important;
border-bottom-color: #ccc !important;
border-left-color: #ccc !important;
border-right-color: #ccc !important;
color: inherit;
}

.tasks-preview .preview-group-button .preview-reassign-btn.btn-light:disabled .preview-reassign-btn__icon,
.tasks-preview .preview-group-button .preview-reassign-btn.btn-light.disabled .preview-reassign-btn__icon {
color: #adb5bd;
opacity: 0.55;
}

.arrow-button {
width: 46px;
height: 36px;
Expand Down
Loading