@fy-/fws-vue 2.3.37 → 2.3.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,7 +73,7 @@ async function patchUser() {
73
73
 
74
74
  <template>
75
75
  <form class="space-y-4" @submit.prevent="patchUser">
76
- <div class="bg-white dark:bg-fv-neutral-800 p-4 sm:p-6 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700">
76
+ <div class="bg-white dark:bg-fv-neutral-900 p-4 sm:p-6 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700">
77
77
  <h3 class="text-lg font-semibold text-fv-neutral-900 dark:text-white mb-4 sm:mb-5 pb-2 border-b border-fv-neutral-200 dark:border-fv-neutral-700">
78
78
  {{ $t('fws_personal_data_title') || $t('fws_personal_information') }}
79
79
  </h3>
@@ -142,16 +142,14 @@ async function patchUser() {
142
142
  />
143
143
  </div>
144
144
 
145
- <div class="py-2 px-2 sm:px-3 my-2 bg-fv-neutral-50 dark:bg-fv-neutral-700/30 rounded-lg border border-fv-neutral-200 dark:border-fv-neutral-700">
146
- <DefaultInput
147
- id="enabledTrainingFromMyDataFWS"
148
- v-model:checkbox-value="state.userData.EnabledTrainingFromMyData"
149
- type="toggle"
150
- :label="$t('fws_enabled_training_from_my_data_label')"
151
- :help="$t('fws_enabled_training_from_my_data_help')"
152
- :error-vuelidate="v$.userData.EnabledTrainingFromMyData.$errors"
153
- />
154
- </div>
145
+ <DefaultInput
146
+ id="enabledTrainingFromMyDataFWS"
147
+ v-model:checkbox-value="state.userData.EnabledTrainingFromMyData"
148
+ type="toggle"
149
+ :label="$t('fws_enabled_training_from_my_data_label')"
150
+ :help="$t('fws_enabled_training_from_my_data_help')"
151
+ :error-vuelidate="v$.userData.EnabledTrainingFromMyData.$errors"
152
+ />
155
153
  </div>
156
154
  </div>
157
155
 
@@ -14,6 +14,12 @@ const isAuth = computed(() => userStore.isAuth)
14
14
  const data = ref()
15
15
  const providersData = ref()
16
16
  const usedProviders = ref<Record<string, boolean>>({})
17
+
18
+ // Check if there are any available providers that aren't connected yet
19
+ const hasAvailableProviders = computed(() => {
20
+ if (!providersData.value || providersData.value.length === 0) return false
21
+ return providersData.value.some(provider => !usedProviders.value[provider.UUID])
22
+ })
17
23
  const props = defineProps({
18
24
  returnTo: {
19
25
  type: String,
@@ -84,45 +90,67 @@ onMounted(() => {
84
90
  <!-- Provider Selection Modal -->
85
91
  <DefaultModal id="providers" :title="$t('providers_modal_title')">
86
92
  <div class="grid gap-4 p-1">
87
- <template v-for="provider in providersData" :key="provider.UUID">
88
- <div
89
- v-if="!usedProviders[provider.UUID]"
90
- class="flex items-center"
91
- >
92
- <button
93
- class="flex border border-fv-neutral-300 dark:border-fv-neutral-700 rounded-lg shadow-sm hover:shadow items-center gap-2 justify-start w-full mx-auto !font-medium p-3 transition-all duration-200"
94
- :style="`background: ${
95
- provider.Data.Button.button['background-color']
96
- }; color: ${$getContrastingTextColor(
97
- provider.Data.Button.button['background-color'],
98
- )}`"
99
- @click="
100
- () => {
101
- getOAuth2Redirect(provider.UUID);
102
- }
103
- "
93
+ <!-- Check if there are available providers to connect -->
94
+ <div v-if="providersData && providersData.length > 0">
95
+ <div v-if="!hasAvailableProviders" class="text-center py-6">
96
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mx-auto text-fv-neutral-400 dark:text-fv-neutral-500 mb-3" viewBox="0 0 20 20" fill="currentColor">
97
+ <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13a1 1 0 102 0V9.414l1.293 1.293a1 1 0 001.414-1.414z" clip-rule="evenodd" />
98
+ </svg>
99
+ <p class="text-fv-neutral-700 dark:text-fv-neutral-300 mb-1 font-medium">
100
+ {{ $t('account_already_connected_to_all_providers') || 'All services are connected' }}
101
+ </p>
102
+ <p class="text-sm text-fv-neutral-500 dark:text-fv-neutral-400">
103
+ {{ $t('no_more_available_providers') || 'Your account is already connected to all available services' }}
104
+ </p>
105
+ </div>
106
+
107
+ <template v-for="provider in providersData" v-else :key="provider.UUID">
108
+ <div
109
+ v-if="!usedProviders[provider.UUID]"
110
+ class="flex items-center"
104
111
  >
105
- <img
106
- :key="`${provider.Data.Button.label}oauth`"
107
- class="h-10 w-10 block p-1.5 mr-3 rounded"
108
- :alt="provider.Data.Button.info.Name"
109
- :src="provider.Data.Button.button.logo"
112
+ <button
113
+ class="flex border border-fv-neutral-300 dark:border-fv-neutral-700 rounded-lg shadow-sm hover:shadow items-center gap-2 justify-start w-full mx-auto !font-medium p-3 transition-all duration-200"
114
+ :style="`background: ${
115
+ provider.Data.Button.button['background-color']
116
+ }; color: ${$getContrastingTextColor(
117
+ provider.Data.Button.button['background-color'],
118
+ )}`"
119
+ @click="
120
+ () => {
121
+ getOAuth2Redirect(provider.UUID);
122
+ }
123
+ "
110
124
  >
111
- <div class="text-base">
112
- {{
113
- $t("user_flow_signin_with", {
114
- provider: provider.Data.Button.name,
115
- })
116
- }}
117
- </div>
118
- </button>
119
- </div>
120
- </template>
125
+ <img
126
+ :key="`${provider.Data.Button.label}oauth`"
127
+ class="h-10 w-10 block p-1.5 mr-3 rounded"
128
+ :alt="provider.Data.Button.info.Name"
129
+ :src="provider.Data.Button.button.logo"
130
+ >
131
+ <div class="text-base">
132
+ {{
133
+ $t("user_flow_signin_with", {
134
+ provider: provider.Data.Button.name,
135
+ })
136
+ }}
137
+ </div>
138
+ </button>
139
+ </div>
140
+ </template>
141
+ </div>
142
+
143
+ <!-- Loading or no providers available -->
144
+ <div v-else class="text-center py-4">
145
+ <p class="text-fv-neutral-500 dark:text-fv-neutral-400">
146
+ {{ $t('loading_providers') || 'Loading available services...' }}
147
+ </p>
148
+ </div>
121
149
  </div>
122
150
  </DefaultModal>
123
151
 
124
152
  <!-- Main Container -->
125
- <div class="bg-white dark:bg-fv-neutral-800 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700 p-4 sm:p-6">
153
+ <div class="bg-white dark:bg-fv-neutral-900 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700 p-4 sm:p-6">
126
154
  <!-- Header -->
127
155
  <div class="flex items-center justify-between mb-4 sm:mb-6 pb-2 sm:pb-3 border-b border-fv-neutral-200 dark:border-fv-neutral-700">
128
156
  <h2 class="text-lg font-semibold text-fv-neutral-900 dark:text-white">
@@ -161,7 +161,7 @@ function selectFile(e: Event) {
161
161
 
162
162
  <template>
163
163
  <form class="space-y-4" @submit.prevent="patchUser">
164
- <div class="bg-white dark:bg-fv-neutral-800 p-4 sm:p-6 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700">
164
+ <div class="bg-white dark:bg-fv-neutral-900 p-4 sm:p-6 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700">
165
165
  <h3 class="text-lg font-semibold text-fv-neutral-900 dark:text-white mb-4 pb-2 border-b border-fv-neutral-200 dark:border-fv-neutral-700">
166
166
  {{ $t('fws_profile_heading') || $t('fws_your_profile') }}
167
167
  </h3>
@@ -111,7 +111,7 @@ async function patchUser() {
111
111
 
112
112
  <template>
113
113
  <form class="space-y-4" @submit.prevent="patchUser">
114
- <div class="bg-white dark:bg-fv-neutral-800 p-4 sm:p-6 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700">
114
+ <div class="bg-white dark:bg-fv-neutral-900 p-4 sm:p-6 rounded-lg shadow-sm border border-fv-neutral-200 dark:border-fv-neutral-700">
115
115
  <h3 class="text-lg font-semibold text-fv-neutral-900 dark:text-white mb-4 pb-2 border-b border-fv-neutral-200 dark:border-fv-neutral-700">
116
116
  {{ $t('fws_user_profile_title') || $t('fws_profile_settings') }}
117
117
  </h3>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "2.3.37",
3
+ "version": "2.3.38",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/fy-to/FWJS#readme",