Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Narendar Vakiti
mytime
Commits
42546162
Commit
42546162
authored
Aug 09, 2018
by
dgoud-nisum-com
Committed by
rbonthala-nisum-com
Aug 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Name validation and default shift is shown in shift details screen (#139)
parent
d2823a8d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
3 deletions
+49
-3
AssignRolesController.js
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
+10
-0
DomainController.js
src/main/webapp/WEB-INF/controllers/DomainController.js
+13
-0
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+11
-1
ShiftDetailsController.js
...main/webapp/WEB-INF/controllers/ShiftDetailsController.js
+2
-2
assignAccountsController.js
...in/webapp/WEB-INF/controllers/assignAccountsController.js
+13
-0
No files found.
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
View file @
42546162
...
...
@@ -340,6 +340,13 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}
return
false
;
}
function
validateTextFields
(
name
){
var
pattern
=
/^
[
a-zA-Z
\s]
*$/
;
if
(
pattern
.
test
(
name
)){
return
true
;
}
return
false
;
}
$scope
.
validateFields
=
function
(){
var
today
=
new
Date
();
...
...
@@ -373,6 +380,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}
else
if
(
empName
==
""
){
$scope
.
alertMsg
=
"Employee Name is mandatory"
;
document
.
getElementById
(
'empName'
).
focus
();
}
else
if
(
empName
!=
""
&&
!
validateTextFields
(
empName
)){
$scope
.
alertMsg
=
"Please enter alphabets only"
;
document
.
getElementById
(
'empName'
).
focus
();
}
else
if
(
gender
==
""
)
{
$scope
.
alertMsg
=
"Gender is mandatory"
;
document
.
getElementById
(
'gender'
).
focus
();
...
...
src/main/webapp/WEB-INF/controllers/DomainController.js
View file @
42546162
...
...
@@ -201,6 +201,13 @@ myApp.controller("domainController",
}
}
}
function
validateTextFields
(
name
){
var
pattern
=
/^
[
a-zA-Z
\s]
*$/
;
if
(
pattern
.
test
(
name
)){
return
true
;
}
return
false
;
}
function
AddDomainController
(
$scope
,
$mdDialog
,
dataToPass
,
gridOptionsData
,
employees
)
{
console
.
log
(
"employees"
,
employees
);
...
...
@@ -448,6 +455,9 @@ myApp.controller("domainController",
}
else
if
(
domainName
==
""
||
undefined
){
$scope
.
alertMsg
=
"Please enter a Domain Name"
;
document
.
getElementById
(
'domainName'
).
focus
();
}
else
if
(
domainName
!=
""
&&
!
validateTextFields
(
domainName
)){
$scope
.
alertMsg
=
"Please enter alphabets only"
;
document
.
getElementById
(
'domainName'
).
focus
();
}
else
if
(
deliveryManagers
.
length
<=
0
){
$scope
.
alertMsg
=
"Please select a deliveryManagers"
;
document
.
getElementById
(
'selectDeliveryLeads'
).
focus
();
...
...
@@ -471,6 +481,9 @@ myApp.controller("domainController",
}
else
if
(
domainName
==
""
||
undefined
)
{
$scope
.
alertMsg
=
"Please enter a Domain Name"
;
document
.
getElementById
(
'domainName'
).
focus
();
}
else
if
(
domainName
!=
""
&&
!
validateTextFields
(
domainName
)){
$scope
.
alertMsg
=
"Please enter alphabets only"
;
document
.
getElementById
(
'domainName'
).
focus
();
}
else
if
(
deliveryManagers
.
length
<=
0
){
$scope
.
alertMsg
=
"Please select a deliveryManagers"
;
document
.
getElementById
(
'selectDeliveryLeads'
).
focus
();
...
...
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
42546162
...
...
@@ -1181,7 +1181,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
if
(
projectName
==
""
)
{
$scope
.
alertMsg
=
"Project Name is mandatory"
;
document
.
getElementById
(
'projectName'
).
focus
();
}
else
if
(
account
==
undefined
||
account
==
""
)
{
}
else
if
(
projectName
!=
""
&&
!
validateTextFields
(
projectName
)){
$scope
.
alertMsg
=
"Please enter alphabets only"
;
document
.
getElementById
(
'projectName'
).
focus
();
}
else
if
(
account
==
undefined
||
account
==
""
)
{
$scope
.
alertMsg
=
"Account is mandatory"
;
document
.
getElementById
(
'account'
).
focus
();
...
...
@@ -1549,5 +1552,12 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}
return
false
;
}
function
validateTextFields
(
name
){
var
pattern
=
/^
[
a-zA-Z
\s]
*$/
;
if
(
pattern
.
test
(
name
)){
return
true
;
}
return
false
;
}
}
});
src/main/webapp/WEB-INF/controllers/ShiftDetailsController.js
View file @
42546162
...
...
@@ -73,8 +73,8 @@ myApp.controller("shiftDetailsController",function($scope, myFactory,exportUiGri
$scope
.
shifts
=
myFactory
.
getShifts
();
//["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 AM)"];
var
shiftV
=
$scope
.
shiftValue
;
if
(
shiftV
==
undefined
||
shiftV
==
""
){
shiftV
=
"Shift
2(03:30 PM - 12:3
0 PM)"
;
if
(
shiftV
==
undefined
||
shiftV
==
""
){
shiftV
=
"Shift
1(09:00 AM - 06:0
0 PM)"
;
}
$scope
.
shiftValue
=
shiftV
;
$scope
.
selectedshiftValue
=
shiftV
;
...
...
src/main/webapp/WEB-INF/controllers/assignAccountsController.js
View file @
42546162
...
...
@@ -335,6 +335,9 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
if
(
accountName
==
undefined
||
accountName
==
""
){
$scope
.
alertMsg
=
"Please enter the account Name"
;
document
.
getElementById
(
'accountName'
).
focus
();
}
else
if
(
accountName
!=
""
&&
!
validateTextFields
(
accountName
)){
$scope
.
alertMsg
=
"Please enter alphabets only"
;
document
.
getElementById
(
'accountName'
).
focus
();
}
else
if
(
industryType
==
undefined
||
industryType
==
""
){
$scope
.
alertMsg
=
"Please enter the industry type"
;
document
.
getElementById
(
'industryType'
).
focus
();
...
...
@@ -356,6 +359,9 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
if
(
accountName
==
undefined
||
accountName
==
""
){
$scope
.
alertMsg
=
"Please enter the account Name"
;
document
.
getElementById
(
'accountName'
).
focus
();
}
else
if
(
accountName
!=
""
&&
!
validateTextFields
(
accountName
)){
$scope
.
alertMsg
=
"Please enter alphabets only"
;
document
.
getElementById
(
'accountName'
).
focus
();
}
else
if
(
industryType
==
undefined
||
industryType
==
""
){
$scope
.
alertMsg
=
"Please enter the industry type"
;
document
.
getElementById
(
'industryType'
).
focus
();
...
...
@@ -430,6 +436,13 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
return
arr
.
indexOf
(
item
)
==
pos
;
})
}
function
validateTextFields
(
name
){
var
pattern
=
/^
[
a-zA-Z
\s]
*$/
;
if
(
pattern
.
test
(
name
)){
return
true
;
}
return
false
;
}
}
});
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