Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Merge remote-tracking branch 'origin/release/11.3' into dev

Oliver Günther935ae8ec8c34
diff --cc frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.ts
index f56e721d557,71afe8ccfd3..9b9f373a309
--- a/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.ts
+++ b/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.ts
@@@ -1,20 -1,24 +1,22 @@@
- import { ChangeDetectorRef, Component } from '@angular/core';
-import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
++import { ChangeDetectorRef, Component, Input } from '@angular/core';
import { NgSelectComponent } from "@ng-select/ng-select";
import { I18nService } from "core-app/modules/common/i18n/i18n.service";
-import { PermissionsService } from "core-app/core/services/permissions/permissions.service";
+import { CurrentUserService } from "core-app/modules/current-user/current-user.service";
- import { CurrentProjectService } from "core-app/components/projects/current-project.service";
import { OpInviteUserModalService } from "core-app/modules/invite-user-modal/invite-user-modal.service";
+ import { Observable } from "rxjs";
+ import { CurrentProjectService } from "core-components/projects/current-project.service";
-import { CurrentUserService } from "core-app/modules/current-user/current-user.service";
@Component({
selector: 'op-invite-user-button',
templateUrl: './invite-user-button.component.html',
styleUrls: ['./invite-user-button.component.sass']
})
-export class InviteUserButtonComponent implements OnInit {
+export class InviteUserButtonComponent {
+ @Input() projectId:string|null;
-
/** This component does not provide an output, because both primary usecases were in places where the button was
* destroyed before the modal closed, causing the data from the modal to never arrive at the parent.
* If you want to do something with the output from the modal that is opened, use the OpInviteUserModalService
-- * and subscribe to the `close` event there.
++ * and subscribe to the `close` event there.
*/
text = {
button: this.I18n.t('js.invite_user_modal.invite'),
@@@ -28,15 -29,23 +27,24 @@@
constructor(
readonly I18n:I18nService,
readonly opInviteUserModalService:OpInviteUserModalService,
- readonly currentUserService:CurrentUserService,
readonly currentProjectService:CurrentProjectService,
+ readonly currentUserService:CurrentUserService,
readonly ngSelectComponent:NgSelectComponent,
readonly changeDetectorRef:ChangeDetectorRef,
-- ) {}
++ ) {
++ }
+
+ public ngOnInit():void {
+ this.projectId = this.projectId || this.currentProjectService.id;
+ this.canInviteUsersToProject$ = this.currentUserService.hasCapabilities$(
+ 'memberships/create',
+ this.projectId || undefined
+ );
+ }
- onAddNewClick($event:Event) {
+ public onAddNewClick($event:Event):void {
$event.stopPropagation();
- this.opInviteUserModalService.open();
+ this.opInviteUserModalService.open(this.projectId);
this.ngSelectComponent.close();
}
}