Merge pull request #8063 from opf/bim/fix/ifc_full_page_angular
render ifc default models within angular page [ci skip]pull/8067/head
commit
316856820f
@ -1,12 +0,0 @@ |
||||
<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> |
@ -1,12 +0,0 @@ |
||||
*:host |
||||
height: calc(100% - 60px) |
||||
|
||||
.ifc-base-view--container |
||||
display: flex |
||||
height: 100% |
||||
|
||||
.ifc-view--table-container |
||||
height: 100% |
||||
margin-left: 15px |
||||
// Cancel out space for scroll bar and align with toolbar and header |
||||
margin-right: -15px |
@ -1,71 +0,0 @@ |
||||
// -- 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 { |
||||
public queryProps:{ [key:string]:any }; |
||||
public configuration:WorkPackageTableConfigurationObject; |
||||
|
||||
private filters:any[] = []; |
||||
|
||||
constructor() { |
||||
this.configuration = { |
||||
actionsColumnEnabled: false, |
||||
columnMenuEnabled: false, |
||||
contextMenuEnabled: false, |
||||
inlineCreateEnabled: false, |
||||
withFilters: true, |
||||
showFilterButton: false, |
||||
isCardView: true |
||||
}; |
||||
|
||||
this.filters.push({ status: { |
||||
operator: 'o', |
||||
values: [] }}); |
||||
|
||||
this.queryProps = { |
||||
'columns[]': ['id', 'subject'], |
||||
filters: JSON.stringify(this.filters), |
||||
sortBy: JSON.stringify([['updatedAt', 'desc']]), |
||||
showHierarchies: false |
||||
}; |
||||
} |
||||
|
||||
} |
||||
DynamicBootstrapper.register({ |
||||
selector: 'ifc-base-view', cls: IfcBaseViewComponent |
||||
}); |
@ -0,0 +1,34 @@ |
||||
<div class="toolbar-container"> |
||||
<div class="toolbar"> |
||||
<div class="title-container"> |
||||
<h2 [textContent]="title"> |
||||
</h2> |
||||
</div> |
||||
<ul class="toolbar-items"> |
||||
<li class="toolbar-item" |
||||
*ngIf="manageAllowed"> |
||||
<a class="button" |
||||
[href]="manageIFCPath"> |
||||
<op-icon icon-classes="button--icon icon-settings2"></op-icon> |
||||
<span class="button--text" |
||||
[textContent]="text.manage" |
||||
aria-hidden="true"></span> |
||||
</a> |
||||
</li> |
||||
<li class="toolbar-item hidden-for-mobile"> |
||||
<zen-mode-toggle-button></zen-mode-toggle-button> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
<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> |
@ -0,0 +1,19 @@ |
||||
*:host |
||||
height: 100% |
||||
overflow: hidden |
||||
display: grid |
||||
grid-template-columns: 1fr 500px |
||||
grid-template-rows: 60px calc(100% - 60px) |
||||
grid-template-areas: "header header" "ifc-model wp-list" |
||||
grid-column-gap: 10px |
||||
|
||||
.toolbar-container |
||||
grid-area: header |
||||
|
||||
.ifc-view--view-table-container |
||||
grid-area: wp-list |
||||
|
||||
.ifc-view--viewer-container |
||||
grid-area: ifc-model |
||||
position: relative |
||||
overflow: hidden |
@ -0,0 +1,83 @@ |
||||
import {Component} from "@angular/core"; |
||||
import {I18nService} from "core-app/modules/common/i18n/i18n.service"; |
||||
import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service"; |
||||
import {CurrentProjectService} from "core-components/projects/current-project.service"; |
||||
import {WorkPackageTableConfigurationObject} from "core-components/wp-table/wp-table-configuration"; |
||||
import { StateService } from '@uirouter/core'; |
||||
import {GonService} from "core-app/modules/common/gon/gon.service"; |
||||
|
||||
@Component({ |
||||
templateUrl: './ifc-index-page.component.html', |
||||
styleUrls: ['./ifc-index-page.component.sass'] |
||||
}) |
||||
export class IFCIndexPageComponent { |
||||
public text = { |
||||
title: this.i18n.t('js.ifc_models.models.default'), |
||||
manage: this.i18n.t('js.ifc_models.models.manage'), |
||||
delete: this.i18n.t('js.button_delete'), |
||||
edit: this.i18n.t('js.button_edit'), |
||||
areYouSure: this.i18n.t('js.text_are_you_sure') |
||||
}; |
||||
public queryProps:{ [key:string]:any }; |
||||
public configuration:WorkPackageTableConfigurationObject = { |
||||
actionsColumnEnabled: false, |
||||
columnMenuEnabled: false, |
||||
contextMenuEnabled: false, |
||||
inlineCreateEnabled: false, |
||||
withFilters: true, |
||||
showFilterButton: false, |
||||
isCardView: true |
||||
}; |
||||
|
||||
private filters:any[] = []; |
||||
|
||||
constructor(readonly state:StateService, |
||||
readonly i18n:I18nService, |
||||
readonly paths:PathHelperService, |
||||
readonly currentProject:CurrentProjectService, |
||||
readonly gon:GonService) { |
||||
|
||||
this.applyFilters(); |
||||
} |
||||
|
||||
public get title() { |
||||
if (this.state.current.name === 'bim_defaults') { |
||||
return this.i18n.t('js.ifc_models.models.default'); |
||||
} else { |
||||
return this.gonIFC['models'][0]['name']; |
||||
} |
||||
} |
||||
|
||||
public get projectIdentifier() { |
||||
return this.currentProject.identifier!; |
||||
} |
||||
|
||||
public get manageIFCPath() { |
||||
return this.paths.ifcModelsPath(this.projectIdentifier); |
||||
} |
||||
|
||||
public get manageAllowed() { |
||||
return this.gonIFC.permissions.manage; |
||||
} |
||||
|
||||
private applyFilters() { |
||||
// TODO: Limit to project
|
||||
this.filters.push({ |
||||
status: { |
||||
operator: 'o', |
||||
values: [] |
||||
} |
||||
}); |
||||
|
||||
this.queryProps = { |
||||
'columns[]': ['id', 'subject'], |
||||
filters: JSON.stringify(this.filters), |
||||
sortBy: JSON.stringify([['updatedAt', 'desc']]), |
||||
showHierarchies: false |
||||
}; |
||||
} |
||||
|
||||
private get gonIFC() { |
||||
return (this.gon.get('ifc_models') as any) |
||||
} |
||||
} |
@ -0,0 +1,6 @@ |
||||
en: |
||||
js: |
||||
ifc_models: |
||||
models: |
||||
default: 'Default IFC models' |
||||
manage: 'Manage models' |
Loading…
Reference in new issue