Skip to content

Commit

Permalink
Disable notifications management conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Nov 30, 2023
1 parent 64a813e commit 23f3f01
Showing 1 changed file with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<script setup lang="ts">
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { BButton } from "bootstrap-vue";
import { BAlert, BButton } from "bootstrap-vue";
import { useRouter } from "vue-router/composables";
import { useConfig } from "@/composables/config";
import BroadcastsList from "@/components/admin/Notifications/BroadcastsList.vue";
import Heading from "@/components/Common/Heading.vue";
const router = useRouter();
const { config, isConfigLoaded } = useConfig();
function goToCreateNewNotification() {
router.push("/admin/notifications/create_new_notification");
Expand All @@ -28,18 +31,32 @@ function goToCreateNewBroadcast() {
<i>broadcast notifications</i> to all users (even anonymous users).
</p>

<div>
<BButton class="mb-2" variant="outline-primary" @click="goToCreateNewNotification">
<FontAwesomeIcon icon="plus" />
Send new notification
</BButton>

<BButton class="mb-2" variant="outline-primary" @click="goToCreateNewBroadcast">
<FontAwesomeIcon icon="plus" />
Create new broadcast
</BButton>
<div v-if="isConfigLoaded && config.enable_notification_system">
<div>
<BButton
id="send-notification-button"
class="mb-2"
variant="outline-primary"
@click="goToCreateNewNotification">
<FontAwesomeIcon icon="plus" />
Send new notification
</BButton>

<BButton
id="create-broadcast-button"
class="mb-2"
variant="outline-primary"
@click="goToCreateNewBroadcast">
<FontAwesomeIcon icon="plus" />
Create new broadcast
</BButton>
</div>

<BroadcastsList class="mt-2" />
</div>

<BroadcastsList class="mt-2" />
<BAlert v-else variant="warning" show>
The notification system is disabled. To enable it, set the
<code>enable_notification_system</code> option to <code>true</code> in the Galaxy configuration file.
</BAlert>
</div>
</template>

0 comments on commit 23f3f01

Please sign in to comment.