Skip to content

Commit

Permalink
Fix some missing spacers
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom committed Sep 12, 2023
1 parent 29b1f4e commit 633fc25
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,43 +35,36 @@ <h2>{{ 'New amendment' | translate }}</h2>
<mat-horizontal-stepper #matStepper linear>
<mat-step [completed]="contentForm.value.selectedParagraphs.length > 0">
<ng-template matStepLabel>{{ 'Select paragraphs' | translate }}</ng-template>
<div class="amendment-create-wizard-wrapper">
<cdk-virtual-scroll-viewport
itemSize="90"
minBufferPx="400"
maxBufferPx="600"
class="paragraph-scroll"
<div class="amendment-create-wizard-wrapper spacer-bottom-20">
<section
*ngFor="let paragraph of paragraphs; let i = index"
class="paragraph-row background-hover"
[class.outlined-hover]="isParagraphSelected(paragraph)"
(click)="onParagraphClicked(paragraph)"
>
<section
*ngFor="let paragraph of paragraphs; let i = index"
class="paragraph-row background-hover"
[class.outlined-hover]="isParagraphSelected(paragraph)"
(click)="onParagraphClicked(paragraph)"
>
<mat-checkbox
*ngIf="multipleParagraphsAllowed"
class="flex-center paragraph-select"
[checked]="isParagraphSelected(paragraph)"
(click)="checkboxClicked($event)"
></mat-checkbox>
<mat-radio-button
*ngIf="!multipleParagraphsAllowed"
class="flex-center paragraph-select"
[checked]="isParagraphSelected(paragraph)"
></mat-radio-button>
<div class="paragraph-text motion-text">
<div>
<i *ngIf="paragraph.lineFrom >= paragraph.lineTo" class="line-number">
{{ 'Line' | translate }} {{ paragraph.lineFrom }}:
</i>
<i *ngIf="paragraph.lineFrom < paragraph.lineTo" class="line-number">
{{ 'Line' | translate }} {{ paragraph.lineFrom }} - {{ paragraph.lineTo }}:
</i>
</div>
<div [innerHTML]="getParagraphPreview(i) | trust : 'html'"></div>
<mat-checkbox
*ngIf="multipleParagraphsAllowed"
class="flex-center paragraph-select"
[checked]="isParagraphSelected(paragraph)"
(click)="checkboxClicked($event)"
></mat-checkbox>
<mat-radio-button
*ngIf="!multipleParagraphsAllowed"
class="flex-center paragraph-select"
[checked]="isParagraphSelected(paragraph)"
></mat-radio-button>
<div class="paragraph-text motion-text">
<div>
<i *ngIf="paragraph.lineFrom >= paragraph.lineTo" class="line-number">
{{ 'Line' | translate }} {{ paragraph.lineFrom }}:
</i>
<i *ngIf="paragraph.lineFrom < paragraph.lineTo" class="line-number">
{{ 'Line' | translate }} {{ paragraph.lineFrom }} - {{ paragraph.lineTo }}:
</i>
</div>
</section>
</cdk-virtual-scroll-viewport>
<div [innerHTML]="getParagraphPreview(i) | trust : 'html'"></div>
</div>
</section>
</div>
</mat-step>
<mat-step>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.amendment-create-wizard-wrapper {
.paragraph-scroll {
height: calc(100vh - 160px);
height: calc(100vh - 245px);
}

.paragraph-row {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h2>{{ 'Tags' | translate }}</h2>
[hiddenInMobile]="['menu']"
[(selectedRows)]="selectedRows"
[filterProps]="['name']"
[addBottomSpacer]="hasInteractionState | async"
>
<!-- Name column -->
<div *osScrollingTableCell="'name'; value as name" class="cell-slot fill">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { ChangeDetectorRef, Component, OnInit, TemplateRef, ViewChild } from '@a
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
import { map, Observable } from 'rxjs';
import { infoDialogSettings } from 'src/app/infrastructure/utils/dialog-settings';
import { BaseMeetingListViewComponent } from 'src/app/site/pages/meetings/base/base-meeting-list-view.component';
import { MeetingComponentServiceCollectorService } from 'src/app/site/pages/meetings/services/meeting-component-service-collector.service';
import { PromptService } from 'src/app/ui/modules/prompt-dialog';

import { InteractionService } from '../../../../../interaction/services/interaction.service';
import { ViewTag } from '../../../../modules';
import { TagControllerService } from '../../../../modules/tags/services';

Expand All @@ -25,6 +27,10 @@ export class TagListComponent extends BaseMeetingListViewComponent<ViewTag> impl
name: [``, [Validators.required]]
});

public get hasInteractionState(): Observable<boolean> {
return this.interactionService.isConfStateNone.pipe(map(isNone => !isNone));
}

/**
* Holds the tag that's currently being edited, or null.
*/
Expand All @@ -37,7 +43,8 @@ export class TagListComponent extends BaseMeetingListViewComponent<ViewTag> impl
private dialog: MatDialog,
private formBuilder: UntypedFormBuilder,
private promptService: PromptService,
private cd: ChangeDetectorRef
private cd: ChangeDetectorRef,
private interactionService: InteractionService
) {
super(componentServiceCollector, translate);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="filter-menu-content-wrapper">
<div [ngClass]="{ 'filter-menu-content-wrapper': true, 'spacer-bottom-60': showSpacer }">
<mat-accordion (keyup)="checkKeyEvent($event)">
<mat-expansion-panel *ngFor="let filter of service.filterDefinitionsObservable | async">
<mat-expansion-panel-header *ngIf="filter && filter.options && filter.options.length">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export class FilterMenuComponent<V extends Identifiable> implements OnInit {
@Input()
public service!: FilterListService<V>;

@Input()
public showSpacer = false;

public constructor(private cd: ChangeDetectorRef) {}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
*ngIf="filterService"
(dismissed)="this.filterMenu.close()"
[service]="filterService"
[showSpacer]="showSpacer"
></os-filter-menu>
</mat-drawer>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export class SortFilterBarComponent<V extends Identifiable> {
@Input()
public totalCount = 0;

@Input()
public showSpacer = false;

public get sortOptions(): OsSortOption<V>[] {
return this.sortService.sortOptions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[sortService]="sortService!"
[searchService]="searchService!"
[searchFieldInput]="searchFieldValue"
[showSpacer]="addBottomSpacer"
(searchFieldChanged)="searchFilterUpdated.emit($event)"
>
<div class="extra-info-slot">
Expand Down

0 comments on commit 633fc25

Please sign in to comment.