feat(admin/users): support multiple roles in user table and form
UsersTable now shows all role labels joined (not just the first role), and its CSS badge class is based on the primary role. UserFormPage uses a multi-select for roles instead of a single-select, and the form validation requires at least one role. TermItem layout fix for inactive badge alignment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { number, object, string } from 'yup'
|
||||
import { array, number, object, string } from 'yup'
|
||||
import { passwordRule } from '@/constants/rules/passwordRule'
|
||||
import { phoneNumberRule } from '@/constants/rules/phoneNumberRule'
|
||||
import { nationalCodeRule } from '@/constants/rules/nationalCodeRule'
|
||||
@@ -9,7 +9,7 @@ export const rejectionReasonSchema = object().shape({
|
||||
})
|
||||
|
||||
const baseUserShape = {
|
||||
role: string().required(),
|
||||
roles: array().of(string().required()).min(1, 'حداقل یک نقش را انتخاب کنید').required(),
|
||||
name: string().required().min(3),
|
||||
phone: phoneNumberRule,
|
||||
nationalCode: nationalCodeRule,
|
||||
|
||||
Reference in New Issue
Block a user