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

v0.3.0 merge #106

Merged
merged 12 commits into from
Dec 1, 2018
8 changes: 8 additions & 0 deletions src/Nucleus.Web.Vue/src/admin/views/roles/role-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class RoleListComponent extends NucleusComponentBase {
public formTitle = '';
public pagination = {};
public search = '';
public selectAll = false;

get headers() {
return [
Expand Down Expand Up @@ -112,4 +113,11 @@ export default class RoleListComponent extends NucleusComponentBase {
this.loading = false;
});
}

public selectAllPermissions() {
this.createOrUpdateRoleInput.grantedPermissionIds = [];
if (this.selectAll) {
this.createOrUpdateRoleInput.grantedPermissionIds = ((this.allPermissions.map(permissions => permissions.id)) as string[]);
}
}
}
4 changes: 2 additions & 2 deletions src/Nucleus.Web.Vue/src/admin/views/roles/role-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<v-text-field v-model="createOrUpdateRoleInput.role.name"
:label="$t('RoleName')"
:rules="[requiredError]"></v-text-field>
<v-list dense subheader>
<v-subheader>{{$t('SelectPermissions')}}</v-subheader>
<v-list dense>
<v-checkbox v-model="selectAll" :label="$t('SelectPermissions')" @click="selectAllPermissions"></v-checkbox>
<v-list-tile v-for="item in allPermissions" :key="item.id">
<v-list-tile-content>
<v-checkbox v-model="createOrUpdateRoleInput.grantedPermissionIds" :label="item.displayName" :value="item.id"></v-checkbox>
Expand Down
8 changes: 8 additions & 0 deletions src/Nucleus.Web.Vue/src/admin/views/users/user-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default class UserListComponent extends NucleusComponentBase {
public errors: INameValueDto[] = [];
public allRoles: IRoleDto[] = [];
public isEdit = false;
public selectAll = false;

get headers() {
return [
Expand Down Expand Up @@ -120,4 +121,11 @@ export default class UserListComponent extends NucleusComponentBase {
public isAdminUser(userName: string) {
return userName.includes('admin');
}

public selectAllRoles() {
this.createOrUpdateUserInput.grantedRoleIds = [];
if (this.selectAll) {
this.createOrUpdateUserInput.grantedRoleIds = ((this.allRoles.map(roles => roles.id)) as string[]);
}
}
}
24 changes: 12 additions & 12 deletions src/Nucleus.Web.Vue/src/admin/views/users/user-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@
</v-alert>
</div>
<v-form ref="form" @keyup.native.enter="save">
<v-text-field name="userName" :label="$t('UserName')" type="text"
v-model="createOrUpdateUserInput.user.userName"
<v-text-field name="userName" :label="$t('UserName')" type="text"
v-model="createOrUpdateUserInput.user.userName"
:rules="[requiredError]"></v-text-field>
<v-text-field name="email" :label="$t('EmailAddress')" type="text"
v-model="createOrUpdateUserInput.user.email"
<v-text-field name="email" :label="$t('EmailAddress')" type="text"
v-model="createOrUpdateUserInput.user.email"
:rules="[requiredError,emailError]"></v-text-field>
<v-text-field v-if="!isEdit" name="password" :label="$t('Password')" type="password"
v-model="createOrUpdateUserInput.user.password"
<v-text-field v-if="!isEdit" name="password" :label="$t('Password')" type="password"
v-model="createOrUpdateUserInput.user.password"
:rules="[requiredError]"></v-text-field>
<v-text-field v-if="isEdit" name="password" :label="$t('Password')" type="password"
<v-text-field v-if="isEdit" name="password" :label="$t('Password')" type="password"
v-model="createOrUpdateUserInput.user.password"></v-text-field>
<v-text-field v-if="!isEdit" name="passwordRepeat" :label="$t('PasswordRepeat')" type="password"
v-model="createOrUpdateUserInput.user.passwordRepeat"
:error-messages='passwordMatchError(createOrUpdateUserInput.user.password,createOrUpdateUserInput.user.passwordRepeat)'
v-model="createOrUpdateUserInput.user.passwordRepeat"
:error-messages='passwordMatchError(createOrUpdateUserInput.user.password,createOrUpdateUserInput.user.passwordRepeat)'
:rules="[requiredError]"></v-text-field>
<v-text-field v-if="isEdit" name="passwordRepeat" :label="$t('PasswordRepeat')" type="password"
v-model="createOrUpdateUserInput.user.passwordRepeat"
v-model="createOrUpdateUserInput.user.passwordRepeat"
:error-messages='passwordMatchError(createOrUpdateUserInput.user.password,createOrUpdateUserInput.user.passwordRepeat)'></v-text-field>
<v-list dense subheader>
<v-subheader>{{$t('SelectRoles')}}</v-subheader>
<v-list dense>
<v-checkbox v-model="selectAll" :label="$t('SelectRoles')" @click="selectAllRoles"></v-checkbox>
<v-list-tile v-for="item in allRoles" :key="item.id">
<v-list-tile-content>
<v-checkbox v-model="createOrUpdateUserInput.grantedRoleIds" :label="item.name" :value="item.id"></v-checkbox>
Expand Down
1 change: 1 addition & 0 deletions src/Nucleus.Web.Vue/src/assets/js/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Roles": "Roles",
"Save": "Save",
"Search": "Search",
"SelectAll": "Select all",
"SelectPermissions": "Select permissions",
"SelectRoles": "Select roles",
"Successful": "Successful!",
Expand Down
1 change: 1 addition & 0 deletions src/Nucleus.Web.Vue/src/assets/js/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Roles": "Roller",
"Save": "Kaydet",
"Search": "Ara",
"SelectAll": "Tümünü seç",
"SelectPermissions": "Yetki seçin",
"SelectRoles": "Rol seçin",
"Successful": "Başarılı!",
Expand Down