|
Lines 1-14
Link Here
|
| 1 |
<template> |
1 |
<template> |
| 2 |
<BaseResource :routeAction="routeAction" :instancedResource="this" /> |
2 |
<div> |
|
|
3 |
<div |
| 4 |
v-if="routeAction === 'list' && showAutocreateWarning" |
| 5 |
class="alert alert-info" |
| 6 |
> |
| 7 |
<i class="fa fa-info-circle"></i> |
| 8 |
{{ |
| 9 |
$__( |
| 10 |
"When autocreate is enabled, field mappings for 'branchcode' and 'categorycode' are required. These can use either IdP attributes or default values." |
| 11 |
) |
| 12 |
}} |
| 13 |
</div> |
| 14 |
<BaseResource :routeAction="routeAction" :instancedResource="this" /> |
| 15 |
</div> |
| 3 |
</template> |
16 |
</template> |
| 4 |
|
17 |
|
| 5 |
<script> |
18 |
<script> |
| 6 |
import { inject } from "vue"; |
19 |
import { inject, computed, onMounted, ref } from "vue"; |
| 7 |
import BaseResource from "./../BaseResource.vue"; |
20 |
import BaseResource from "./../BaseResource.vue"; |
| 8 |
import { useBaseResource } from "../../composables/base-resource.js"; |
21 |
import { useBaseResource } from "../../composables/base-resource.js"; |
| 9 |
import { storeToRefs } from "pinia"; |
22 |
import { storeToRefs } from "pinia"; |
| 10 |
import { APIClient } from "../../fetch/api-client.js"; |
23 |
import { APIClient } from "../../fetch/api-client.js"; |
| 11 |
import { $__ } from "@koha-vue/i18n"; |
24 |
import { $__ } from "@koha-vue/i18n"; |
|
|
25 |
import { useShibbolethStore } from "../../stores/shibboleth.js"; |
| 12 |
|
26 |
|
| 13 |
export default { |
27 |
export default { |
| 14 |
name: "ShibbolethMappingResource", |
28 |
name: "ShibbolethMappingResource", |
|
Lines 156-165
export default {
Link Here
|
| 156 |
} |
170 |
} |
| 157 |
}; |
171 |
}; |
| 158 |
|
172 |
|
|
|
173 |
const shibbolethStore = useShibbolethStore(); |
| 174 |
const config = ref(null); |
| 175 |
|
| 176 |
const showAutocreateWarning = computed(() => { |
| 177 |
return config.value?.autocreate === true; |
| 178 |
}); |
| 179 |
|
| 180 |
onMounted(async () => { |
| 181 |
try { |
| 182 |
config.value = await APIClient.shibboleth.config.get(); |
| 183 |
} catch (error) { |
| 184 |
console.error("Failed to fetch shibboleth config:", error); |
| 185 |
} |
| 186 |
}); |
| 187 |
|
| 159 |
return { |
188 |
return { |
| 160 |
...baseResource, |
189 |
...baseResource, |
| 161 |
tableOptions, |
190 |
tableOptions, |
| 162 |
onFormSave, |
191 |
onFormSave, |
|
|
192 |
showAutocreateWarning, |
| 163 |
}; |
193 |
}; |
| 164 |
}, |
194 |
}, |
| 165 |
}; |
195 |
}; |
| 166 |
- |
|
|