Skip to content

Commit 6fc4ca4

Browse files
committed
Readonly access to control plan for committee
1 parent 744336f commit 6fc4ca4

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

web/src/components/action/ActionCompleteForm.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
<div class="d-flex">
3535
<v-textarea
3636
v-model="props.action.notes"
37-
:readonly="!isNil(props.action.complete_date)"
37+
:readonly="!isNil(props.action.complete_date) || isReadonly"
3838
rows="3"
3939
hide-details />
40-
<v-btn class="ml-3 mt-auto" size="small" color="primary" @click="saveNotes"> Save</v-btn>
40+
<v-btn v-if="!isReadonly" class="ml-3 mt-auto" size="small" color="primary" @click="saveNotes"> Save</v-btn>
4141
</div>
4242
</v-col>
4343
<v-col v-if="!isNil(props.action.complete_name)" cols="12">
@@ -57,7 +57,7 @@
5757
</v-col>
5858
</v-row>
5959

60-
<div class="d-flex mt-5">
60+
<div v-if="!isReadonly" class="d-flex mt-5">
6161
<v-btn v-if="!isNil(props.action.complete_date)" color="info" @click="revertClick"
6262
><v-icon class="mr-2">mdi-arrow-u-left-top-bold</v-icon> Revert</v-btn
6363
>
@@ -104,7 +104,7 @@ import { useUserStore } from "@/store/UserStore";
104104
import { useInterfaceStore } from "@/store/InterfaceStore";
105105
import ActionAssignmentDialog from "./ActionAssignmentDialog.vue";
106106
107-
const props = defineProps(["action"]);
107+
const props = defineProps(["action", "readonly"]);
108108
const emit = defineEmits(["doClose"]);
109109
const directorySelectorField = ref(null);
110110
@@ -125,6 +125,10 @@ const canComplete = computed(() => {
125125
return !isNil(props.action.control);
126126
});
127127
128+
const isReadonly = computed(() => {
129+
return props.readonly == true;
130+
});
131+
128132
function closeClick() {
129133
emit("doClose");
130134
}

web/src/components/action/ActionDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<v-card-text v-else>
1919
<div class="bg-white" style="border: 1px #ddd solid; border-radius: 4px">
20-
<ActionCompleteForm :action="action" @do-close="closeClick" />
20+
<ActionCompleteForm :action="action" :readonly="readonly" @do-close="closeClick" />
2121
</div>
2222

2323
<div v-if="hazardId" class="mt-5">
@@ -58,7 +58,7 @@ import { ref, defineProps, watch } from "vue";
5858
import { storeToRefs } from "pinia";
5959
import { isNil, isNumber } from "lodash";
6060
61-
const props = defineProps(["action", "hazardId"]);
61+
const props = defineProps(["action", "hazardId", "readonly"]);
6262
6363
const emit = defineEmits(["doClose"]);
6464

web/src/components/incident/DetailsPage.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
v-model="showActionEdit"
133133
:action="actionToEdit"
134134
:hazard-id="actionToEdit?.hazard_id"
135+
:readonly="isCommittee"
135136
@doClose="actionReload"></ActionDialog>
136137

137138
<HazardAssessmentForm
@@ -381,7 +382,7 @@ function formatDate(input) {
381382
}
382383
383384
function doShowActionEdit(action) {
384-
if (isSupervisor.value || isSystemAdmin.value) {
385+
if (isSupervisor.value || isSystemAdmin.value || isCommittee.value) {
385386
actionToEdit.value = action;
386387
showActionEdit.value = true;
387388
return;

0 commit comments

Comments
 (0)