Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
ced2ebb7
Commit
ced2ebb7
authored
4 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #14810 TIME 0:30 fix select search in opt
parent
1e06d556
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/frontend/plugins/select-search/select-search.component.ts
+19
-25
19 additions, 25 deletions
...frontend/plugins/select-search/select-search.component.ts
with
19 additions
and
25 deletions
src/frontend/plugins/select-search/select-search.component.ts
+
19
−
25
View file @
ced2ebb7
...
@@ -177,7 +177,7 @@ export class PluginSelectSearchComponent implements OnInit, OnDestroy, AfterView
...
@@ -177,7 +177,7 @@ export class PluginSelectSearchComponent implements OnInit, OnDestroy, AfterView
let
group
=
''
;
let
group
=
''
;
let
index
=
1
;
let
index
=
1
;
this
.
datasClone
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
datas
));
this
.
datasClone
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
datas
));
this
.
datasClone
.
forEach
((
element
:
any
)
=>
{
this
.
datasClone
.
forEach
((
element
:
any
,
index
:
number
)
=>
{
if
(
element
.
isTitle
)
{
if
(
element
.
isTitle
)
{
group
=
`group_
${
index
}
`
;
group
=
`group_
${
index
}
`
;
element
.
id
=
group
;
element
.
id
=
group
;
...
@@ -198,30 +198,24 @@ export class PluginSelectSearchComponent implements OnInit, OnDestroy, AfterView
...
@@ -198,30 +198,24 @@ export class PluginSelectSearchComponent implements OnInit, OnDestroy, AfterView
// To resfresh filteredDatas if data is modfied
// To resfresh filteredDatas if data is modfied
ngDoCheck
():
void
{
ngDoCheck
():
void
{
if
(
JSON
.
stringify
(
this
.
datas
)
!==
JSON
.
stringify
(
this
.
datasClone
)
&&
!
this
.
isModelModified
)
{
if
(
this
.
datasClone
.
length
!==
this
.
datas
.
length
||
this
.
datasClone
.
length
===
0
&&
this
.
isModelModified
)
{
this
.
isModelModified
=
true
;
this
.
datasClone
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
datas
));
this
.
datasClone
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
datas
));
let
group
=
''
;
// if more data => contruct title again
let
index
=
1
;
if
(
this
.
datasClone
.
length
!==
this
.
datas
.
length
)
{
this
.
datasClone
.
forEach
((
element
:
any
)
=>
{
let
group
=
''
;
if
(
element
.
isTitle
)
{
let
index
=
1
;
group
=
`group_
${
index
}
`
;
this
.
datasClone
.
forEach
((
element
:
any
)
=>
{
element
.
id
=
group
;
if
(
element
.
isTitle
)
{
index
++
;
group
=
`group_
${
index
}
`
;
}
else
{
element
.
id
=
group
;
element
.
group
=
group
;
index
++
;
}
}
else
{
});
element
.
group
=
group
;
}
});
}
this
.
filteredDatas
=
this
.
formControlSearch
.
valueChanges
this
.
filteredDatas
=
this
.
formControlSearch
.
valueChanges
.
pipe
(
.
pipe
(
startWith
(
''
),
startWith
(
''
),
map
(
value
=>
this
.
_filter
(
value
))
map
(
value
=>
this
.
_filter
(
value
))
);
);
this
.
isModelModified
=
false
;
this
.
isModelModified
=
false
;
}
}
}
}
...
@@ -400,9 +394,9 @@ export class PluginSelectSearchComponent implements OnInit, OnDestroy, AfterView
...
@@ -400,9 +394,9 @@ export class PluginSelectSearchComponent implements OnInit, OnDestroy, AfterView
}
else
if
(
typeof
value
===
'
string
'
&&
value
!==
''
)
{
}
else
if
(
typeof
value
===
'
string
'
&&
value
!==
''
)
{
const
filterValue
=
this
.
latinisePipe
.
transform
(
value
.
toLowerCase
());
const
filterValue
=
this
.
latinisePipe
.
transform
(
value
.
toLowerCase
());
const
group
=
this
.
datas
.
filter
((
option
:
any
)
=>
option
[
'
isTitle
'
]
&&
this
.
latinisePipe
.
transform
(
option
[
'
label
'
].
toLowerCase
()).
includes
(
filterValue
)).
map
((
opt
:
any
)
=>
opt
.
id
);
const
group
=
this
.
datas
Clone
.
filter
((
option
:
any
)
=>
option
[
'
isTitle
'
]
&&
this
.
latinisePipe
.
transform
(
option
[
'
label
'
].
toLowerCase
()).
includes
(
filterValue
)).
map
((
opt
:
any
)
=>
opt
.
id
);
return
this
.
datas
.
filter
((
option
:
any
)
=>
(
option
[
'
isTitle
'
]
&&
group
.
indexOf
(
option
[
'
id
'
])
>
-
1
)
||
(
group
.
indexOf
(
option
[
'
group
'
])
>
-
1
||
this
.
latinisePipe
.
transform
(
option
[
'
label
'
].
toLowerCase
()).
includes
(
filterValue
)));
return
this
.
datas
Clone
.
filter
((
option
:
any
)
=>
(
option
[
'
isTitle
'
]
&&
group
.
indexOf
(
option
[
'
id
'
])
>
-
1
)
||
(
group
.
indexOf
(
option
[
'
group
'
])
>
-
1
||
this
.
latinisePipe
.
transform
(
option
[
'
label
'
].
toLowerCase
()).
includes
(
filterValue
)));
}
else
{
}
else
{
return
this
.
datas
;
return
this
.
datas
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Alex ORLUC
@Alex
mentioned in commit
3d52c10d
·
4 years ago
mentioned in commit
3d52c10d
mentioned in commit 3d52c10d704d161058e353b6a4265464cbabf4c5
Toggle commit list
Alex ORLUC
@Alex
mentioned in commit
f53211e1
·
4 years ago
mentioned in commit
f53211e1
mentioned in commit f53211e1fd371400b50095820ab247ad6a54a1e2
Toggle commit list
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