Skip to content

Commit

Permalink
Fix issues with SSR by disabling ng2-pdf-viewer and removing ng2-dragula
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav2070 committed Dec 24, 2024
1 parent 6676f7d commit 1916a5d
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 131 deletions.
70 changes: 0 additions & 70 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"http": "0.0.0",
"jszip": "^3.10.1",
"localforage": "^1.10.0",
"ng2-dragula": "^5.1.0",
"ng2-pdf-viewer": "^10.4.0",
"ngx-file-helpers": "^13.0.1",
"pocketlib-server": "file:server",
Expand All @@ -80,13 +79,5 @@
"ts-node": "^10.9.2",
"tslint": "^6.1.3",
"typescript": "^5.6.3"
},
"overrides": {
"ng2-dragula": {
"@types/dragula": "^3.7.3",
"@angular/animations": "^19.0.5",
"@angular/common": "^19.0.5",
"@angular/core": "^19.0.5"
}
}
}
6 changes: 2 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import { AppRoutingModule } from "./app-routing.module"
import { NgxFileHelpersModule } from "ngx-file-helpers"
import { BrowserAnimationsModule } from "@angular/platform-browser/animations"
import { PortalModule } from "@angular/cdk/portal"
import { PdfViewerModule } from "ng2-pdf-viewer"
//import { PdfViewerModule } from "ng2-pdf-viewer"
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome"
import { DragulaModule } from "ng2-dragula"
import { ServiceWorkerModule } from "@angular/service-worker"

// Apollo
Expand Down Expand Up @@ -209,9 +208,8 @@ import { OrderConfirmationPageComponent } from "./pages/order-confirmation-page/
NgxFileHelpersModule,
BrowserAnimationsModule,
PortalModule,
PdfViewerModule,
//PdfViewerModule,
FontAwesomeModule,
DragulaModule.forRoot(),
ServiceWorkerModule.register("ngsw-worker.js", {
enabled:
environment.environment == Environment.Staging ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
</dav-header>
</div>

<div
class="books-container"
dragula="books"
[dragulaModel]="books"
(dragulaModelChange)="BooksReordered($event)"
>
<div class="books-container">
@for (book of books; track book.uuid) {
<div class="book-card" (contextmenu)="ShowBookContextMenu($event, book)">
<dav-blurhash-image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, ViewChild, ElementRef, HostListener } from "@angular/core"
import { Router, ActivatedRoute } from "@angular/router"
import { DragulaService } from "ng2-dragula"
import { faTrashCan as faTrashCanLight } from "@fortawesome/pro-light-svg-icons"
import { ContextMenu } from "dav-ui-components"
import { EditNameDialogComponent } from "src/app/components/dialogs/edit-name-dialog/edit-name-dialog.component"
Expand Down Expand Up @@ -56,14 +55,8 @@ export class AuthorSeriesPageComponent {
private localizationService: LocalizationService,
private settingsService: SettingsService,
private router: Router,
private activatedRoute: ActivatedRoute,
private dragulaService: DragulaService
private activatedRoute: ActivatedRoute
) {
this.dragulaService.drag("books").subscribe(() => (this.dragging = true))
this.dragulaService
.dragend("books")
.subscribe(() => (this.dragging = false))

this.dataService.setMeta()
}

Expand Down
2 changes: 0 additions & 2 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
// Required for Dragula
(window as any).global = window
32 changes: 0 additions & 32 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -667,35 +667,3 @@ $alpha: 0.4;
}
}
}

// Dragula styles
/* in-flight clone */
.gu-mirror {
position: fixed !important;
margin: 0 !important;
z-index: 9999 !important;
opacity: 0.8;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
filter: alpha(opacity=80);
pointer-events: none;
}

/* high-performance display:none; helper */
.gu-hide {
left: -9999px !important;
}

/* added to mirrorContainer (default = body) while dragging */
.gu-unselectable {
-webkit-user-select: none !important;
-moz-user-select: none !important;
-ms-user-select: none !important;
user-select: none !important;
}

/* added to the source element while its mirror is dragged */
.gu-transit {
opacity: 0.2;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
filter: alpha(opacity=20);
}

0 comments on commit 1916a5d

Please sign in to comment.