Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
upsmf-common-form-elements-portal
Commits
64a5bb0e
Commit
64a5bb0e
authored
3 years ago
by
Rajnish Dargan
Browse files
Options
Download
Patches
Plain Diff
Issue #SB-23817 feat: Timer input user experience
parent
1424d1a6
snyk-upgrade-f42e30417b693e2eb5ca260d9cbfc5b9
master
release-4.10.1
release-4.3.0
release-4.4.0
release-4.5.0
release-4.6.0
release-4.7.0
release-4.8.0
release-4.9.0
release-5.0.0
release-5.0.1
release-5.1.0_v10
release-5.1.0_v11
release-5.1.0_v12
release-6.0.0_v13
release-6.0.0_v13-mobile
release-6.0.0_v14
revert-117-tag-input
revert-119-hotfix/edit-details
revert-94-tag-input
snyk-fix-bb6706a537ba2f5a29d4d0c4ea441193
snyk-upgrade-12c917ac8d79f5e72ebd71b7407f6ac6
snyk-upgrade-39fee69ffac9d0a0df5d5d24424777d8
snyk-upgrade-822eb34879b2fea17e28fad6b3e6a789
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
projects/common-form-elements/src/lib/dynamic-form/dynamic-form.component.ts
+6
-6
...m-elements/src/lib/dynamic-form/dynamic-form.component.ts
projects/common-form-elements/src/lib/dynamic-timer/dynamic-timer.component.html
+4
-4
...ements/src/lib/dynamic-timer/dynamic-timer.component.html
projects/common-form-elements/src/lib/dynamic-timer/dynamic-timer.component.ts
+1
-1
...elements/src/lib/dynamic-timer/dynamic-timer.component.ts
with
11 additions
and
11 deletions
+11
-11
projects/common-form-elements/src/lib/dynamic-form/dynamic-form.component.ts
+
6
−
6
View file @
64a5bb0e
...
...
@@ -356,12 +356,12 @@ export class DynamicFormComponent implements OnInit, OnChanges, OnDestroy {
validateMaxTime
(
maxTimeValue
,
field
,
control
:
AbstractControl
):
ValidationErrors
|
null
{
if
(
control
.
value
&&
maxTimeValue
)
{
const
maxTimeInputTime
Array
=
control
.
value
.
split
(
'
:
'
);
const
maxTimeAllowed
Array
=
maxTimeValue
.
split
(
'
:
'
);
const
maxTimeAllowedInSeconds
=
(
_
.
parseInt
(
maxTimeAllowed
Array
[
0
])
*
3600
)
+
(
_
.
parseInt
(
maxTimeAllowed
Array
[
1
])
*
60
);
const
maxTimeInputInSeconds
=
(
_
.
parseInt
(
maxTimeInputTime
Array
[
0
])
*
3600
)
+
(
_
.
parseInt
(
maxTimeInputTime
Array
[
1
])
*
60
);
const
maxTimeInputTime
=
control
.
value
.
split
(
'
:
'
);
const
maxTimeAllowed
=
maxTimeValue
.
split
(
'
:
'
);
const
maxTimeAllowedInSeconds
=
(
_
.
parseInt
(
maxTimeAllowed
[
0
])
*
3600
)
+
(
_
.
parseInt
(
maxTimeAllowed
[
1
])
*
60
);
const
maxTimeInputInSeconds
=
(
_
.
parseInt
(
maxTimeInputTime
[
0
])
*
3600
)
+
(
_
.
parseInt
(
maxTimeInputTime
[
1
])
*
60
);
if
(
maxTimeInputInSeconds
>
maxTimeAllowedInSeconds
)
{
return
{
maxtimevalue
:
true
};
}
...
...
This diff is collapsed.
Click to expand it.
projects/common-form-elements/src/lib/dynamic-timer/dynamic-timer.component.html
+
4
−
4
View file @
64a5bb0e
...
...
@@ -22,8 +22,8 @@
<div>
<input
class=
"p-10 mr-20"
list=
"hours"
#hourField
name=
"hour"
id=
"hour"
maxlength=
"2"
placeholder=
"{{placeholders[0]}}"
(change)=
"onChangeTimer(
field,
'hr', $event.target.value)"
(keyup)=
"onChangeTimer(
field,
'hr', $event.target.value);"
(change)=
"onChangeTimer('hr', $event.target.value)"
(keyup)=
"onChangeTimer('hr', $event.target.value);"
(focusout)=
"onFocusOutEvent('hr', $event.target.value)"
[attr.disabled]=
"disabled ? true : ( depends ? (isDependsInvalid ? true : null) : null )"
>
<datalist
id=
"hours"
>
...
...
@@ -33,8 +33,8 @@
<div>
<input
class=
"p-10 mr-20"
list=
"minutes"
#minField
name=
"minute"
id=
"minute"
maxlength=
"2"
placeholder=
"{{placeholders[1]}}"
(change)=
"onChangeTimer(
field,
'min', $event.target.value)"
(keyup)=
"onChangeTimer(
field,
'min', $event.target.value)"
(change)=
"onChangeTimer('min', $event.target.value)"
(keyup)=
"onChangeTimer('min', $event.target.value)"
(focusout)=
"onFocusOutEvent('min', $event.target.value)"
[attr.disabled]=
"disabled ? true : ( depends ? (isDependsInvalid ? true : null) : null )"
>
<datalist
id=
"minutes"
>
...
...
This diff is collapsed.
Click to expand it.
projects/common-form-elements/src/lib/dynamic-timer/dynamic-timer.component.ts
+
1
−
1
View file @
64a5bb0e
...
...
@@ -228,7 +228,7 @@ export class DynamicTimerComponent implements OnInit, OnDestroy {
}
}
onChangeTimer
(
field
,
fieldType
,
value
)
{
onChangeTimer
(
fieldType
,
value
)
{
if
(
fieldType
===
'
hr
'
)
{
const
numericValue
=
value
.
replace
(
/
[^
0-9
]
/g
,
''
);
this
.
defaultHr
=
numericValue
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets