parent
5fb09b2bd5
commit
a31115a74b
@ -1,30 +1,41 @@ |
||||
<tr *ngIf="!isHidden && isAllowed" |
||||
class="wp-inline-create-button-row hide-when-print"> |
||||
<td [attr.colspan]="colspan" |
||||
class="wp-inline-create-button-td -no-highlighting"> |
||||
<div class="wp-inline-create-button"> |
||||
<a class="wp-inline-create--add-link" |
||||
href |
||||
role="link" |
||||
[focus]="focus" |
||||
[ngClass]="{'wp-inline-create--split-link': isReferencable }" |
||||
(accessibleClick)="handleAddRowClick()" |
||||
[attr.disabled]="!isAllowed || undefined" |
||||
[attr.aria-label]="text.create" |
||||
aria-haspopup="true"> |
||||
<op-icon icon-classes="icon icon-add"></op-icon> |
||||
</a> |
||||
<ng-container *ngIf="isReferencable"> |
||||
<a class="wp-inline-create--reference-link wp-inline-create--split-link" |
||||
href |
||||
role="link" |
||||
(accessibleClick)="handleReferenceClick()" |
||||
[attr.disabled]="!isAllowed || undefined" |
||||
[attr.aria-label]="text.create" |
||||
aria-haspopup="true"> |
||||
<ng-container *ngIf="isAllowed"> |
||||
<tr *ngIf="mode === 'inactive'" |
||||
class="wp-inline-create-button-row hide-when-print"> |
||||
<td [attr.colspan]="colspan" |
||||
class="wp-inline-create-button-td -no-highlighting"> |
||||
<div class="wp-inline-create-button"> |
||||
<a class="wp-inline-create--add-link" |
||||
href |
||||
role="link" |
||||
[focus]="focus" |
||||
[ngClass]="{'wp-inline-create--split-link': hasReferenceClass }" |
||||
(accessibleClick)="handleAddRowClick()" |
||||
[attr.disabled]="!isAllowed || undefined" |
||||
[attr.aria-label]="text.create" |
||||
aria-haspopup="true"> |
||||
<op-icon icon-classes="icon icon-add"></op-icon> |
||||
<span [textContent]="text.create"></span> |
||||
</a> |
||||
</ng-container> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
<ng-container *ngIf="hasReferenceClass"> |
||||
<a class="wp-inline-create--reference-link wp-inline-create--split-link" |
||||
href |
||||
role="link" |
||||
(accessibleClick)="handleReferenceClick()" |
||||
[attr.disabled]="!isAllowed || undefined" |
||||
[attr.aria-label]="text.create" |
||||
aria-haspopup="true"> |
||||
<op-icon icon-classes="icon icon-add"></op-icon> |
||||
<span [textContent]="text.reference"></span> |
||||
</a> |
||||
</ng-container> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
<tr *ngIf="hasReferenceClass && mode === 'reference'" |
||||
class="wp-inline-create-button-row hide-when-print"> |
||||
<td [attr.colspan]="colspan" |
||||
class="wp-inline-reference-row-td -no-highlighting"> |
||||
<ng-container *ngComponentOutlet="referenceClass; injector: injector"></ng-container> |
||||
</td> |
||||
</tr> |
||||
</ng-container> |
||||
|
@ -0,0 +1,80 @@ |
||||
// -- copyright
|
||||
// OpenProject is a project management system.
|
||||
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License version 3.
|
||||
//
|
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
// Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// See doc/COPYRIGHT.rdoc for more details.
|
||||
// ++
|
||||
|
||||
import { |
||||
Component, |
||||
ElementRef, HostListener, |
||||
Inject, |
||||
Injector, |
||||
Input, |
||||
OnChanges, |
||||
OnDestroy, |
||||
OnInit |
||||
} from '@angular/core'; |
||||
import {AuthorisationService} from 'core-app/modules/common/model-auth/model-auth.service'; |
||||
import {WorkPackageTableFocusService} from 'core-components/wp-fast-table/state/wp-table-focus.service'; |
||||
import {filter, takeUntil} from 'rxjs/operators'; |
||||
import {WorkPackageResource} from 'core-app/modules/hal/resources/work-package-resource'; |
||||
import {WorkPackageCacheService} from '../work-packages/work-package-cache.service'; |
||||
import {TableRowEditContext} from '../wp-edit-form/table-row-edit-context'; |
||||
import {WorkPackageChangeset} from '../wp-edit-form/work-package-changeset'; |
||||
import {WorkPackageEditForm} from '../wp-edit-form/work-package-edit-form'; |
||||
import {WorkPackageEditingService} from '../wp-edit-form/work-package-editing-service'; |
||||
import {WorkPackageFilterValues} from '../wp-edit-form/work-package-filter-values'; |
||||
import {TimelineRowBuilder} from '../wp-fast-table/builders/timeline/timeline-row-builder'; |
||||
import {onClickOrEnter} from '../wp-fast-table/handlers/click-or-enter-handler'; |
||||
import {WorkPackageTableColumnsService} from '../wp-fast-table/state/wp-table-columns.service'; |
||||
import {WorkPackageTableFiltersService} from '../wp-fast-table/state/wp-table-filters.service'; |
||||
import {WorkPackageTable} from '../wp-fast-table/wp-fast-table'; |
||||
import {WorkPackageCreateService} from '../wp-new/wp-create.service'; |
||||
import { |
||||
inlineCreateCancelClassName, |
||||
InlineCreateRowBuilder, |
||||
inlineCreateRowClassName |
||||
} from './inline-create-row-builder'; |
||||
import {TableState} from 'core-components/wp-table/table-state/table-state'; |
||||
import {componentDestroyed, untilComponentDestroyed} from 'ng2-rx-componentdestroyed'; |
||||
import {I18nService} from 'core-app/modules/common/i18n/i18n.service'; |
||||
import {FocusHelperService} from 'core-app/modules/common/focus/focus-helper'; |
||||
import {IWorkPackageEditingServiceToken} from "../wp-edit-form/work-package-editing.service.interface"; |
||||
import {IWorkPackageCreateServiceToken} from "core-components/wp-new/wp-create.service.interface"; |
||||
import {CurrentUserService} from "core-components/user/current-user.service"; |
||||
import {WorkPackageInlineCreateService} from "core-components/wp-inline-create/wp-inline-create.service"; |
||||
import {WorkPackageInlineCreateComponent} from "core-components/wp-inline-create/wp-inline-create.component"; |
||||
|
||||
@Component({ |
||||
template: '<a (click)="cancel()">HELLO THERE</a>' |
||||
}) |
||||
export class WorkPackageInlineReferenceComponent { |
||||
constructor(public parent:WorkPackageInlineCreateComponent) { |
||||
} |
||||
|
||||
public cancel() { |
||||
this.parent.resetRow(); |
||||
} |
||||
} |
Loading…
Reference in new issue