2.9 KiB
2.9 KiB
| name | description | type |
|---|---|---|
| No Position Assignment Page | Feature implementation for users without organization position assignment | reference |
No Position Assignment Page Feature
When a user doesn't have a position assignment (สังกัด), they are redirected to a dedicated page explaining they are not part of the organization structure.
Files Created/Modified
-
Created:
/Users/waruneeta/Desktop/ChamomindWorking/HRMSProject/hrms-checkin/src/views/NoPositionView.vue- Displays message in Thai: "ไม่พบข้อมูลสังกัด"
- Shows icon and explanation text
- "ตกลง" (OK) button that shows confirmation dialog
- After confirmation, performs logout and clears positionKeycloak store
-
Modified:
/Users/waruneeta/Desktop/ChamomindWorking/HRMSProject/hrms-checkin/src/router/index.ts- Added new route
/no-positionwithAuth: false - Enhanced router guard to check for position data
- Redirects to
/no-positionif user has no organization assignment
- Added new route
-
Modified:
/Users/waruneeta/Desktop/ChamomindWorking/HRMSProject/hrms-checkin/src/views/MainView.vue- Updated
fetchKeycloakPosition()function - Checks if
organizationobject exists and has any data - Redirects to
/no-positionif no organization data found
- Updated
Logic Flow
- User logs in successfully
MainView.vuecallsfetchKeycloakPosition()inonMounted()- API returns position data from
/org/profile/keycloak/position - System checks if
organizationobject has any non-null values (root, child1-4) - If no organization data exists:
- User is redirected to
/no-position - User sees message explaining they need to contact staff
- User clicks "ตกลง" to logout
- Staff adds them to organization structure
- User can login again
- User is redirected to
Position Data Structure
interface KeycloakPosition {
privacyCheckin: boolean
avatarName?: string
profileId: string
organization?: Organization
}
interface Organization {
root?: string
child1?: string
child2?: string
child3?: string
child4?: string
}
A user is considered to have "no position" when all organization fields (root, child1, child2, child3, child4) are null or undefined.
Thai UI Messages
- Page title: "ไม่พบข้อมูลสังกัด"
- Description: "ท่านยังไม่มีสังกัดในโครงสร้างองค์กร กรุณาติดต่อเจ้าหน้าที่เพื่อดำเนินการเพิ่มข้อมูล"
- Confirmation dialog: "ยืนยันการออกจากระบบ" - "ท่านจะถูกนำออกจากระบบเพื่อให้เจ้าหน้าที่ดำเนินการเพิ่มข้อมูลสังกัดในโครงสร้างองค์กร"
- Button: "ตกลง"