Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UI lint errors #1313

Merged
merged 9 commits into from
Aug 1, 2024
Merged
2 changes: 1 addition & 1 deletion src/ui/ManagementPortal/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default {
style: {
immediate: true,
handler() {
for (let cssVar in this.style) {
for (const cssVar in this.style) {
document.documentElement.style.setProperty(cssVar, this.style[cssVar]);
}
},
Expand Down
202 changes: 101 additions & 101 deletions src/ui/ManagementPortal/components/AccessControl.vue
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
<template>
<!-- Trigger button -->
<div style="display: flex; align-items: center">
<Button @click="dialogOpen = true">
<i class="pi pi-lock" style="color: var(--text-primary); margin-right: 8px;"></i>
Access Control
</Button>
</div>

<!-- RBAC dialog -->
<Dialog
v-model:visible="dialogOpen"
modal
:header="currentStep === STEPS.CREATE_STEP ? 'Create Role Assignment' : 'Access Control'"
:style="{ minWidth: '70%' }"
@hide="handleClose"
>
<!-- Table step -->
<template v-if="currentStep === STEPS.TABLE_STEP">
<RoleAssignmentsTable :scope="scope" />
</template>

<!-- Create step -->
<template v-if="currentStep === STEPS.CREATE_STEP">
<CreateRoleAssignment ref="createForm" headless :scope="scope" />
</template>

<template #footer>
<!-- Table step buttons -->
<template v-if="currentStep === STEPS.TABLE_STEP">
<Button label="Close" text @click="handleClose" />

<Button v-if="currentStep === STEPS.TABLE_STEP" @click="currentStep = STEPS.CREATE_STEP">
<i class="pi pi-plus" style="color: var(--text-primary); margin-right: 8px"></i>
Add role assignment for this resource
</Button>
</template>

<!-- Create step buttons -->
<template v-else-if="currentStep === STEPS.CREATE_STEP">
<Button label="Back" text @click="currentStep = STEPS.TABLE_STEP" />

<Button @click="handleCreateRoleAssignment">
<i class="pi pi-plus" style="color: var(--text-primary); margin-right: 8px"></i>
Create role assignment
</Button>
</template>
</template>

</Dialog>
</template>

<script lang="ts">
import CreateRoleAssignment from '@/pages/security/role-assignments/create.vue';

const STEPS = {
TABLE_STEP: 1,
CREATE_STEP: 2,
};

export default {
components: {
CreateRoleAssignment,
},

props: {
scope: {
type: String,
required: false,
},
},

data() {
return {
STEPS,
dialogOpen: false,
currentStep: STEPS.TABLE_STEP,
};
},

methods: {
handleClose() {
this.dialogOpen = false;
this.currentStep = STEPS.TABLE_STEP;
},

async handleCreateRoleAssignment() {
try {
await this.$refs.createForm.createRoleAssignment();
this.currentStep = STEPS.TABLE_STEP;
} catch(error) {
this.$toast.add({
severity: 'error',
detail: error,
life: 5000,
});
}
},
},
};
</script>
<template>
<!-- Trigger button -->
<div style="display: flex; align-items: center">
<Button @click="dialogOpen = true">
<i class="pi pi-lock" style="color: var(--text-primary); margin-right: 8px"></i>
Access Control
</Button>
</div>
<!-- RBAC dialog -->
<Dialog
v-model:visible="dialogOpen"
modal
:header="currentStep === STEPS.CREATE_STEP ? 'Create Role Assignment' : 'Access Control'"
:style="{ minWidth: '70%' }"
@hide="handleClose"
>
<!-- Table step -->
<template v-if="currentStep === STEPS.TABLE_STEP">
<RoleAssignmentsTable :scope="scope" />
</template>
<!-- Create step -->
<template v-if="currentStep === STEPS.CREATE_STEP">
<CreateRoleAssignment ref="createForm" headless :scope="scope" />
</template>
<template #footer>
<!-- Table step buttons -->
<template v-if="currentStep === STEPS.TABLE_STEP">
<Button label="Close" text @click="handleClose" />
<Button v-if="currentStep === STEPS.TABLE_STEP" @click="currentStep = STEPS.CREATE_STEP">
<i class="pi pi-plus" style="color: var(--text-primary); margin-right: 8px"></i>
Add role assignment for this resource
</Button>
</template>
<!-- Create step buttons -->
<template v-else-if="currentStep === STEPS.CREATE_STEP">
<Button label="Back" text @click="currentStep = STEPS.TABLE_STEP" />
<Button @click="handleCreateRoleAssignment">
<i class="pi pi-plus" style="color: var(--text-primary); margin-right: 8px"></i>
Create role assignment
</Button>
</template>
</template>
</Dialog>
</template>
<script lang="ts">
import CreateRoleAssignment from '@/pages/security/role-assignments/create.vue';
const STEPS = {
TABLE_STEP: 1,
CREATE_STEP: 2,
};
export default {
components: {
CreateRoleAssignment,
},
props: {
scope: {
type: String,
required: false,
default: null,
},
},
data() {
return {
STEPS,
dialogOpen: false,
currentStep: STEPS.TABLE_STEP,
};
},
methods: {
handleClose() {
this.dialogOpen = false;
this.currentStep = STEPS.TABLE_STEP;
},
async handleCreateRoleAssignment() {
try {
await this.$refs.createForm.createRoleAssignment();
this.currentStep = STEPS.TABLE_STEP;
} catch (error) {
this.$toast.add({
severity: 'error',
detail: error,
life: 5000,
});
}
},
},
};
</script>
Loading
Loading