Add a component for the enterprise edition banner

pull/7143/head
Henriette Dinger 6 years ago
parent 24e10a00a4
commit 4790631da4
  1. 38
      frontend/src/app/components/enterprise-banner/enterprise-banner.component.ts
  2. 17
      frontend/src/app/components/filters/query-filters/query-filters.component.html
  3. 13
      frontend/src/app/components/wp-table/configuration-modal/tabs/columns-tab.component.html
  4. 17
      frontend/src/app/components/wp-table/configuration-modal/tabs/highlighting-tab.component.html
  5. 1
      frontend/src/app/components/wp-table/configuration-modal/tabs/highlighting-tab.component.ts
  6. 1
      frontend/src/app/globals/constants.const.ts
  7. 7
      frontend/src/app/modules/common/openproject-common.module.ts

@ -0,0 +1,38 @@
import {Component, Input} from "@angular/core";
import {enterpriseEditionUrl} from "core-app/globals/constants.const";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
@Component({
selector: 'enterprise-banner',
template: `
<div class="notification-box">
<div class="notification-box--content">
<p class="-bold" [textContent]="text.enterpriseFeature"></p>
<p [textContent]="textMessage"></p>
<a [href]="eeLink()"
target='blank'
[textContent]="linkMessage"></a>
</div>
</div>
`
})
export class EnterpriseBannerComponent {
@Input() public textMessage:string;
@Input() public linkMessage:string;
@Input() public opReferrer:string;
public text:any = {
enterpriseFeature: this.I18n.t('js.upsale.ee_only'),
}
constructor(protected I18n:I18nService) {
}
public eeLink() {
if (this.opReferrer) {
return enterpriseEditionUrl + '&op_referrer=' + this.opReferrer;
} else {
return enterpriseEditionUrl;
}
}
}

@ -63,17 +63,12 @@
</select> </select>
</div> </div>
<div class="advanced-filters--add-filter-info" <enterprise-banner class="advanced-filters--add-filter-info"
*ngIf="eeShowBanners"> *ngIf="eeShowBanners"
<div class="notification-box"> [linkMessage]="text.upsale_link"
<div class="notification-box--content"> [textMessage]="text.upsale_for_more"
{{ text.upsale_for_more }} opReferrer="wp-filter#filters">
<a href="https://www.openproject.org/enterprise-edition/?op_edtion=community-edition&op_referrer=wp-filter#filters" </enterprise-banner>
target='blank'
[textContent]="text.upsale_link"></a>
</div>
</div>
</div>
</li> </li>
</ul> </ul>
</fieldset> </fieldset>

@ -12,9 +12,10 @@
</div> </div>
</ng-container> </ng-container>
</div> </div>
<div *ngIf="eeShowBanners" class="ee-relation-columns-upsale">
{{text.upsaleRelationColumns}} <enterprise-banner class="ee-relation-columns-upsale"
<a href="https://www.openproject.org/enterprise-edition/?op_edtion=community-edition&op_referrer=wp-list-columns#relations" *ngIf="eeShowBanners"
target='blank' [linkMessage]="text.upsaleCheckOutLink"
[textContent]="text.upsaleCheckOutLink"></a> [textMessage]="text.upsaleRelationColumns"
</div> opReferrer="wp-list-columns#relations">
</enterprise-banner>

@ -1,15 +1,10 @@
<div> <div>
<div *ngIf="eeShowBanners" class="ee-attribute-highlighting-upsale notification-box -ee-upsale"> <enterprise-banner class="ee-attribute-highlighting-upsale -ee-upsale"
<div class="notification-box--content"> *ngIf="eeShowBanners"
<p><strong [textContent]="text.upsaleEnterpriseOnly"></strong></p> [linkMessage]="text.upsaleCheckOutLink"
<p [textContent]="text.upsaleAttributeHighlighting"></p> [textMessage]="text.upsaleAttributeHighlighting"
<p> opReferrer="wp-attribute-highlighting#attribute-highlighting">
<a href="https://www.openproject.org/enterprise-edition/?op_edtion=community-edition&op_referrer=wp-attribute-highlighting#attribute-highlighting" </enterprise-banner>
target='blank'
[textContent]="text.upsaleCheckOutLink"></a>
</p>
</div>
</div>
<form> <form>
<p [textContent]="text.highlighting_mode.description"></p> <p [textContent]="text.highlighting_mode.description"></p>
<div class="form--field -full-width"> <div class="form--field -full-width">

@ -37,7 +37,6 @@ export class WpTableConfigurationHighlightingTab implements TabComponent {
priority: this.I18n.t('js.work_packages.table_configuration.highlighting_mode.priority'), priority: this.I18n.t('js.work_packages.table_configuration.highlighting_mode.priority'),
entire_row_by: this.I18n.t('js.work_packages.table_configuration.highlighting_mode.entire_row_by'), entire_row_by: this.I18n.t('js.work_packages.table_configuration.highlighting_mode.entire_row_by'),
}, },
upsaleEnterpriseOnly: this.I18n.t('js.upsale.ee_only'),
upsaleAttributeHighlighting: this.I18n.t('js.work_packages.table_configuration.upsale.attribute_highlighting'), upsaleAttributeHighlighting: this.I18n.t('js.work_packages.table_configuration.upsale.attribute_highlighting'),
upsaleCheckOutLink: this.I18n.t('js.work_packages.table_configuration.upsale.check_out_link') upsaleCheckOutLink: this.I18n.t('js.work_packages.table_configuration.upsale.check_out_link')
}; };

@ -0,0 +1 @@
export const enterpriseEditionUrl = "https://www.openproject.org/enterprise-edition/?op_edtion=community-edition";

@ -80,6 +80,7 @@ import {EditableToolbarTitleComponent} from "core-app/modules/common/editable-to
import {UserAvatarComponent} from "core-components/user/user-avatar/user-avatar.component"; import {UserAvatarComponent} from "core-components/user/user-avatar/user-avatar.component";
import {GonService} from "core-app/modules/common/gon/gon.service"; import {GonService} from "core-app/modules/common/gon/gon.service";
import {BackRoutingService} from "core-app/modules/common/back-routing/back-routing.service"; import {BackRoutingService} from "core-app/modules/common/back-routing/back-routing.service";
import {EnterpriseBannerComponent} from "core-components/enterprise-banner/enterprise-banner.component";
export function bootstrapModule(injector:Injector) { export function bootstrapModule(injector:Injector) {
return () => { return () => {
@ -165,6 +166,9 @@ export function bootstrapModule(injector:Injector) {
// User Avatar // User Avatar
UserAvatarComponent, UserAvatarComponent,
// Enterprise Edition
EnterpriseBannerComponent,
], ],
declarations: [ declarations: [
OpDatePickerComponent, OpDatePickerComponent,
@ -218,6 +222,9 @@ export function bootstrapModule(injector:Injector) {
// User Avatar // User Avatar
UserAvatarComponent, UserAvatarComponent,
// Enterprise Edition
EnterpriseBannerComponent,
], ],
entryComponents: [ entryComponents: [
OpDateTimeComponent, OpDateTimeComponent,

Loading…
Cancel
Save