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

adapt frontend to still display shapshots in single view

ulferts3f9d59430e5d
diff --git a/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.html b/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.html
index 61e6b8e92ec..628ddab8780 100644
--- a/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.html
+++ b/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.html
@@ -71,7 +71,7 @@
</div>
</div>
- <div *ngIf="workPackage.bcf">
+ <div *ngIf="workPackage.bcfTopic">
<bcf-wp-single-view [workPackage]="workPackage"></bcf-wp-single-view>
</div>
diff --git a/frontend/src/app/components/wp-activity/user/user-activity.component.ts b/frontend/src/app/components/wp-activity/user/user-activity.component.ts
index 73360e4b3d7..df2850a4561 100644
--- a/frontend/src/app/components/wp-activity/user/user-activity.component.ts
+++ b/frontend/src/app/components/wp-activity/user/user-activity.component.ts
@@ -46,7 +46,6 @@ import {UserCacheService} from "core-components/user/user-cache.service";
import {CommentService} from "core-components/wp-activity/comment-service";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
import {WorkPackageCommentFieldHandler} from "core-components/work-packages/work-package-comment/work-package-comment-field-handler";
-import {ViewPointOriginal} from "core-app/modules/bim/bcf/bcf-wp-single-view/bcf-wp-single-view.component";
import {DomSanitizer, SafeHtml} from "@angular/platform-browser";
import {HalResource} from "core-app/modules/hal/resources/hal-resource";
@@ -74,7 +73,8 @@ export class UserActivityComponent extends WorkPackageCommentFieldHandler implem
public isComment:boolean;
public isBcfComment:boolean;
public postedComment:SafeHtml;
- public bcfSnapshot:ViewPointOriginal;
+ // TODO: turn into HalResource
+ public bcfSnapshot:any;
public focused = false;
diff --git a/frontend/src/app/modules/bim/bcf/bcf-wp-single-view/bcf-wp-single-view.component.ts b/frontend/src/app/modules/bim/bcf/bcf-wp-single-view/bcf-wp-single-view.component.ts
index 3833d2821d4..73eb2bafe75 100644
--- a/frontend/src/app/modules/bim/bcf/bcf-wp-single-view/bcf-wp-single-view.component.ts
+++ b/frontend/src/app/modules/bim/bcf/bcf-wp-single-view/bcf-wp-single-view.component.ts
@@ -4,10 +4,10 @@ import {StateService} from "@uirouter/core";
import {WorkPackageResource} from "core-app/modules/hal/resources/work-package-resource";
import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";
import { NgxGalleryOptions, NgxGalleryImage, NgxGalleryAnimation } from 'ngx-gallery';
+import {HalLink} from "core-app/modules/hal/hal-link/hal-link";
-export type ViewPointOriginal = { id:string, file_name:string };
-export type ViewPoint = { id:string, fileName:string, fullPath:string };
+export type ViewPoint = { fullPath:string };
@Component({
selector: 'bcf-wp-single-view',
@@ -18,7 +18,46 @@ export type ViewPoint = { id:string, fileName:string, fullPath:string };
export class BcfWpSingleViewComponent implements OnInit, OnDestroy {
@Input() workPackage:WorkPackageResource;
- galleryOptions:NgxGalleryOptions[];
+ galleryOptions:NgxGalleryOptions[] = [
+ {
+ width: '100%',
+ height: '400px',
+ thumbnailsColumns: 4,
+ imageAnimation: '',
+ previewAnimation: false,
+ previewCloseOnEsc: true,
+ previewKeyboardNavigation: true,
+ imageSize: 'contain',
+ imageArrowsAutoHide: true,
+ thumbnailsArrowsAutoHide: true,
+ thumbnailsAutoHide: true,
+ thumbnailsMargin: 5,
+ thumbnailMargin: 5,
+ previewDownload: true,
+ arrowPrevIcon: 'icon-arrow-left2',
+ arrowNextIcon: 'icon-arrow-right2',
+ closeIcon: 'icon-close',
+ downloadIcon: 'icon-download',
+ previewCloseOnClick: true,
+ },
+ // max-width 800
+ {
+ breakpoint: 800,
+ width: '100%',
+ height: '300px',
+ imagePercent: 80,
+ thumbnailsPercent: 20,
+ thumbnailsMargin: 5,
+ thumbnailMargin: 5,
+ imageSize: 'contain',
+ },
+ // max-width 400
+ {
+ breakpoint: 400,
+ height: '200px',
+ }
+ ];
+
galleryImages:NgxGalleryImage[];
private _viewpoints:ViewPoint[];
@@ -41,54 +80,12 @@ export class BcfWpSingleViewComponent implements OnInit, OnDestroy {
}
ngOnInit():void {
- this.viewpoints = this.workPackage.bcf.viewpoints.map((vp:ViewPointOriginal):ViewPoint => {
+ this.viewpoints = this.workPackage.bcfViewpoints.map((vp:HalLink):ViewPoint => {
return {
- id: vp.id,
- fileName: vp.file_name,
- fullPath: this.pathHelper.attachmentDownloadPath(vp.id, vp.file_name)
+ fullPath: `${vp.href}/snapshot`
};
});
- this.galleryOptions = [
- {
- width: '100%',
- height: '400px',
- thumbnailsColumns: 4,
- imageAnimation: '',
- previewAnimation: false,
- previewCloseOnEsc: true,
- previewKeyboardNavigation: true,
- imageSize: 'contain',
- imageArrowsAutoHide: true,
- thumbnailsArrowsAutoHide: true,
- thumbnailsAutoHide: true,
- thumbnailsMargin: 5,
- thumbnailMargin: 5,
- previewDownload: true,
- arrowPrevIcon: 'icon-arrow-left2',
- arrowNextIcon: 'icon-arrow-right2',
- closeIcon: 'icon-close',
- downloadIcon: 'icon-download',
- previewCloseOnClick: true,
- },
- // max-width 800
- {
- breakpoint: 800,
- width: '100%',
- height: '300px',
- imagePercent: 80,
- thumbnailsPercent: 20,
- thumbnailsMargin: 5,
- thumbnailMargin: 5,
- imageSize: 'contain',
- },
- // max-width 400
- {
- breakpoint: 400,
- height: '200px',
- }
- ];
-
this.galleryImages = this.viewpoints.map((vp:ViewPoint) => {
return {
small: vp.fullPath,
@@ -99,12 +96,10 @@ export class BcfWpSingleViewComponent implements OnInit, OnDestroy {
}
public galleryPreviewOpen():void {
- console.log("preview open");
jQuery('#top-menu')[0].style.zIndex = '10';
}
public galleryPreviewClose():void {
- console.log("preview close");
jQuery('#top-menu')[0].style.zIndex = '';
}