my-settings.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!--
  2. Page 'Mes préférences'
  3. -->
  4. <template>
  5. <LayoutContainer>
  6. <v-col cols="12" sm="12" md="12">
  7. <v-expansion-panels v-model="openedPanels" :multiple="true">
  8. <UiExpansionPanel title="message_settings" icon="fas fa-inbox">
  9. <v-container fluid class="container">
  10. <v-row>
  11. <UiLoadingPanel v-if="preferencesPending" />
  12. <UiForm
  13. v-else
  14. :model="AccessPreferences"
  15. :entity="preferences"
  16. action-position="bottom"
  17. >
  18. <v-row>
  19. <v-col cols="12">
  20. <UiInputCheckbox
  21. v-model="preferences.messageReport"
  22. field="messageReport"
  23. label="allow_report_message"
  24. />
  25. </v-col>
  26. </v-row>
  27. </UiForm>
  28. </v-row>
  29. </v-container>
  30. </UiExpansionPanel>
  31. </v-expansion-panels>
  32. </v-col>
  33. </LayoutContainer>
  34. </template>
  35. <script setup lang="ts">
  36. import type { Ref } from 'vue'
  37. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  38. import AccessPreferences from '~/models/Access/AccessPreferences'
  39. import { useAccessProfileStore } from '~/stores/accessProfile'
  40. definePageMeta({
  41. name: 'my_settings_page',
  42. })
  43. const accessProfileStore = useAccessProfileStore()
  44. if (accessProfileStore.accessPreferenceId === null) {
  45. throw new Error("Missing access preference's id")
  46. }
  47. const { fetch } = useEntityFetch()
  48. const openedPanels: Ref<Array<number>> = ref([0])
  49. const { data: preferences, pending: preferencesPending } = await fetch(
  50. AccessPreferences,
  51. accessProfileStore.accessPreferenceId,
  52. )
  53. </script>
  54. <style scoped lang="scss"></style>