mirror of https://github.com/Squidex/squidex.git
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.
46 lines
1.0 KiB
46 lines
1.0 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
// tslint:disable: component-selector
|
|
|
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
|
|
import {
|
|
ContributorDto,
|
|
ContributorsState,
|
|
RoleDto
|
|
} from '@app/shared';
|
|
|
|
@Component({
|
|
selector: '[sqxContributor]',
|
|
styleUrls: ['./contributor.component.scss'],
|
|
templateUrl: './contributor.component.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class ContributorComponent {
|
|
@Input()
|
|
public roles: ReadonlyArray<RoleDto>;
|
|
|
|
@Input()
|
|
public search: string;
|
|
|
|
@Input('sqxContributor')
|
|
public contributor: ContributorDto;
|
|
|
|
constructor(
|
|
private readonly contributorsState: ContributorsState
|
|
) {
|
|
}
|
|
|
|
public remove() {
|
|
this.contributorsState.revoke(this.contributor);
|
|
}
|
|
|
|
public changeRole(role: string) {
|
|
this.contributorsState.assign({ contributorId: this.contributor.contributorId, role });
|
|
}
|
|
}
|