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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
create a component for the button
bsatarnejadff0acd980de6
diff --git a/frontend/src/app/core/setup/global-dynamic-components.const.ts b/frontend/src/app/core/setup/global-dynamic-components.const.tsindex cb9a839d3ac..123329403d7 100644--- a/frontend/src/app/core/setup/global-dynamic-components.const.ts+++ b/frontend/src/app/core/setup/global-dynamic-components.const.ts@@ -146,6 +146,10 @@ import {EnterpriseBaseComponent,enterpriseBaseSelector,} from 'core-app/features/enterprise/enterprise-base.component';+import {+ FreeTrialButtonComponent,+ freeTrialButtonSelector,+} from 'core-app/features/enterprise/free-trial-button/free-trial-button.component';import {EEActiveSavedTrialComponent,enterpriseActiveSavedTrialSelector,@@ -219,6 +223,7 @@ export const globalDynamicComponents:OptionalBootstrapDefinition[] = [{ selector: collapsibleSectionAugmentSelector, cls: CollapsibleSectionComponent },{ selector: enterpriseBannerSelector, cls: EnterpriseBannerBootstrapComponent },{ selector: enterpriseBaseSelector, cls: EnterpriseBaseComponent },+ { selector: freeTrialButtonSelector, cls: FreeTrialButtonComponent },{ selector: enterpriseActiveSavedTrialSelector, cls: EEActiveSavedTrialComponent },{ selector: projectMenuAutocompleteSelector, cls: ProjectMenuAutocompleteComponent },{ selector: remoteFieldUpdaterSelector, cls: RemoteFieldUpdaterComponent },diff --git a/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.html b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.htmlnew file mode 100644index 00000000000..93d0288e9df--- /dev/null+++ b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.html@@ -0,0 +1,3 @@+<button class="button -alt-highlight" (click)="openTrialModal()">+ {{ text.button_trial }}+</button>diff --git a/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.sass b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.sassnew file mode 100644index 00000000000..8b05a9313e5--- /dev/null+++ b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.sass@@ -0,0 +1,2 @@+.button+ float: left\ No newline at end of filediff --git a/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.ts b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.tsnew file mode 100644index 00000000000..1407581078a--- /dev/null+++ b/frontend/src/app/features/enterprise/free-trial-button/free-trial-button.component.ts@@ -0,0 +1,60 @@+// -- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 the OpenProject GmbH+//+// 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 COPYRIGHT and LICENSE files for more details.+//++++import { Component, Injector } from '@angular/core';+import { I18nService } from 'core-app/core/i18n/i18n.service';+import { EnterpriseTrialModalComponent } from 'core-app/features/enterprise/enterprise-modal/enterprise-trial.modal';+import { OpModalService } from 'core-app/shared/components/modal/modal.service';+import { EnterpriseTrialService } from 'core-app/features/enterprise/enterprise-trial.service';++export const freeTrialButtonSelector = 'free-trial-button';++@Component({+ selector: freeTrialButtonSelector,+ templateUrl: './free-trial-button.component.html',+ styleUrls: ['./free-trial-button.component.sass'],+})+export class FreeTrialButtonComponent {+ public text = {+ button_trial: this.I18n.t('js.admin.enterprise.upsale.button_start_trial'),+ };++ constructor(protected I18n:I18nService,+ protected opModalService:OpModalService,+ readonly injector:Injector,+ public eeTrialService:EnterpriseTrialService) {+ }++ public openTrialModal() {+ // cancel request and open first modal window+ this.eeTrialService.cancelled = true;+ this.eeTrialService.modalOpen = true;+ this.opModalService.show(EnterpriseTrialModalComponent, this.injector);+ }++}diff --git a/frontend/src/app/features/enterprise/openproject-enterprise.module.ts b/frontend/src/app/features/enterprise/openproject-enterprise.module.tsindex 86641581cb3..351acb27312 100644--- a/frontend/src/app/features/enterprise/openproject-enterprise.module.ts+++ b/frontend/src/app/features/enterprise/openproject-enterprise.module.ts@@ -37,6 +37,7 @@ import { EETrialWaitingComponent } from 'core-app/features/enterprise/enterpriseimport { EEActiveTrialComponent } from 'core-app/features/enterprise/enterprise-active-trial/ee-active-trial.component';import { EEActiveSavedTrialComponent } from 'core-app/features/enterprise/enterprise-active-trial/ee-active-saved-trial.component';import { FormsModule, ReactiveFormsModule } from '@angular/forms';+import { FreeTrialButtonComponent } from 'core-app/features/enterprise/free-trial-button/free-trial-button.component';@NgModule({imports: [@@ -48,6 +49,9 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';providers: [EnterpriseTrialService,],+ exports:[+ FreeTrialButtonComponent,+ ],declarations: [EnterpriseBaseComponent,EnterpriseTrialModalComponent,@@ -55,6 +59,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';EETrialWaitingComponent,EEActiveTrialComponent,EEActiveSavedTrialComponent,+ FreeTrialButtonComponent,],})export class OpenprojectEnterpriseModule {