Remediate the 2026-09-03 feature-test findings
This commit is contained in:
@@ -2,7 +2,14 @@
|
||||
<div>
|
||||
<div class="page-header">
|
||||
<h2>Site Policies</h2>
|
||||
<button class="btn btn-primary" @click="openModal()">+ Add Site Policy</button>
|
||||
<button v-if="!featureOff" class="btn btn-primary" @click="openModal()">+ Add Site Policy</button>
|
||||
</div>
|
||||
|
||||
<div v-if="featureOff" class="card feature-off-notice">
|
||||
<strong>Site policies are not enabled on this site.</strong>
|
||||
<p>Nothing can be created here until the feature is turned on.
|
||||
The list below is empty because the feature is off, not
|
||||
because nothing has been configured.</p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
@@ -110,6 +117,7 @@ const toast = useToast()
|
||||
const policies = ref([])
|
||||
const configPolicies = ref([])
|
||||
const loading = ref(true)
|
||||
const featureOff = ref(false)
|
||||
|
||||
const showModal = ref(false)
|
||||
const editing = ref(null)
|
||||
@@ -135,6 +143,10 @@ async function loadData() {
|
||||
configPolicies.value = config.data.data || []
|
||||
} catch (err) {
|
||||
console.error('Error loading business policies:', err)
|
||||
// The API answers 404 'Policy feature is not enabled' when the
|
||||
// flag is off. Without this the page rendered its empty table
|
||||
// and an Add button for a feature that cannot accept one.
|
||||
featureOff.value = err?.response?.status === 404
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -214,6 +226,13 @@ async function remove(p) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.feature-off-notice {
|
||||
border-left: 3px solid var(--warning);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.feature-off-notice p {
|
||||
margin: 0.4rem 0 0 0;
|
||||
}
|
||||
.item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
|
||||
.order-badge {
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
|
||||
Reference in New Issue
Block a user