Skip to content
Merged
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
20 changes: 12 additions & 8 deletions ui/src/views/team/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="team-manage flex main-calc-height">
<div class="team-member p-8 border-r">
<div class="flex-between p-16">
<h4>{{$t('views.team.member')}}</h4>
<h4>{{ $t('views.team.member') }}</h4>
<el-button type="primary" link @click="addMember">
<AppIcon iconName="app-add-users" class="add-user-icon" />
</el-button>
Expand All @@ -29,7 +29,9 @@
<div class="flex-between">
<div>
<span class="mr-8">{{ row.username }}</span>
<el-tag v-if="isManage(row.type)" class="default-tag">{{$t('views.team.manage')}}</el-tag>
<el-tag v-if="isManage(row.type)" class="default-tag">{{
$t('views.team.manage')
}}</el-tag>
</div>
<div @click.stop style="margin-top: 5px">
<el-dropdown trigger="click" v-if="!isManage(row.type)">
Expand All @@ -38,9 +40,9 @@
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click.prevent="deleteMember(row)"
>{{$t('views.team.delete.button')}}</el-dropdown-item
>
<el-dropdown-item @click.prevent="deleteMember(row)">{{
$t('views.team.delete.button')
}}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
Expand All @@ -53,7 +55,7 @@
</div>
<div class="permission-setting flex" v-loading="rLoading">
<div class="team-manage__table">
<h4 class="p-24 pb-0 mb-4">{{$t('views.team.permissionSetting')}}</h4>
<h4 class="p-24 pb-0 mb-4">{{ $t('views.team.permissionSetting') }}</h4>
<el-tabs v-model="activeName" class="team-manage__tabs">
<el-tab-pane
v-for="(item, index) in settingTags"
Expand All @@ -73,7 +75,7 @@
</div>

<div class="submit-button">
<el-button type="primary" @click="submitPermissions">{{ $t('common.save')}}</el-button>
<el-button type="primary" @click="submitPermissions">{{ $t('common.save') }}</el-button>
</div>
</div>
</div>
Expand Down Expand Up @@ -118,7 +120,9 @@ const settingTags = reactive([

watch(filterText, (val) => {
if (val) {
filterMember.value = memberList.value.filter((v) => v.username.includes(val))
filterMember.value = memberList.value.filter((v) =>
v.username.toLowerCase().includes(val.toLowerCase())
)
} else {
filterMember.value = memberList.value
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code does not contain any immediate irregularities, but there are a few minor improvements that can be made:

  1. Code Consistency: Ensure consistent indentation throughout the file to improve readability.
// Replace all spaces with tabs:
- <el-button type="primary" @click="submitPermissions">{{ $t('common.save')}}</el-button>
+ <el-button type="primary" @click="submitPermissions">${{ $t('common.save') }}</el-button>

// Use braces consistently for multiline expressions within templates:
<el-button type="primary"${{
  onClick: () => deleteMember(row)
}}>{{ $t('views.team.delete.button') }}</el-button>
  1. Variable Naming: Variable names follow typical JavaScript naming conventions, which is good.

  2. Comments Formatting: Comments should start on a new line after each block of text without additional space before them.

// Remove extra space at the end here:
<div class="p-24 pb-0 mb-4">...</div>
// No need to add comment here since it's clear

<!-- Add this to format comments -->
<label>Some Label</label>
<span>This is some inline span.</span>

These changes will enhance readability and maintainability of the code base while adhering to standard coding practices.

Expand Down