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

Show simple embedded table next to the ifc viewer

Henriette Dinger4917a1f4a802
diff --git a/app/assets/stylesheets/layout/work_packages/_table_embedded.sass b/app/assets/stylesheets/layout/work_packages/_table_embedded.sass
index 10194b9bbef..9b0b148fad8 100644
--- a/app/assets/stylesheets/layout/work_packages/_table_embedded.sass
+++ b/app/assets/stylesheets/layout/work_packages/_table_embedded.sass
@@ -37,6 +37,7 @@ $table-timeline--compact-row-height: 28px
flex-direction: column
overflow: hidden
width: 100%
+ height: 100%
// Align with section header
.wp-table--table-header:first-child .generic-table--sort-header-outer,
diff --git a/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.html b/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.html
new file mode 100644
index 00000000000..91de9cf5b2c
--- /dev/null
+++ b/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.html
@@ -0,0 +1,12 @@
+<div class="ifc-base-view--container">
+ <div class="ifc-view--viewer-container">
+ <ifc-viewer></ifc-viewer>
+ </div>
+
+ <div class="ifc-view--table-container" wp-isolated-query-space>
+ <wp-embedded-table [queryProps]="queryProps"
+ [configuration]="configuration"
+ [externalHeight]="true">
+ </wp-embedded-table>
+ </div>
+</div>
\ No newline at end of file
diff --git a/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.sass b/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.sass
new file mode 100644
index 00000000000..79739616742
--- /dev/null
+++ b/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.sass
@@ -0,0 +1,10 @@
+:host
+ max-height: 85%
+
+.ifc-base-view--container
+ display: flex
+ height: 100%
+
+.ifc-view--table-container
+ height: 100%
+ margin-left: 20px
diff --git a/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.ts b/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.ts
new file mode 100644
index 00000000000..3499f91fb61
--- /dev/null
+++ b/frontend/src/app/modules/ifc_models/ifc-base-view/ifc-base-view.component.ts
@@ -0,0 +1,64 @@
+// -- 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 {ChangeDetectionStrategy, Component} from "@angular/core";
+import {DynamicBootstrapper} from "core-app/globals/dynamic-bootstrapper";
+import {WorkPackageTableConfigurationObject} from "core-components/wp-table/wp-table-configuration";
+
+@Component({
+ templateUrl: './ifc-base-view.component.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+ selector: 'ifc-base-view',
+ styleUrls: ['./ifc-base-view.component.sass']
+})
+export class IfcBaseViewComponent {
+
+ private filters:any[] = [];
+
+ public queryProps = {
+ 'columns[]': ['id', 'project', 'subject'],
+ filters: JSON.stringify(this.filters),
+ sortBy: JSON.stringify([['updatedAt', 'desc']]),
+ showHierarchies: false
+ };
+
+ public configuration:WorkPackageTableConfigurationObject = {
+ actionsColumnEnabled: false,
+ columnMenuEnabled: true,
+ contextMenuEnabled: false,
+ inlineCreateEnabled: false,
+ withFilters: true,
+ showFilterButton: false,
+ };
+
+
+
+}
+DynamicBootstrapper.register({
+ selector: 'ifc-base-view', cls: IfcBaseViewComponent
+});
\ No newline at end of file
diff --git a/frontend/src/app/modules/ifc_models/ifc-viewer.component.ts b/frontend/src/app/modules/ifc_models/ifc-viewer/ifc-viewer.component.ts
similarity index 89%
rename from frontend/src/app/modules/ifc_models/ifc-viewer.component.ts
rename to frontend/src/app/modules/ifc_models/ifc-viewer/ifc-viewer.component.ts
index 86265ee520c..6babacb16df 100644
--- a/frontend/src/app/modules/ifc_models/ifc-viewer.component.ts
+++ b/frontend/src/app/modules/ifc_models/ifc-viewer/ifc-viewer.component.ts
@@ -1,6 +1,6 @@
// -- copyright
-// OpenProject is a project management system.
-// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
+// 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.
@@ -23,15 +23,15 @@
// 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.
+// See docs/COPYRIGHT.rdoc for more details.
// ++
-/// <reference path="xeokit.d.ts" />
+/// <reference path="../xeokit/xeokit.d.ts" />
import {Component, ElementRef, Input, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
-import {DynamicBootstrapper} from "app/globals/dynamic-bootstrapper";
+import {DynamicBootstrapper} from "core-app/globals/dynamic-bootstrapper";
-import {XeokitServer} from "./xeokit-server";
+import {XeokitServer} from "../xeokit/xeokit-server";
import {GonService} from "core-app/modules/common/gon/gon.service";
@Component({
diff --git a/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts b/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts
index 0106830d98c..80a922859cb 100644
--- a/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts
+++ b/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts
@@ -27,18 +27,26 @@
// ++
import {NgModule} from "@angular/core";
-import {IFCViewerComponent} from "core-app/modules/ifc_models/ifc-viewer.component";
+import {IFCViewerComponent} from "core-app/modules/ifc_models/ifc-viewer/ifc-viewer.component";
+import {IfcBaseViewComponent} from "core-app/modules/ifc_models/ifc-base-view/ifc-base-view.component";
+import {OpenprojectWorkPackagesModule} from "core-app/modules/work_packages/openproject-work-packages.module";
@NgModule({
+ imports: [
+ OpenprojectWorkPackagesModule
+ ],
providers: [
],
declarations: [
+ IfcBaseViewComponent,
IFCViewerComponent
],
exports: [
+ IfcBaseViewComponent,
IFCViewerComponent
],
entryComponents: [
+ IfcBaseViewComponent,
IFCViewerComponent
]
})
diff --git a/frontend/src/app/modules/ifc_models/xeokit-server.d.ts b/frontend/src/app/modules/ifc_models/xeokit/xeokit-server.d.ts
similarity index 100%
rename from frontend/src/app/modules/ifc_models/xeokit-server.d.ts
rename to frontend/src/app/modules/ifc_models/xeokit/xeokit-server.d.ts
diff --git a/frontend/src/app/modules/ifc_models/xeokit-server.js b/frontend/src/app/modules/ifc_models/xeokit/xeokit-server.js
similarity index 100%
rename from frontend/src/app/modules/ifc_models/xeokit-server.js
rename to frontend/src/app/modules/ifc_models/xeokit/xeokit-server.js
diff --git a/frontend/src/app/modules/ifc_models/xeokit.d.ts b/frontend/src/app/modules/ifc_models/xeokit/xeokit.d.ts
similarity index 100%
rename from frontend/src/app/modules/ifc_models/xeokit.d.ts
rename to frontend/src/app/modules/ifc_models/xeokit/xeokit.d.ts
diff --git a/modules/ifc_models/app/assets/stylesheets/ifc_viewer/generic.sass b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/generic.sass
index d5c9985a465..6b860ce2c7e 100644
--- a/modules/ifc_models/app/assets/stylesheets/ifc_viewer/generic.sass
+++ b/modules/ifc_models/app/assets/stylesheets/ifc_viewer/generic.sass
@@ -32,7 +32,7 @@
[data-name="ifc_models"] .main-menu--children
overflow-x: hidden !important
-.ifc-viewer--container
+.ifc-view--viewer-container
flex-grow: 1
position: relative
width: 100%
diff --git a/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb b/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb
index 7168c97bd12..6f0fcb22aa3 100644
--- a/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb
+++ b/modules/ifc_models/app/views/ifc_models/ifc_models/show.html.erb
@@ -60,7 +60,5 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
<% if @ifc_model.converted? %>
-<div class="ifc-viewer--container">
- <ifc-viewer></ifc-viewer>
-</div>
+ <ifc-base-view></ifc-base-view>
<% end %>
diff --git a/modules/ifc_models/app/views/ifc_models/ifc_models/show_defaults.html.erb b/modules/ifc_models/app/views/ifc_models/ifc_models/show_defaults.html.erb
index 942c8b14f82..6205d5f6016 100644
--- a/modules/ifc_models/app/views/ifc_models/ifc_models/show_defaults.html.erb
+++ b/modules/ifc_models/app/views/ifc_models/ifc_models/show_defaults.html.erb
@@ -54,7 +54,5 @@ See doc/COPYRIGHT.rdoc for more details.
<%= render partial: 'unconverted_notice', locals: { unconverted: unconverted } %>
<% end %>
- <div class="ifc-viewer--container">
- <ifc-viewer></ifc-viewer>
- </div>
+ <ifc-base-view></ifc-base-view>
<% end %>