Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

53 lines
1.4 KiB

/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { Component, OnInit } from '@angular/core';
import { ContributorDto, ContributorsState, DialogModel, RolesState, Router2State } from '@app/shared';
@Component({
selector: 'sqx-contributors-page',
styleUrls: ['./contributors-page.component.scss'],
templateUrl: './contributors-page.component.html',
providers: [
Router2State
]
})
export class ContributorsPageComponent implements OnInit {
public importDialog = new DialogModel();
constructor(
public readonly contributorsRoute: Router2State,
public readonly contributorsState: ContributorsState,
public readonly rolesState: RolesState
) {
}
public ngOnInit() {
this.rolesState.load();
const initial =
this.contributorsRoute.mapTo(this.contributorsState)
.withPaging('contributors', 10)
.withString('query')
.getInitial();
this.contributorsState.load(false, initial);
this.contributorsRoute.unlisten();
}
public reload() {
this.contributorsState.load(true);
}
public search(query: string) {
this.contributorsState.search(query);
}
public trackByContributor(_index: number, contributor: ContributorDto) {
return contributor.contributorId;
}
}