Skip to content

Commit

Permalink
Position modal dialogs relative to portal's scroll position in iframe #…
Browse files Browse the repository at this point in the history
  • Loading branch information
hupf committed Dec 5, 2023
1 parent cd0973c commit 73665b0
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 14 deletions.
16 changes: 14 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,25 @@
"error",
{
"name": "fdescribe",
"message": "Do not commit fdescribe. Use describe instead."
"message": "Do not commit 'fdescribe'. Use 'describe' instead."
}
],
"no-restricted-imports": [
"error",
{
"patterns": ["fp-ts/lib/*"]
"patterns": [
{
"group": ["fp-ts/lib/*"],
"message": "Please use 'fp-ts/es6' instead."
}
],
"paths": [
{
"name": "@ng-bootstrap/ng-bootstrap",
"importNames": ["NgbModal"],
"message": "Please use 'BkdModalService' instead."
}
]
}
],
"deprecation/deprecation": "warn",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Input, OnInit } from "@angular/core";
import { NgbModal, NgbModalRef } from "@ng-bootstrap/ng-bootstrap";
import { NgbModalRef } from "@ng-bootstrap/ng-bootstrap";
import { Observable } from "rxjs";
import { map, take } from "rxjs/operators";
import { PublishTestComponent } from "src/app/events/components/tests-publish/publish-test.component";
Expand All @@ -12,6 +12,7 @@ import {
StudentGrade,
} from "src/app/shared/models/student-grades";
import { Student } from "src/app/shared/models/student.model";
import { BkdModalService } from "src/app/shared/services/bkd-modal.service";
import { Test } from "../../../shared/models/test.model";
import { EventsStateService } from "../../services/events-state.service";
import { Filter, TestStateService } from "../../services/test-state.service";
Expand All @@ -29,7 +30,7 @@ export class TestEditGradesComponent implements OnInit {

constructor(
public state: TestStateService,
private modalService: NgbModal,
private modalService: BkdModalService,
) {}

ngOnInit(): void {
Expand Down
4 changes: 2 additions & 2 deletions src/app/events/components/tests-edit/tests-edit.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { TranslateService } from "@ngx-translate/core";
import {
BehaviorSubject,
Expand All @@ -12,6 +11,7 @@ import {
} from "rxjs";
import { take } from "rxjs/operators";
import { Test } from "src/app/shared/models/test.model";
import { BkdModalService } from "src/app/shared/services/bkd-modal.service";
import { CoursesRestService } from "src/app/shared/services/courses-rest.service";
import { ToastService } from "../../../shared/services/toast.service";
import { TestStateService } from "../../services/test-state.service";
Expand Down Expand Up @@ -41,7 +41,7 @@ export class TestsEditComponent {
private toastService: ToastService,
private translate: TranslateService,
private router: Router,
private modalService: NgbModal,
private modalService: BkdModalService,
) {}

openDeleteModal(test: Test) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
SimpleChanges,
} from "@angular/core";
import { Params } from "@angular/router";
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { TranslateService } from "@ngx-translate/core";
import { ReplaySubject, map, switchMap } from "rxjs";
import { PresenceControlViewMode } from "src/app/shared/models/user-settings.model";
import { BkdModalService } from "src/app/shared/services/bkd-modal.service";
import { LoadingService } from "src/app/shared/services/loading-service";
import { ToastService } from "../../../shared/services/toast.service";
import { PresenceControlEntry } from "../../models/presence-control-entry.model";
Expand Down Expand Up @@ -50,7 +50,7 @@ export class PresenceControlEntryComponent implements OnChanges {
constructor(
private toastService: ToastService,
private translate: TranslateService,
private modalService: NgbModal,
private modalService: BkdModalService,
private loadingService: LoadingService,
) {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ChangeDetectionStrategy, Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { TranslateService } from "@ngx-translate/core";
import { BehaviorSubject, combineLatest, forkJoin } from "rxjs";
import { map, switchMap, take } from "rxjs/operators";
import { BkdModalService } from "src/app/shared/services/bkd-modal.service";
import { UserSettingsService } from "src/app/shared/services/user-settings.service";
import { SubscriptionDetailsRestService } from "../../../shared/services/subscription-details-rest.service";
import { ToastService } from "../../../shared/services/toast.service";
Expand Down Expand Up @@ -68,7 +68,7 @@ export class PresenceControlGroupComponent implements OnInit {
private subscriptionDetailService: SubscriptionDetailsRestService,
private toastService: ToastService,
private translate: TranslateService,
private modalService: NgbModal,
private modalService: BkdModalService,
) {}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
OnInit,
} from "@angular/core";
import { ActivatedRoute, Params } from "@angular/router";
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { BehaviorSubject, Subject, combineLatest } from "rxjs";
import { map, shareReplay, take, takeUntil } from "rxjs/operators";
import { BkdModalService } from "src/app/shared/services/bkd-modal.service";
import { LessonPresencesUpdateService } from "src/app/shared/services/lesson-presences-update.service";
import { ScrollPositionService } from "src/app/shared/services/scroll-position.service";
import { parseISOLocalDate } from "src/app/shared/utils/date";
Expand Down Expand Up @@ -46,7 +46,7 @@ export class PresenceControlListComponent
private blockLessons: PresenceControlBlockLessonService,
private lessonPresencesUpdateService: LessonPresencesUpdateService,
private presenceTypesService: PresenceTypesService,
private modalService: NgbModal,
private modalService: BkdModalService,
private scrollPosition: ScrollPositionService,
private route: ActivatedRoute,
) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, Input, OnChanges, SimpleChanges } from "@angular/core";
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { ReplaySubject, map } from "rxjs";
import {
replaceResultInTest,
Expand All @@ -8,6 +7,7 @@ import {
import { DropDownItem } from "src/app/shared/models/drop-down-item.model";
import { GradingScale } from "src/app/shared/models/grading-scale.model";
import { Result, Test } from "src/app/shared/models/test.model";
import { BkdModalService } from "src/app/shared/services/bkd-modal.service";
import { DossierGradesService } from "../../../services/dossier-grades.service";
import { DossierGradesEditComponent } from "../dossier-grades-edit/dossier-grades-edit.component";

Expand Down Expand Up @@ -63,7 +63,7 @@ export class DossierSingleTestComponent implements OnChanges {

constructor(
private gradeService: DossierGradesService,
private modalService: NgbModal,
private modalService: BkdModalService,
) {}

ngOnChanges(changes: SimpleChanges): void {
Expand Down
15 changes: 15 additions & 0 deletions src/app/shared/services/bkd-modal.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { TestBed } from "@angular/core/testing";
import { BkdModalService } from "./bkd-modal.service";

describe("BkdModalService", () => {
let service: BkdModalService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(BkdModalService);
});

it("should be created", () => {
expect(service).toBeTruthy();
});
});
Loading

0 comments on commit 73665b0

Please sign in to comment.