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

feat: 权限部分前端优化 #2738 #2739

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
repoName: repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
uid: this.userInfo.name
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
window.open(res, '_blank')
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<bk-dialog v-model="showIamDenyDialog" :visible.sync="showIamDenyDialog" :before-close="close" style="text-align: center">
<bk-dialog v-model="showIamDenyDialog" :visible.sync="showIamDenyDialog" :before-close="close" width="768px" style="text-align: center">
<img src="/ui/no-permission.svg" />
<p>{{ $t('iamTip') }}</p>
<bk-table
Expand Down Expand Up @@ -91,10 +91,3 @@
}
}
</script>

<style lang="scss" scoped>
::v-deep .bk-dialog-wrapper .bk-dialog-content.bk-dialog-content-drag{
width: 768px !important;
}

</style>
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
path: this.formDialog.path
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
path: this.currentVersion.contentPath
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -395,7 +395,7 @@
path: this.currentVersion.contentPath
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -219,7 +219,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -349,7 +349,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
path: this.detailSlider.path
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -203,7 +203,7 @@
path: this.genericForm.path
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -248,7 +248,7 @@
path: this.genericForm.path
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
repoName: repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -168,7 +168,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
14 changes: 7 additions & 7 deletions src/frontend/devops-repository/src/views/repoGeneric/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -966,7 +966,7 @@
path: fullPath
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -1047,7 +1047,7 @@
path: row.fullPath
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -1147,7 +1147,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -1223,7 +1223,7 @@
repoName: this.repoName
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -1310,7 +1310,7 @@
path: row.fullPath
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -1366,7 +1366,7 @@
path: row.fullPath
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
uid: this.userInfo.name
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down
39 changes: 33 additions & 6 deletions src/frontend/devops-repository/src/views/repoList/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>
<div class="repo-list-container" v-bkloading="{ isLoading }">
<div class="ml20 mr20 mt10 flex-between-center">
<bk-button icon="plus" theme="primary" @click="createRepo">{{ $t('createRepository') }}</bk-button>
<bk-button v-if="userInfo.manage || userInfo.admin" icon="plus" theme="primary" @click="createRepo">{{ $t('createRepository') }}</bk-button>
<bk-button v-else icon="plus" class="no-permission-button" @click="creatNoPermission">{{ $t('createRepository') }}</bk-button>
<div class="flex-align-center">
<bk-input
v-model.trim="query.name"
Expand Down Expand Up @@ -41,7 +42,8 @@
<template #default="{ row }">
<Icon class="mr5 table-svg" size="16" :name="row.repoType" />
<span class="hover-btn" @click="toPackageList(row)">{{replaceRepoName(row.name)}}</span>
<span v-if="MODE_CONFIG === 'ci' && ['custom', 'pipeline'].includes(row.name)"
<span
v-if="MODE_CONFIG === 'ci' && ['custom', 'pipeline'].includes(row.name)"
class="mr5 repo-tag SUCCESS" :data-name="$t('built-in')"></span>
<span v-if="row.configuration.settings.system" class="mr5 repo-tag" :data-name="$t('system')"></span>
<span v-if="row.public" class="mr5 repo-tag WARNING" :data-name="$t('public')"></span>
Expand Down Expand Up @@ -77,7 +79,7 @@
<template #default="{ row }">
<operation-list
:list="[
{ label: $t('setting'), clickEvent: () => toRepoConfig(row) },
(userInfo.admin || userInfo.manage) && { label: $t('setting'), clickEvent: () => toRepoConfig(row) },
(row.repoType !== 'generic' ||
(row.repoType === 'generic'
&& row.name !== 'custom'
Expand Down Expand Up @@ -125,7 +127,7 @@
limitList: [10, 20, 40]
}
export default {
name: 'repoList',
name: 'RepoList',
components: { OperationList, createRepoDialog, iamDenyDialog, genericCleanDialog },
data () {
return {
Expand Down Expand Up @@ -297,7 +299,7 @@
repoName: name
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -353,7 +355,7 @@
uid: this.userInfo.name
}
}).then(res => {
if (res !== '') {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
Expand Down Expand Up @@ -442,6 +444,26 @@
} else {
this.$refs.genericCleanDialog.date = beforeYears(1)
}
},
creatNoPermission () {
this.getPermissionUrl({
body: {
projectId: this.projectId,
action: 'MANAGE',
resourceType: 'PROJECT',
uid: this.userInfo.name
}
}).then(res => {
if (res !== '' && res !== null) {
this.showIamDenyDialog = true
this.showData = {
projectId: this.projectId,
action: 'MANAGE',
repoName: '',
url: res
}
}
})
}
}
}
Expand All @@ -461,5 +483,10 @@
display: block;
}
}
.no-permission-button {
background: #dcdee5 !important;
border-color: #dcdee5 !important;
color: #fff !important;
}
}
</style>
Loading
Loading