Skip to content

Commit 8b21125

Browse files
committed
Show notification option only if system is enabled
Prevents users from seeing and toggling the "notify on completion" option unless the notification system is enabled in config.
1 parent 4580b48 commit 8b21125

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

client/src/components/History/CurrentHistory/HistoryOperations/StorageOperationWizardModal.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useWizard } from "@/components/Common/Wizard/useWizard";
1010
import { HistoryFilters } from "@/components/History/HistoryFilters";
1111
import { bulkStorageExecute, bulkStoragePreview } from "@/components/History/model/queries";
1212
import { QuotaSourceUsageProvider } from "@/components/User/DiskUsage/Quota/QuotaUsageProvider.js";
13+
import { useConfig } from "@/composables/config";
1314
import { Toast } from "@/composables/toast";
1415
import { useObjectStoreStore } from "@/stores/objectStoreStore";
1516
import { useStorageOperationsStore } from "@/stores/storageOperationsStore";
@@ -40,6 +41,7 @@ const emit = defineEmits<{
4041
const objectStoreStore = useObjectStoreStore();
4142
const storageOperationsStore = useStorageOperationsStore();
4243
const { loading: objectStoresLoading, loadErrorMessage } = storeToRefs(objectStoreStore);
44+
const { config, isConfigLoaded } = useConfig(true);
4345
4446
const selectedTargetObjectStoreId = ref<string | null>(null);
4547
const storagePreview = ref<StorageOperationPreviewResponse | null>(null);
@@ -49,6 +51,11 @@ const previewError = ref<string | null>(null);
4951
const executionError = ref<string | null>(null);
5052
const notifyOnCompletion = ref(true);
5153
54+
const notificationSystemEnabled = computed(
55+
() => isConfigLoaded.value && config.value?.enable_notification_system === true,
56+
);
57+
const shouldNotifyOnCompletion = computed(() => notifyOnCompletion.value && notificationSystemEnabled.value);
58+
5259
const wizard = useWizard({
5360
configure: {
5461
label: "Destination",
@@ -181,7 +188,7 @@ async function executeStorageOperation() {
181188
props.history,
182189
snapshotId,
183190
undefined,
184-
notifyOnCompletion.value,
191+
shouldNotifyOnCompletion.value,
185192
);
186193
storageOperationsStore.startRun(toTrackedStorageRun(props.history.id, executeResponse.run));
187194
@@ -284,7 +291,7 @@ function getExplicitlySelectedItems(): HistoryContentItemBase[] {
284291
</Multiselect>
285292
</div>
286293

287-
<div class="mb-2">
294+
<div v-if="notificationSystemEnabled" class="mb-2">
288295
<label class="d-flex align-items-center mb-0">
289296
<input v-model="notifyOnCompletion" type="checkbox" class="mr-2" />
290297
Notify me when the storage operation completes

0 commit comments

Comments
 (0)