Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
2d596833
Commit
2d596833
authored
2 years ago
by
Hamza HRAMCHI
Browse files
Options
Downloads
Patches
Plain Diff
FIX #17671 TIME 0:15 fix undefined values + delete unless object
parent
0cd2f294
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/frontend/app/search/search.component.ts
+14
-8
14 additions, 8 deletions
src/frontend/app/search/search.component.ts
with
14 additions
and
8 deletions
src/frontend/app/search/search.component.ts
+
14
−
8
View file @
2d596833
...
@@ -212,6 +212,9 @@ export class SearchComponent implements OnInit {
...
@@ -212,6 +212,9 @@ export class SearchComponent implements OnInit {
objToSend
[
filter
.
id
]
=
filter
.
val
;
objToSend
[
filter
.
id
]
=
filter
.
val
;
}
}
});
});
if
(
!
this
.
functionsService
.
empty
(
objToSend
[
'
documentState
'
]))
{
delete
objToSend
[
'
documentState
'
];
}
return
objToSend
;
return
objToSend
;
}
}
...
@@ -276,6 +279,11 @@ export class SearchComponent implements OnInit {
...
@@ -276,6 +279,11 @@ export class SearchComponent implements OnInit {
spinner
:
'
dots
'
spinner
:
'
dots
'
}).
then
(
async
(
load
:
HTMLIonLoadingElement
)
=>
{
}).
then
(
async
(
load
:
HTMLIonLoadingElement
)
=>
{
load
.
present
();
load
.
present
();
if
(
!
this
.
functionsService
.
empty
(
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
)))
{
if
(
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
values
[
0
].
selected
===
false
)
{
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
val
=
[];
}
}
await
this
.
launchSearch
();
await
this
.
launchSearch
();
load
.
dismiss
();
load
.
dismiss
();
});
});
...
@@ -288,7 +296,7 @@ export class SearchComponent implements OnInit {
...
@@ -288,7 +296,7 @@ export class SearchComponent implements OnInit {
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
uri
:
string
=
'
../rest/search/documents?limit=10&offset=0
'
;
let
uri
:
string
=
'
../rest/search/documents?limit=10&offset=0
'
;
uri
=
this
.
canPurge
&&
this
.
filters
.
find
((
filter
:
any
)
=>
filter
.
id
===
'
documentState
'
).
values
[
0
].
selected
?
uri
.
concat
(
'
&deleted=true
'
)
:
uri
;
uri
=
this
.
canPurge
&&
this
.
filters
.
find
((
filter
:
any
)
=>
filter
.
id
===
'
documentState
'
)
?
.
values
[
0
].
selected
?
uri
.
concat
(
'
&deleted=true
'
)
:
uri
;
this
.
http
.
post
(
`
${
uri
}
`
,
this
.
formatDatas
())
this
.
http
.
post
(
`
${
uri
}
`
,
this
.
formatDatas
())
.
pipe
(
.
pipe
(
tap
((
data
:
any
)
=>
{
tap
((
data
:
any
)
=>
{
...
@@ -314,10 +322,6 @@ export class SearchComponent implements OnInit {
...
@@ -314,10 +322,6 @@ export class SearchComponent implements OnInit {
this
.
currentFilters
=
this
.
currentFilters
.
filter
((
item
:
any
)
=>
item
.
id
!==
'
workflowStates
'
);
this
.
currentFilters
=
this
.
currentFilters
.
filter
((
item
:
any
)
=>
item
.
id
!==
'
workflowStates
'
);
}
}
}
}
if
(
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
values
[
0
].
selected
===
false
)
{
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
val
=
[];
}
}
}
loadData
(
event
:
any
)
{
loadData
(
event
:
any
)
{
...
@@ -327,7 +331,7 @@ export class SearchComponent implements OnInit {
...
@@ -327,7 +331,7 @@ export class SearchComponent implements OnInit {
}
else
{
}
else
{
this
.
offset
=
this
.
offset
+
this
.
limit
;
this
.
offset
=
this
.
offset
+
this
.
limit
;
let
uri
:
string
=
`../rest/search/documents?limit=
${
this
.
limit
}
&offset=
${
this
.
offset
}
`
;
let
uri
:
string
=
`../rest/search/documents?limit=
${
this
.
limit
}
&offset=
${
this
.
offset
}
`
;
uri
=
this
.
canPurge
&&
this
.
filters
.
find
((
filter
:
any
)
=>
filter
.
id
===
'
documentState
'
).
values
[
0
].
selected
?
uri
.
concat
(
'
&deleted=true
'
)
:
uri
;
uri
=
this
.
canPurge
&&
this
.
filters
.
find
((
filter
:
any
)
=>
filter
.
id
===
'
documentState
'
)
?
.
values
[
0
].
selected
?
uri
.
concat
(
'
&deleted=true
'
)
:
uri
;
this
.
http
.
post
(
uri
,
this
.
formatDatas
()).
pipe
(
this
.
http
.
post
(
uri
,
this
.
formatDatas
()).
pipe
(
tap
((
data
:
any
)
=>
{
tap
((
data
:
any
)
=>
{
this
.
ressources
=
this
.
ressources
.
concat
(
this
.
formatListDatas
(
data
.
documents
));
this
.
ressources
=
this
.
ressources
.
concat
(
this
.
formatListDatas
(
data
.
documents
));
...
@@ -501,8 +505,10 @@ export class SearchComponent implements OnInit {
...
@@ -501,8 +505,10 @@ export class SearchComponent implements OnInit {
}
else
{
}
else
{
if
(
filter
.
id
!==
'
workflowUsers
'
)
{
if
(
filter
.
id
!==
'
workflowUsers
'
)
{
this
.
filters
.
find
((
element
:
any
)
=>
element
.
id
===
filter
.
id
).
values
.
filter
((
element
:
any
)
=>
element
.
id
===
item
)[
0
].
selected
=
false
;
this
.
filters
.
find
((
element
:
any
)
=>
element
.
id
===
filter
.
id
).
values
.
filter
((
element
:
any
)
=>
element
.
id
===
item
)[
0
].
selected
=
false
;
if
(
!
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
values
[
0
].
selected
)
{
if
(
!
this
.
functionsService
.
empty
(
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
)))
{
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
val
=
[];
if
(
!
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
values
[
0
].
selected
)
{
this
.
filters
.
find
((
el
:
any
)
=>
el
.
id
===
'
documentState
'
).
val
=
[];
}
}
}
}
else
{
}
else
{
const
index
=
filter
.
val
.
indexOf
(
item
);
const
index
=
filter
.
val
.
indexOf
(
item
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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