Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myjob-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
myjob-manage
Commits
2354e7e1
Commit
2354e7e1
authored
Jul 11, 2025
by
Natthaphat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Myjob - ผู้ดูแลระบบ > การจัดการผู้สมัครงาน แก้ตาม Test filed
parent
83db1670
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
27 deletions
+75
-27
user-setting.component.html
.../user-management/user-setting/user-setting.component.html
+46
-21
user-setting.component.ts
...on/user-management/user-setting/user-setting.component.ts
+17
-1
user.model.ts
src/app/DPU/models/user.model.ts
+4
-3
en.json
src/assets/i18n/en.json
+4
-1
th.json
src/assets/i18n/th.json
+4
-1
No files found.
src/app/DPU/common/user-management/user-setting/user-setting.component.html
View file @
2354e7e1
...
...
@@ -60,7 +60,6 @@
<th
scope=
"col"
class=
"text-start"
>
{{ 'Candidate ID' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Fullname' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Email' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Mobile' | translate}}
</th>
<!-- <th scope="col" class="text-start">{{ 'User Group' | translate}}</th> -->
<th
scope=
"col"
class=
"text-start"
>
{{ 'Status' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Update Date' | translate}}
</th>
...
...
@@ -107,12 +106,6 @@
class=
"ri-mail-line me-2 align-middle text-[.875rem] text-[#8c9097] dark:text-white/50 inline-flex"
></i>
{{item.email}}
</span>
</div>
</td>
<td>
<div>
<span
class=
"block"
><i
class=
"ri-phone-line me-2 align-middle text-[.875rem] text-[#8c9097] dark:text-white/50 inline-flex"
></i>
{{item.phoneNumberProfile}}
</span>
</div>
</td>
<!-- <td> <span
class="badge bg-{{ item.role == 0 ? 'primary' : 'info'}} text-white">{{item.getRole()}}</span>
</td> -->
...
...
@@ -204,7 +197,8 @@
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
{{ (modalStatus == 'add' ? ('Create' | translate) : ('Edit' | translate)) + ' ' + ('User Information' | translate) }}
{{ (modalStatus == 'add' ? ('Create' | translate) : ('Edit' | translate)) + ' ' + ('User Information' |
translate) }}
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
...
...
@@ -221,8 +215,9 @@
<span
class=
"avatar avatar-xxl avatar-rounded"
>
<img
[
src
]="
selectModel
.
getPicture
()"
alt=
""
id=
"profile-img"
>
<span
class=
"badge rounded-full bg-primary avatar-badge"
>
<input
(
click
)="
triggerFileInput
()"
ng2FileSelect
[
uploader
]="
uploaderProfile
"
type=
"file"
name=
"photo"
[
disabled
]="
action =
==
'
edit
'"
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
>
<input
(
click
)="
triggerFileInput
()"
ng2FileSelect
[
uploader
]="
uploaderProfile
"
type=
"file"
name=
"photo"
[
disabled
]="
action =
==
'
edit
'"
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
>
<i
class=
"fe fe-camera text-[.625rem]"
></i>
</span>
</span>
...
...
@@ -291,7 +286,8 @@
</div>
<div
class=
"xl:col-span-6 col-span-12"
*
ngIf=
"modalStatus=='edit'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Name-Surname(Thai)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
thFullName
"
[
disabled
]="
action =
==
'
edit
'"
>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
thFullName
"
[
disabled
]="
action =
==
'
edit
'"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.thFullName"
>
{{'Please fill in information' | translate}}
</div>
...
...
@@ -307,19 +303,30 @@
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Email' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
email
"
[
disabled
]="
action =
==
'
edit
'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'Email' | translate }}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
email
"
[
disabled
]="
action =
==
'
edit
'"
(
ngModelChange
)="
onEmailChange
($
event
)"
/>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.email"
>
{{'Please fill in information' | translate}}
{{ 'Please fill in information' | translate }}
</div>
<div
class=
"text-danger"
*
ngIf=
"selectModel.email && (!selectModel.email.includes('@'))"
>
{{ 'Invalid email format @' | translate }}
</div>
<div
class=
"text-danger"
*
ngIf=
"selectModel.email && selectModel.email.includes('@') && !selectModel.email.split('@')[1]?.includes('.')"
>
{{ 'Invalid email format .' | translate }}
</div>
<div
class=
"text-danger"
*
ngIf=
"isEmailDuplicate && action !== 'edit'"
>
{{ 'This email already exists' | translate }}
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'
Mobile
' | translate}}
</label>
<input
type=
"
text
"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[
disabled
]="
action =
==
'
edit
'"
[(
ngModel
)]="
selectModel
.
p
honeNumberProfile
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.p
honeNumberProfile
"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'
Password
' | translate}}
</label>
<input
type=
"
password
"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[
disabled
]="
action =
==
'
edit
'"
[(
ngModel
)]="
selectModel
.
p
assword
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.p
assword && action !=='edit'
"
>
{{'Please fill in information' | translate}}
</div>
</div>
...
...
@@ -336,7 +343,7 @@
<div
class=
"xl:col-span-12 col-span-12"
>
<label
class=
"form-label"
>
{{'Status' | translate}}
</label>
<ng-select
name=
"choices-multiple-remove-button2"
id=
"choices-multiple-remove-button2"
placeholder=
""
[(
ngModel
)]="
selectModel
.
status
"
>
[
disabled
]="
action =
==
'
edit
'"
[
(
ngModel
)]="
selectModel
.
status
"
>
<ng-option
[
value
]="
0
"
>
{{'Unactive' | translate}}
</ng-option>
<ng-option
[
value
]="
1
"
>
{{'Active' | translate}}
</ng-option>
</ng-select>
...
...
@@ -349,8 +356,26 @@
data-hs-overlay=
"#modal-detail"
>
{{'Cancel' | translate}}
</button>
<button
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
>
{{'Save' |
translate}}
</button>
<button
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
[
class
.
ti-btn-disabled
]="
!
selectModel
.
candidateId
||
!
selectModel
.
thFirstname
||
!
selectModel
.
thLastname
||
!
selectModel
.
engFirstname
||
!
selectModel
.
engLastname
||
(!
selectModel
.
email
||
isEmailDuplicate
||
!
selectModel
.
email
.
includes
('@')
||
!
selectModel
.
email
.
includes
('.'))
||
!
selectModel
.
password
"
[
disabled
]="
!
selectModel
.
candidateId
||
!
selectModel
.
thFirstname
||
!
selectModel
.
thLastname
||
!
selectModel
.
engFirstname
||
!
selectModel
.
engLastname
||
(!
selectModel
.
email
||
isEmailDuplicate
||
!
selectModel
.
email
.
includes
('@')
||
!
selectModel
.
email
.
includes
('.'))
||
!
selectModel
.
password
"
>
{{ 'Save' | translate }}
</button>
</div>
</div>
</div>
...
...
src/app/DPU/common/user-management/user-setting/user-setting.component.ts
View file @
2354e7e1
...
...
@@ -24,7 +24,7 @@ import { TokenService } from "../../../../shared/services/token.service";
NgSelectModule
,
FormsModule
,
FileUploadModule
],
],
templateUrl
:
'./user-setting.component.html'
,
styleUrl
:
'./user-setting.component.css'
})
...
...
@@ -47,6 +47,8 @@ export class UserSettingComponent {
uploaderProfile
:
FileUploader
|
undefined
;
uploadErrorMsg
:
string
=
""
;
modalStatus
:
"add"
|
"edit"
=
"add"
existingEmails
:
UserProfileModel
[]
=
[]
isEmailDuplicate
=
false
;
get
searchTerm
():
string
{
return
this
.
_searchTerm
;
}
...
...
@@ -123,9 +125,19 @@ export class UserSettingComponent {
this
.
itemsList
=
result
.
map
(
item
=>
new
UserProfileModel
(
item
,
this
.
translate
));
this
.
filterList
=
[...
this
.
itemsList
];
});
this
.
userService
.
getListsProfile
().
subscribe
(
email
=>
{
this
.
existingEmails
=
email
;
});
}
onEmailChange
(
email
:
string
)
{
const
lowerEmail
=
email
.
trim
().
toLowerCase
();
this
.
isEmailDuplicate
=
this
.
existingEmails
.
some
(
user
=>
user
.
email
&&
user
.
email
.
toLowerCase
()
===
lowerEmail
);
}
filter
(
v
:
string
):
UserProfileModel
[]
{
const
search
=
v
.
toLowerCase
();
return
this
.
itemsList
?.
filter
(
x
=>
...
...
@@ -162,6 +174,7 @@ export class UserSettingComponent {
new
()
{
this
.
action
=
'add'
this
.
selectModel
=
new
UserProfileModel
()
this
.
selectModel
.
status
=
1
;
}
view
(
item
:
UserProfileModel
)
{
...
...
@@ -183,6 +196,9 @@ export class UserSettingComponent {
if
(
willDelete
)
{
if
(
this
.
action
==
'add'
)
{
this
.
userService
.
save
(
this
.
selectModel
).
subscribe
(
result
=>
{
if
(
this
.
selectModel
.
email
)
{
swal
(
"Save Success!!"
,
"อีเมลซ่ำ"
,
"warning"
);
}
console
.
log
(
result
)
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
ngOnInit
()
...
...
src/app/DPU/models/user.model.ts
View file @
2354e7e1
...
...
@@ -97,13 +97,14 @@ export class UserProfileModel extends BaseModel {
getPicture
():
string
{
if
(
this
.
picture
)
{
return
environment
.
baseUrl
+
"/files/image/"
+
this
.
picture
return
environment
.
baseUrl
+
"/files/image/"
+
this
.
picture
;
}
else
{
return
""
// รูป default ใน assets ต้องใช้ path แบบ relative สำหรับ Angular
return
"assets/images/faces/1.jpg"
;
}
}
getFullname
():
string
{
return
this
.
thFirstname
+
" "
+
this
.
thLastname
;
}
...
...
src/assets/i18n/en.json
View file @
2354e7e1
...
...
@@ -104,5 +104,8 @@
"Degree ID"
:
"Degree ID"
,
"Degree"
:
"Degree"
,
"Career Cluster Information"
:
"ข้อมูลกลุ่มอาชีพ"
,
"Career Cluster ID"
:
"Career Cluster ID"
"Career Cluster ID"
:
"Career Cluster ID"
,
"Invalid email format @"
:
"May be you forgot @ [ Ex. ] username@hostname.com"
,
"Invalid email format ."
:
"Why after @ have not dot [ Ex. ] username@hostname.com"
,
"This email already exists"
:
"This email already exists"
}
src/assets/i18n/th.json
View file @
2354e7e1
...
...
@@ -104,5 +104,8 @@
"Degree ID"
:
"รหัสระดับการศึกษา"
,
"Degree"
:
"ระดับการศึกษา"
,
"Career Cluster Information"
:
"ข้อมูลกลุ่มอาชีพ"
,
"Career Cluster ID"
:
"รหัสกลุ่มอาชีพ"
"Career Cluster ID"
:
"รหัสกลุ่มอาชีพ"
,
"Invalid email format @"
:
"ไม่ได้ใส่ @ [ ตัวอย่าง ] username@hostname.com"
,
"Invalid email format ."
:
"หลัง @ ไม่ได้ใส่ . หลังชื่อ [ ตัวอย่าง ] username@hostname.com"
,
"This email already exists"
:
"อีเมลนี้มีอยู่แล้ว"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment