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
33cd4050
Commit
33cd4050
authored
May 11, 2021
by
Hamza HRAMCHI
Browse files
FEAT #10110 TIME 0:30 add number of elements in page for the GC
parent
fd4081ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/frontend/app/administration/contact/group/form/contacts-group-form.component.html
View file @
33cd4050
...
...
@@ -112,7 +112,9 @@
<div>
<div
class=
"table-head table-head-tool"
>
<span
style=
"position: relative;"
>
<mat-paginator
#paginatorLinkedCorrespondents
[length]=
"nbFilteredLinkedCorrespondents"
[pageSize]=
"10"
[pageSizeOptions]=
"[10, 25, 50, 100, 150]"
></mat-paginator>
<mat-paginator
#paginatorLinkedCorrespondents
[length]=
"nbFilteredLinkedCorrespondents"
[pageSize]=
"10"
[hidePageSize]=
"nbFilteredLinkedCorrespondents === 0"
[pageSizeOptions]=
"[10, 25, 50, 100, 150]"
(page)=
"handlePageEvent($event)"
>
</mat-paginator>
<app-select-page
[paginator]=
"paginatorLinkedCorrespondents"
></app-select-page>
</span>
</div>
...
...
src/frontend/app/administration/contact/group/form/contacts-group-form.component.ts
View file @
33cd4050
...
...
@@ -6,7 +6,7 @@ import { NotificationService } from '@service/notification/notification.service'
import
{
HeaderService
}
from
'
@service/header.service
'
;
import
{
FormControl
,
NgForm
}
from
'
@angular/forms
'
;
import
{
debounceTime
,
switchMap
,
distinctUntilChanged
,
filter
,
tap
,
map
,
catchError
,
takeUntil
,
startWith
,
exhaustMap
}
from
'
rxjs/operators
'
;
import
{
MatPaginator
}
from
'
@angular/material/paginator
'
;
import
{
MatPaginator
,
PageEvent
}
from
'
@angular/material/paginator
'
;
import
{
MatSort
}
from
'
@angular/material/sort
'
;
import
{
MatTableDataSource
}
from
'
@angular/material/table
'
;
import
{
SelectionModel
}
from
'
@angular/cdk/collections
'
;
...
...
@@ -48,6 +48,7 @@ export class ContactsGroupFormComponent implements OnInit, AfterViewInit {
filterInputControl
=
new
FormControl
(
''
);
searchCorrespondentInputControl
=
new
FormControl
(
''
);
pageSize
:
number
=
10
;
creationMode
:
boolean
=
true
;
displayCorrespondents
:
boolean
=
true
;
// fix issue virtual scroll
...
...
@@ -225,7 +226,7 @@ export class ContactsGroupFormComponent implements OnInit, AfterViewInit {
switchMap
(()
=>
{
this
.
loadingLinkedCorrespondents
=
true
;
return
this
.
dataSourceLinkedCorrespondents
!
.
getRepoIssues
(
this
.
sortLinkedCorrespondents
.
active
,
this
.
sortLinkedCorrespondents
.
direction
,
this
.
paginatorLinkedCorrespondents
.
pageIndex
,
'
../rest/contactsGroups/
'
+
this
.
contactsGroup
.
id
+
'
/correspondents
'
,
this
.
filterInputControl
.
value
);
this
.
sortLinkedCorrespondents
.
active
,
this
.
sortLinkedCorrespondents
.
direction
,
this
.
paginatorLinkedCorrespondents
.
pageIndex
,
'
../rest/contactsGroups/
'
+
this
.
contactsGroup
.
id
+
'
/correspondents
'
,
this
.
filterInputControl
.
value
,
this
.
pageSize
);
}),
map
(
data
=>
{
this
.
loadingLinkedCorrespondents
=
false
;
...
...
@@ -492,6 +493,10 @@ export class ContactsGroupFormComponent implements OnInit, AfterViewInit {
})
).
subscribe
();
}
handlePageEvent
(
event
:
PageEvent
)
{
this
.
pageSize
=
event
.
pageSize
;
}
}
export
interface
CorrespondentList
{
correspondents
:
any
[];
...
...
@@ -502,10 +507,10 @@ export class CorrespondentListHttpDao {
constructor
(
private
http
:
HttpClient
)
{
}
getRepoIssues
(
sort
:
string
,
order
:
string
,
page
:
number
,
href
:
string
,
search
:
string
):
Observable
<
CorrespondentList
>
{
getRepoIssues
(
sort
:
string
,
order
:
string
,
page
:
number
,
href
:
string
,
search
:
string
,
pageSize
:
number
):
Observable
<
CorrespondentList
>
{
const
offset
=
page
*
10
;
const
requestUrl
=
`
${
href
}
?limit=
10
&offset=
${
offset
}
&order=
${
order
}
&orderBy=
${
sort
}
&search=
${
search
}
`
;
const
requestUrl
=
`
${
href
}
?limit=
${
pageSize
}
&offset=
${
offset
}
&order=
${
order
}
&orderBy=
${
sort
}
&search=
${
search
}
`
;
return
this
.
http
.
get
<
CorrespondentList
>
(
requestUrl
);
}
...
...
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