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
make new feature teaser edition dependent
Markus Kahlb6a12be16686
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erbindex e1c31ba72c6..5c02a12d2f9 100644--- a/app/views/layouts/base.html.erb+++ b/app/views/layouts/base.html.erb@@ -61,7 +61,8 @@ See docs/COPYRIGHT.rdoc for more details.data-locale="<%= I18n.locale %>"data-first-day-of-week="<%= locale_first_day_of_week %>"data-default-locale="<%= I18n.default_locale %>"- data-environment="<%= Rails.env %>"/>+ data-environment="<%= Rails.env %>"+ data-edition="<%= OpenProject::Configuration.edition %>"/><meta name="current_menu_item" content="<%= current_menu_item %>"/><% if Setting.demo_projects_available %><meta name="demo_projects_available" content="true"/><% end %><% if Setting.boards_demo_data_available %><meta name="boards_demo_data_available" content="true"/><% end %>diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex c660aaa49d6..2adeead5324 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -230,13 +230,31 @@ en:blocks:new_features:text_new_features: "Read about new features and product updates."- current_new_feature_html: "OpenProject contains a new <b>Overview page</b> to <b>display important project information</b> and show whether the project is on track. </br>- You can insert various new status widgets, such as:- <ul><li>project status,</li>- <li>overview of work package status,</li>- <li>task progress,</li>- <li>tasks assigned to users.</li></ul>"- learn_about: "Learn more about the new status widgets"+ learn_about: "Learn more about the new features"+ standard:+ learn_about_link: https://www.openproject.org/openproject-10-4+ current_new_feature_html: >+ The release contains various new features and improvements: <br><br>+ <ul>+ <li>Default <b>design templates</b> to select a light or dark theme (premium feature)</li>+ <li>New <b>time tracking widget</b> for <i>My page</i> to show spent time in a bar chart</li>+ <li><b>XLS-exports for cost reports</b> and formatted text in PDF export of work packages</li>+ <li><b>Improved design and usability</b>, i.e. tabs and more in project settings and administration</li>+ </ul>+ bim:+ learn_about_link: https://www.openproject.org/openproject-bim-10-4+ current_new_feature_html: >+ OpenProject contains a <b>new IFC module to integrate 3D models</b>+ into your project management application and to work collaboratively+ with these files with your team without installation of separate+ costly software or licenses. <br><br>+ <ul>+ <li><b>Import IFC files</b> of building models into your OpenProject application</li>+ <li>overview of work package status,</li>+ <li>task progress,</li>+ <li>tasks assigned to users.</li>+ </ul>+label_activate: "Activate"label_add_column_after: "Add column after"label_add_column_before: "Add column before"diff --git a/frontend/src/app/components/homescreen/blocks/new-features.component.spec.ts b/frontend/src/app/components/homescreen/blocks/new-features.component.spec.tsnew file mode 100644index 00000000000..599040206da--- /dev/null+++ b/frontend/src/app/components/homescreen/blocks/new-features.component.spec.ts@@ -0,0 +1,73 @@+// -- 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 {Component, DebugElement} from "@angular/core";++import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';+import {By} from "@angular/platform-browser";+import { I18nService } from 'core-app/modules/common/i18n/i18n.service';+import { HomescreenNewFeaturesBlockComponent } from './new-features.component';++describe('shows edition-specific content', () => {+ let app:HomescreenNewFeaturesBlockComponent;+ let fixture:ComponentFixture<HomescreenNewFeaturesBlockComponent>;+ let element:DebugElement;++ beforeEach(() => {+ // noinspection JSIgnoredPromiseFromCall+ TestBed.configureTestingModule({+ declarations: [+ HomescreenNewFeaturesBlockComponent+ ],+ providers: [I18nService]+ }).compileComponents();+++ fixture = TestBed.createComponent(HomescreenNewFeaturesBlockComponent);+ app = fixture.debugElement.componentInstance;+ element = fixture.debugElement.query(By.css('div.widget-box--description p'));+ });++ it('should render bim text for bim edition', fakeAsync(() => {+ app.isStandardEdition = false;++ fixture.detectChanges();++ // checking for missing translation key as translations are not loaded in specs+ expect(element.nativeElement.textContent).toContain(".bim.current_new_feature_html");+ }));++ it('should render standard text for standard edition', fakeAsync(() => {+ app.isStandardEdition = true;++ fixture.detectChanges();++ // checking for missing translation key as translations are not loaded in specs+ expect(element.nativeElement.textContent).toContain(".standard.current_new_feature_html");+ }));+});diff --git a/frontend/src/app/components/homescreen/blocks/new-features.component.ts b/frontend/src/app/components/homescreen/blocks/new-features.component.tsindex 49e41b12852..356cc2e9ddf 100644--- a/frontend/src/app/components/homescreen/blocks/new-features.component.ts+++ b/frontend/src/app/components/homescreen/blocks/new-features.component.ts@@ -30,7 +30,6 @@ import {Component} from '@angular/core';import {DynamicBootstrapper} from "core-app/globals/dynamic-bootstrapper";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {DomSanitizer} from "@angular/platform-browser";-import {dashboardWebsiteUrl} from "core-app/modules/dashboards/dashboard-constants.const";@Component({template: `@@ -39,12 +38,12 @@ import {dashboardWebsiteUrl} from "core-app/modules/dashboards/dashboard-constan</p><div class="widget-box--description">- <p [innerHtml]="text.currentNewFeatureHtml"></p>+ <p [innerHtml]="currentNewFeatureHtml"></p><a class="widget-box--teaser-image"></a></div>- <a [href]="teaserWebsiteUrl()" target="_blank">{{ text.learnAbout }}</a>+ <a [href]="teaserWebsiteUrl" target="_blank">{{ text.learnAbout }}</a>`,selector: 'homescreen-new-features-block',styleUrls: ['./new-features.component.sass'],@@ -56,19 +55,38 @@ import {dashboardWebsiteUrl} from "core-app/modules/dashboards/dashboard-constan* Locals (js-en.yml), Styles (new-features.component.sass), HTML (above), TS (below)*/export class HomescreenNewFeaturesBlockComponent {+ public isStandardEdition:boolean;+public text = {newFeatures: this.i18n.t('js.label_new_features'),descriptionNewFeatures: this.i18n.t('js.homescreen.blocks.new_features.text_new_features'),- currentNewFeatureHtml: this.i18n.t('js.homescreen.blocks.new_features.current_new_feature_html'),learnAbout: this.i18n.t('js.homescreen.blocks.new_features.learn_about'),};- constructor(readonly i18n:I18nService,- readonly domSanitizer:DomSanitizer) {+ constructor(+ readonly i18n:I18nService,+ readonly domSanitizer:DomSanitizer+ ) {+ this.isStandardEdition = window.OpenProject.isStandardEdition;+ }++ public get teaserWebsiteUrl() {+ let url = this.translated('learn_about_link');+ return this.domSanitizer.bypassSecurityTrustResourceUrl(url);+ }++ public get currentNewFeatureHtml():string {+ return this.translated('current_new_feature_html');+ }++ private translated(key:string):string {+ return this.i18n.t(this.i18nBase + this.i18nPrefix + '.' + key);}- public teaserWebsiteUrl() {- return this.domSanitizer.bypassSecurityTrustResourceUrl(dashboardWebsiteUrl);+ private i18nBase:string = 'js.homescreen.blocks.new_features.';++ private get i18nPrefix():string {+ return this.isStandardEdition ? "standard" : "bim";}}diff --git a/frontend/src/app/globals/openproject.ts b/frontend/src/app/globals/openproject.tsindex c9e0073663e..7f286de51d4 100644--- a/frontend/src/app/globals/openproject.ts+++ b/frontend/src/app/globals/openproject.ts@@ -58,6 +58,18 @@ export class OpenProject {return jQuery('meta[name=openproject_initializer]').data('environment');}+ public get edition():string {+ return jQuery('meta[name=openproject_initializer]').data('edition');+ }++ public get isStandardEdition():boolean {+ return this.edition == "standard";+ }++ public get isBimEdition():boolean {+ return this.edition == "bim";+ }+/*** Guard access to reads and writes to the localstorage due to corrupted local databases* in Firefox happening in one larger client.@@ -83,4 +95,3 @@ export class OpenProject {}window.OpenProject = new OpenProject();-diff --git a/frontend/src/app/modules/dashboards/dashboard-constants.const.ts b/frontend/src/app/modules/dashboards/dashboard-constants.const.tsdeleted file mode 100644index bab2e3b56d2..00000000000--- a/frontend/src/app/modules/dashboards/dashboard-constants.const.ts+++ /dev/null@@ -1 +0,0 @@-export const dashboardWebsiteUrl = "https://www.openproject.org/collaboration-software-features/dashboards/";diff --git a/modules/bim_seeder/app/assets/images/bim_seeder/ifc-integration-v3.jpg b/modules/bim_seeder/app/assets/images/bim_seeder/ifc-integration-v3.jpgnew file mode 100644index 00000000000..07db0f73bbeBinary files /dev/null and b/modules/bim_seeder/app/assets/images/bim_seeder/ifc-integration-v3.jpg differdiff --git a/modules/bim_seeder/lib/open_project/bim_seeder/patches/design_patch.rb b/modules/bim_seeder/lib/open_project/bim_seeder/patches/design_patch.rbindex 5a15109305b..42cb2d24501 100644--- a/modules/bim_seeder/lib/open_project/bim_seeder/patches/design_patch.rb+++ b/modules/bim_seeder/lib/open_project/bim_seeder/patches/design_patch.rb@@ -14,7 +14,8 @@ module OpenProject::BimSeeder'main-menu-bg-color' => "#0E2045",'main-menu-bg-selected-background' => "#3270DB",'main-menu-bg-hover-background' => "#163473",- 'header-home-link-bg' => '#{image-url("bim_seeder/logo_openproject_bim_big.png") no-repeat 20px 0}'+ 'header-home-link-bg' => '#{image-url("bim_seeder/logo_openproject_bim_big.png") no-repeat 20px 0}',+ 'new-feature-teaser-image' => '#{image-url("bim_seeder/ifc-integration-v3.jpg")}'}).freezeend