Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCourrier
Commits
c31ddc82
Commit
c31ddc82
authored
Jun 01, 2021
by
Guillaume Heurtier
Browse files
FEAT #14753 TIME 0:20 hide sector field if no sector was found for selected address
parent
db589e40
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/frontend/app/administration/contact/page/form/contacts-form.component.ts
View file @
c31ddc82
...
...
@@ -262,7 +262,7 @@ export class ContactsFormComponent implements OnInit {
type
:
'
string
'
,
control
:
new
FormControl
({
value
:
''
,
disabled
:
true
}),
required
:
false
,
display
:
tru
e
,
display
:
fals
e
,
filling
:
false
,
values
:
[]
},
...
...
@@ -814,12 +814,19 @@ export class ContactsFormComponent implements OnInit {
this
.
checkFilling
();
this
.
http
.
get
(
'
../rest/contacts/sector
'
,
{
params
:
{
'
addressNumber
'
:
contact
[
'
addressNumber
'
],
'
addressStreet
'
:
contact
[
'
addressStreet
'
],
'
addressPostcode
'
:
contact
[
'
addressPostcode
'
],
'
addressTown
'
:
contact
[
'
addressTown
'
]}}).
pipe
(
tap
((
data
:
any
)
=>
{
const
sectorIndex
=
this
.
contactForm
.
findIndex
(
element
=>
element
.
id
===
'
sector
'
);
if
(
data
.
sector
!==
null
)
{
const
sectorIndex
=
this
.
contactForm
.
findIndex
(
element
=>
element
.
id
===
'
sector
'
);
this
.
contactForm
[
sectorIndex
].
control
.
setValue
(
data
.
sector
.
label
);
this
.
contactForm
[
sectorIndex
].
display
=
true
;
}
else
{
this
.
contactForm
[
sectorIndex
].
control
.
setValue
(
''
);
this
.
contactForm
[
sectorIndex
].
display
=
false
;
}
}),
catchError
((
err
:
any
)
=>
{
this
.
notify
.
handleErrors
(
err
);
return
of
(
false
);
})
).
subscribe
();
this
.
addressBANMode
=
disableBan
?
false
:
true
;
...
...
Write
Preview
Supports
Markdown
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