|
70 | 70 | <v-divider /> |
71 | 71 | <v-card-title> {{ t('administration.apikey.attributes') }} </v-card-title> |
72 | 72 | <UnpaywallArgsSelectorAttributes |
73 | | - :simple="attributesSimple" |
74 | | - :best-oa-location="attributesBestOaLocation" |
75 | | - :first-oa-location="attributesFirstOaLocation" |
76 | | - :oa-locations="attributesOaLocations" |
77 | | - :z-authors="attributesZAuthors" |
78 | 73 | @attributes="updateAttributes" |
79 | 74 | /> |
80 | 75 | </v-form> |
@@ -140,12 +135,6 @@ const validForm = computed(() => attributes.value?.length > 0 |
140 | 135 | && name.value?.length > 0 |
141 | 136 | && access.value?.length > 0); |
142 | 137 |
|
143 | | -const attributesSimple = computed(() => attributes.value?.filter((e) => !e.includes('.'))); |
144 | | -const attributesBestOaLocation = computed(() => attributes.value?.filter((e) => e.includes('best_oa_location')).map((e) => e.split('.')[1])); |
145 | | -const attributesFirstOaLocation = computed(() => attributes.value?.filter((e) => e.includes('first_oa_location')).map((e) => e.split('.')[1])); |
146 | | -const attributesOaLocations = computed(() => attributes.value?.filter((e) => e.includes('oa_locations')).map((e) => e.split('.')[1])); |
147 | | -const attributesZAuthors = computed(() => attributes.value?.filter((e) => e.includes('z_authors')).map((e) => e.split('.')[1])); |
148 | | -
|
149 | 138 | async function createApikey() { |
150 | 139 | loading.value = true; |
151 | 140 | try { |
@@ -174,13 +163,12 @@ async function createApikey() { |
174 | 163 | emit('update:modelValue', false); |
175 | 164 | } |
176 | 165 |
|
177 | | -function updateAttributes(attributesSelected) { |
178 | | - // TODO 50 is the sum of attributes available through ezunpaywall |
179 | | - if (attributesSelected.length === 50) { |
| 166 | +function updateAttributes(selectedAttributes) { |
| 167 | + // 18 + 5 + 4 * 11 = 67 is the sum of attributes available through ezunpaywall |
| 168 | + if (selectedAttributes.length === 66) { |
180 | 169 | attributes.value = ['*']; |
181 | 170 | } else { |
182 | | - attributes.value = attributesSelected; |
| 171 | + attributes.value = selectedAttributes; |
183 | 172 | } |
184 | 173 | } |
185 | | -
|
186 | 174 | </script> |
0 commit comments