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

Build frontend for new admin enterprise page

Inga Maiad1b226932eb
diff --git a/app/views/enterprises/_info.html.erb b/app/views/enterprises/_info.html.erb
index 55336195185..36c98b6d027 100644
--- a/app/views/enterprises/_info.html.erb
+++ b/app/views/enterprises/_info.html.erb
@@ -1,28 +1,43 @@
-<div class="notification-box upsale-notification">
- <div class="notification-box--content">
- <h3><%= t('admin.enterprise.upgrade_to_ee') %></h3>
- <%= image_tag "enterprise_edition.png", class: "widget-box--teaser-image" %>
-
- <p><%= t('homescreen.blocks.upsale.description') %></p>
-
- <ul class="">
- <li>
- <%= t('homescreen.blocks.upsale.additional_features') %>
- </li>
- <li>
- <%= t('homescreen.blocks.upsale.professional_support') %>
- </li>
- </ul>
- <p>
- <b><%= t('homescreen.blocks.upsale.become_hero') %></b> <%= t('homescreen.blocks.upsale.you_contribute') %>
- </p>
- <%= link_to( "#{OpenProject::Static::Links.links[:upsale][:href]}/?utm_source=unknown&utm_medium=community-edition&utm_campaign=enterprise-admin",
- { class: 'button -alt-highlight',
- target: '_blank',
- aria: {label: t('admin.enterprise.order')},
- title: t('admin.enterprise.order')}) do %>
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= t('admin.enterprise.order') %></span>
- <% end %>
- </div>
-</div>
+<%#-- copyright
+OpenProject is an open source project management software.
+Copyright (C) 2012-2020 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-2017 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 docs/COPYRIGHT.rdoc for more details.
+
+++#%>
+
+<p>
+ <b><%= t('homescreen.blocks.upsale.become_hero') %></b> <%= t('homescreen.blocks.upsale.you_contribute') %>
+</p>
+
+<enterprise></enterprise>
+
+<ul class="">
+ <li>
+ <%= t('homescreen.blocks.upsale.additional_features') %>
+ </li>
+ <li>
+ <%= t('homescreen.blocks.upsale.professional_support') %>
+ </li>
+</ul>
diff --git a/app/views/enterprises/show.html.erb b/app/views/enterprises/show.html.erb
index 6e90fc535fc..60cab9ab87b 100644
--- a/app/views/enterprises/show.html.erb
+++ b/app/views/enterprises/show.html.erb
@@ -1,18 +1,6 @@
<% html_title t(:label_administration), t(:label_enterprise_edition) %>
-<%= toolbar title: t(:label_enterprise_edition) do %>
- <% if EnterpriseToken.show_banners? %>
- <li class="toolbar-item">
- <%= link_to( "#{OpenProject::Static::Links.links[:upsale][:href]}/?utm_source=unknown&utm_medium=community-edition&utm_campaign=enterprise-admin",
- { class: 'button -alt-highlight',
- target: '_blank',
- title: t('admin.enterprise.order')}) do %>
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= t('admin.enterprise.order') %></span>
- <% end %>
- </li>
- <% end %>
-<% end %>
+<%= toolbar title: t(:label_enterprise_edition) %>
<%= error_messages_for 'token' %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 472acda9e02..f5dbca0048b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -79,6 +79,9 @@ en:
paste: "Paste your Enterprise Edition support token"
required_for_feature: "This feature is only available with an active Enterprise Edition support token."
enterprise_link: "For more information, click here."
+ start_trial: 'Start free trial'
+ book_now: 'Book now'
+ get_quote: 'Get a quote'
announcements:
show_until: Show until
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 8b4904e33fe..1a288e8b9ac 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -181,6 +181,15 @@ en:
edit_query: 'Edit query'
new_group: 'New group'
reset_to_defaults: 'Reset to defaults'
+ enterprise:
+ start_trial: 'Start free trial'
+ test_ee: 'Test the Enterprise Edition 30 days for free'
+ label_company: 'Company'
+ label_first_name: 'First name'
+ label_last_name: 'Last name'
+ label_email: 'Email'
+ label_domain: 'Domain'
+ next_step: 'In the next step we will send you an email to the email-address provided.'
custom_actions:
date:
diff --git a/frontend/src/app/angular4-modules.ts b/frontend/src/app/angular4-modules.ts
index aaf98a17a84..032c8c097de 100644
--- a/frontend/src/app/angular4-modules.ts
+++ b/frontend/src/app/angular4-modules.ts
@@ -39,6 +39,8 @@ import {ConfirmDialogModal} from "core-components/modals/confirm-dialog/confirm-
import {ConfirmDialogService} from "core-components/modals/confirm-dialog/confirm-dialog.service";
import {DynamicContentModal} from "core-components/modals/modal-wrapper/dynamic-content.modal";
import {PasswordConfirmationModal} from "core-components/modals/request-for-confirmation/password-confirmation.modal";
+import {EnterpriseComponent} from "core-components/enterprise/enterprise.component";
+import {EnterpriseTrialModal} from "core-components/enterprise/enterprise-modal/enterprise-trial.modal";
import {OpenprojectFieldsModule} from "core-app/modules/fields/openproject-fields.module";
import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";
import {CommentService} from "core-components/wp-activity/comment-service";
@@ -145,6 +147,7 @@ import {OpenprojectMembersModule} from "core-app/modules/members/members.module"
DynamicContentModal,
PasswordConfirmationModal,
WpPreviewModal,
+ EnterpriseTrialModal,
// Main menu
MainMenuResizerComponent,
diff --git a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.html b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.html
new file mode 100644
index 00000000000..b811bcf40ee
--- /dev/null
+++ b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.html
@@ -0,0 +1,109 @@
+<div class="op-modal--portal">
+ <div class="op-modal--modal-container"
+ data-indicator-name="modal"
+ tabindex="0">
+ <div class="op-modal--modal-header">
+ <h3> {{ text.label_test_ee }}</h3>
+ <a class="op-modal--modal-close-button" *ngIf="showClose">
+ <i
+ class="icon-close"
+ (click)="closeMe($event)"
+ [attr.title]="text.close_popup">
+ </i>
+ </a>
+ </div>
+
+ <div class="ngdialog-body op-modal--modal-body">
+ <form class="form">
+ <div class="form--field">
+ <label class="form--label">{{ text.label_company }}</label>
+ <div class="form--field-container">
+ <div class="form--text-field-container">
+ <input type="text" class="form--text-field">
+ </div>
+ </div>
+ </div>
+ <div class="form--field -required">
+ <label class="form--label">{{ text.label_first_name }}</label>
+ <div class="form--field-container">
+ <div class="form--text-field-container">
+ <input type="text" class="form--text-field">
+ </div>
+ </div>
+ </div>
+ <div class="form--field -required">
+ <label class="form--label">{{ text.label_last_name }}</label>
+ <div class="form--field-container">
+ <div class="form--text-field-container">
+ <input type="text" class="form--text-field">
+ </div>
+ </div>
+ </div>
+ <div class="form--field -required">
+ <label class="form--label">{{ text.label_email }}</label>
+ <div class="form--field-container">
+ <div class="form--text-field-container">
+ <input type="text" class="form--text-field">
+ </div>
+ </div>
+ </div>
+ <div class="form--field -required">
+ <label class="form--label">{{ text.label_domain }}</label>
+ <div class="form--field-container">
+ <div class="form--text-field-container">
+ <input type="text" class="form--text-field">
+ </div>
+ </div>
+ </div>
+
+
+ <div class="form--field -required -trailing-label">
+ <label class="form--label -visible-overflow" for="check-terms-of-service">
+ <span>I agree with the
+ <a href="https://www.openproject.com/terms-of-service/" target="_blank">
+ terms of service</a> and the
+ <a href="https://www.openproject.com/legal-notice/" target="_blank">privacy policy</a>.
+ </span>
+ <span class="tooltip--right" data-tooltip="You already confirmed the terms of service when you created your OpenProject trial.">
+ <i class="icon icon-info1"></i>
+ </span>
+ </label>
+ <div class="form--field-container">
+ <div class="form--check-box-container">
+ <input class="form--check-box" id="check-terms-of-service" required="" type="checkbox">
+ </div>
+ </div>
+ </div>
+ <div class="form--field -trailing-label">
+ <label class="form--label"
+ for="receive_newsletter">
+ <span>I want to receive the OpenProject
+ <a href="https://www.openproject.com/newsletter/" target="_blank">
+ newsletter</a>.
+ </span>
+ </label>
+ <div class="form--field-container">
+ <div class="form--check-box-container">
+ <input type="checkbox"
+ id="receive_newsletter"
+ name="receive_newsletter">
+ </div>
+ </div>
+ </div>
+ </form>
+ <p>text.next_step</p>
+ </div>
+ <div class="op-modal--modal-footer">
+ <button class="confirm-form-submit--continue button -highlight"
+ (click)="submit($event)"
+ [textContent]="text.button_submit"
+ [attr.title]="text.button_submit">
+ </button>
+ <button class="confirm-form-submit--cancel button"
+ (click)="closeMe($event)"
+ [textContent]="text.button_cancel"
+ [attr.title]="text.button_cancel">
+ </button>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.ts b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.ts
new file mode 100644
index 00000000000..0960c88ab04
--- /dev/null
+++ b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.ts
@@ -0,0 +1,101 @@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2020 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 docs/COPYRIGHT.rdoc for more details.
+// ++
+
+import {OpModalComponent} from "app/components/op-modals/op-modal.component";
+import {OpModalLocalsToken} from "app/components/op-modals/op-modal.service";
+import {ChangeDetectorRef, Component, ElementRef, Inject} from "@angular/core";
+import {OpModalLocalsMap} from "app/components/op-modals/op-modal.types";
+import {I18nService} from "app/modules/common/i18n/i18n.service";
+
+export interface EnterpriseTrialOptions {
+ text:{
+ title:string;
+ text:string;
+ button_continue?:string;
+ button_cancel?:string;
+ };
+ closeByEscape?:boolean;
+ showClose?:boolean;
+ closeByDocument?:boolean;
+}
+
+@Component({
+ templateUrl: './enterprise-trial.modal.html'
+})
+export class EnterpriseTrialModal extends OpModalComponent {
+
+ public showClose:boolean;
+
+ public confirmed = false;
+
+ private options:EnterpriseTrialOptions;
+
+ public text:any = {
+ title: this.I18n.t('js.modals.form_submit.title'),
+ text: this.I18n.t('js.modals.form_submit.text'),
+ button_submit: this.I18n.t('js.modals.button_submit'),
+ button_cancel: this.I18n.t('js.modals.button_cancel'),
+ close_popup: this.I18n.t('js.close_popup_title'),
+ label_test_ee: this.I18n.t('js.admin.enterprise.test_ee'),
+ label_company: this.I18n.t('js.admin.enterprise.label_company'),
+ label_first_name: this.I18n.t('js.admin.enterprise.label_first_name'),
+ label_last_name: this.I18n.t('js.admin.enterprise.label_last_name'),
+ label_email: this.I18n.t('js.admin.enterprise.label_email'),
+ label_domain: this.I18n.t('js.admin.enterprise.label_domain'),
+ next_step: this.I18n.t('js.admin.enterprise.next_step')
+ };
+
+ constructor(readonly elementRef:ElementRef,
+ @Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
+ readonly cdRef:ChangeDetectorRef,
+ readonly I18n:I18nService) {
+
+ super(locals, cdRef, elementRef);
+
+ this.options = locals.options || {};
+ this.closeOnEscape = _.defaultTo(this.options.closeByEscape, true);
+ this.closeOnOutsideClick = _.defaultTo(this.options.closeByDocument, true);
+ this.showClose = _.defaultTo(this.options.showClose, true);
+
+ // override default texts if any
+ this.text = _.defaults(this.options.text, this.text);
+ }
+
+ public submit(evt:JQuery.TriggeredEvent) {
+ // open next window
+ // this.confirmMailAddress();
+ // waiting -> show status and btn "Check status"
+ // confirmed -> show confirmed, enable btn "Continue"
+ // onclick of continue: this.closeMe(evt);
+ }
+
+ public confirmMailAddress() {
+ this.confirmed = true;
+ }
+}
+
diff --git a/frontend/src/app/components/enterprise/enterprise.component.html b/frontend/src/app/components/enterprise/enterprise.component.html
new file mode 100644
index 00000000000..032a2a9e3d0
--- /dev/null
+++ b/frontend/src/app/components/enterprise/enterprise.component.html
@@ -0,0 +1,5 @@
+<div class='upsale--actions'>
+ <button class="button -alt-highlight" (click)="openTrialModal()">Start free trial</button>
+ <button class="button -highlight">Book now</button>
+ <button class="button">Get a quote</button>
+</div>
\ No newline at end of file
diff --git a/frontend/src/app/components/enterprise/enterprise.component.ts b/frontend/src/app/components/enterprise/enterprise.component.ts
new file mode 100644
index 00000000000..c98c966fe84
--- /dev/null
+++ b/frontend/src/app/components/enterprise/enterprise.component.ts
@@ -0,0 +1,72 @@
+// -- 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, Input} from "@angular/core";
+import {enterpriseEditionUrl} from "core-app/globals/constants.const";
+import {I18nService} from "core-app/modules/common/i18n/i18n.service";
+import {DynamicBootstrapper} from "core-app/globals/dynamic-bootstrapper";
+import {EnterpriseTrialModal} from "core-components/enterprise/enterprise-modal/enterprise-trial.modal";
+import {OpModalService} from "core-components/op-modals/op-modal.service";
+import {Injector} from "@angular/core";
+
+
+@Component({
+ selector: 'enterprise',
+ templateUrl: '/app/components/enterprise/enterprise.component.html'
+})
+export class EnterpriseComponent {
+ @Input() public leftMargin:boolean = false;
+ @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,
+ protected opModalService:OpModalService,
+ readonly injector:Injector) {
+ }
+
+ public openTrialModal() {
+ this.opModalService.show(EnterpriseTrialModal, this.injector);
+ }
+
+ public eeLink() {
+ if (this.opReferrer) {
+ return enterpriseEditionUrl + '&op_referrer=' + this.opReferrer;
+ } else {
+ return enterpriseEditionUrl;
+ }
+ }
+}
+
+DynamicBootstrapper.register({
+ selector: 'enterprise', cls: EnterpriseComponent
+});
diff --git a/frontend/src/app/modules/common/openproject-common.module.ts b/frontend/src/app/modules/common/openproject-common.module.ts
index 6626c1a60a1..801c527a016 100644
--- a/frontend/src/app/modules/common/openproject-common.module.ts
+++ b/frontend/src/app/modules/common/openproject-common.module.ts
@@ -63,6 +63,7 @@ import {ContentTabsComponent} from "core-app/modules/common/tabs/content-tabs/co
import {EditableToolbarTitleComponent} from "core-app/modules/common/editable-toolbar-title/editable-toolbar-title.component";
import {UserAvatarComponent} from "core-components/user/user-avatar/user-avatar.component";
import {EnterpriseBannerComponent} from "core-components/enterprise-banner/enterprise-banner.component";
+import {EnterpriseComponent} from "core-components/enterprise/enterprise.component";
import {EnterpriseBannerBootstrapComponent} from "core-components/enterprise-banner/enterprise-banner-bootstrap.component";
import {DynamicModule} from "ng-dynamic-component";
import {VersionAutocompleterComponent} from "core-app/modules/common/autocomplete/version-autocompleter.component";
@@ -264,6 +265,7 @@ export function bootstrapModule(injector:Injector) {
// Enterprise Edition
EnterpriseBannerComponent,
EnterpriseBannerBootstrapComponent,
+ EnterpriseComponent,
// Autocompleter
CreateAutocompleterComponent,