-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1112 from solliancenet/sc-rbac-management-portal-ui
Management Portal RBAC UI
- Loading branch information
Showing
19 changed files
with
3,307 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
APP_CONFIG_ENDPOINT="" # A connection string for the App Config service. | ||
LOCAL_API_URL="" # The URL of the local Management API service (https://localhost:63267). IMPORTANT! Only set this value if you wish to debug the entire solution locally and bypass the App Config service value for the MANAGEMENT API URL. | ||
|
||
VITEST_API_URL="" # An API url for the API tests to use | ||
VITEST_API_INSTANCE_ID="" # An instance ID for the API tests to use | ||
VITEST_API_AUTH_TOKEN="" # A valid auth token to access restricted resources from the API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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> |
Oops, something went wrong.