Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(draw): Management of the editing of individual element #1065

Merged
merged 52 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3003237
Merge branch 'DrawingGestionOnLabels' into DessinGestionDesEtiquettes
kalvinkhuu May 19, 2022
f3ccf8d
Progress in the selection of the element
kalvinkhuu May 19, 2022
0fae04b
Working selection of an element for font size and font style
kalvinkhuu May 20, 2022
2f0a228
TODO next week
kalvinkhuu May 20, 2022
02122ee
Selection per element for the color works
kalvinkhuu May 24, 2022
0dec3ad
Working features
kalvinkhuu May 25, 2022
085a073
Partially clean it up
kalvinkhuu May 26, 2022
01fd889
Implemented edition of the position of label
kalvinkhuu May 27, 2022
6db4149
Cleaned up the code
kalvinkhuu May 30, 2022
f9a5962
Merge branch 'next' into DessinApplicationStyleParElement
kalvinkhuu May 30, 2022
c079c7f
Added a CSS style for the edition of the draw
kalvinkhuu May 31, 2022
7ade988
removed unused code
kalvinkhuu May 31, 2022
6adec56
Initial scrollbar for the table
kalvinkhuu Jun 1, 2022
43d72d1
Progress in table
kalvinkhuu Jun 2, 2022
fe09fda
Update entity-table.component.html
kalvinkhuu Jun 2, 2022
ffdc771
formatted the html
kalvinkhuu Jun 2, 2022
cfb4114
format ts file
kalvinkhuu Jun 2, 2022
d9acd2f
Fixed some formatting issues
kalvinkhuu Jun 3, 2022
dda2f4e
Merge branch 'next' into DessinGestionDesEtiquettes
kalvinkhuu Jun 3, 2022
eb6b73b
Redid design of the inputs box
kalvinkhuu Jun 3, 2022
a1af2d3
Merge branch 'DessinGestionDesEtiquettes' into DessinPlusieurCouches
kalvinkhuu Jun 3, 2022
e5dec48
updated format
kalvinkhuu Jun 3, 2022
3494302
Merge branch 'DessinPlusieurCouches' into DessinApplicationStyleParEl…
kalvinkhuu Jun 3, 2022
c3b5475
edit the formatting
kalvinkhuu Jun 3, 2022
039262a
Update package-lock.json
kalvinkhuu Jun 3, 2022
7a21537
Implemented a possible solution
kalvinkhuu Jun 3, 2022
afaba6c
Dynamic table height
kalvinkhuu Jun 6, 2022
82c3325
Update to fit 6 elements of the table
kalvinkhuu Jun 7, 2022
d5ea256
Cleaned up the code
kalvinkhuu Jun 7, 2022
f6b738b
Reformatting
kalvinkhuu Jun 7, 2022
351aed8
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
kalvinkhuu Jun 8, 2022
06e4841
Merge branch 'next' into DessinApplicationStyleParElement
kalvinkhuu Jun 13, 2022
6585fb0
reformating
kalvinkhuu Jun 13, 2022
1acc629
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
kalvinkhuu Jun 15, 2022
57a6be4
reformatting
kalvinkhuu Jun 15, 2022
662b3b6
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
PhilippeLafreniere18 Jun 30, 2022
cbdf2c8
Requested changes
kalvinkhuu Jul 6, 2022
b077cf7
updateFrontend to getFeature
kalvinkhuu Jul 6, 2022
d0ed393
Merge branch 'DessinApplicationStyleParElement' of https://github.com…
PhilippeLafreniere18 Jul 8, 2022
1e2d2a5
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
PhilippeLafreniere18 Oct 17, 2022
2af3bdc
fix ol geometry type
PhilippeLafreniere18 Oct 17, 2022
b5a8d90
remove flashing from layer refresh
PhilippeLafreniere18 Oct 21, 2022
d13b2bf
fix(draw): fix font and offset flashing geom change
PhilippeLafreniere18 Oct 25, 2022
30ab724
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
PhilippeLafreniere18 Oct 25, 2022
92b5685
feat(draw): only display border color with linestring
PhilippeLafreniere18 Oct 25, 2022
b3dd6e9
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
PhilippeLafreniere18 Oct 27, 2022
86b7950
feat(layer): add reusable style modal component
PhilippeLafreniere18 Oct 28, 2022
0906ca4
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
PhilippeLafreniere18 Nov 2, 2022
a4681f7
fix/feat(draw): upgrade to color-picker 13 + icon and modal fix
PhilippeLafreniere18 Nov 2, 2022
46a48b2
i18n(draw): traduction change
PhilippeLafreniere18 Nov 2, 2022
40f58ae
Merge remote-tracking branch 'origin/next' into DessinApplicationStyl…
PhilippeLafreniere18 Nov 2, 2022
57b42ed
fix/feat(draw): deselect on init / css minor fix / add tooltip
PhilippeLafreniere18 Nov 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
810 changes: 405 additions & 405 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"jszip": "^3.10.1",
"jwt-decode": "^2.2.0",
"moment": "^2.29.4",
"ngx-color-picker": "^10.1.0",
"ngx-color-picker": "^13.0.0",
"ngx-indexed-db": "^11.0.2",
"ngx-toastr": "^15.0.0",
"nosleep.js": "^0.12.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="table-container">
<div class="table-container" [ngStyle]="{'height': tableHeight}">
<table mat-table matSort [ngClass]="getTableClass()" [dataSource]="dataSource" [trackBy]="getTrackByFunction()" (matSortChange)="onSort($event)">
<ng-container matColumnDef="selectionCheckbox" class="mat-cell-checkbox">
<th mat-header-cell *matHeaderCellDef>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export class EntityTableComponent implements OnInit, OnChanges, OnDestroy {
*/
get fixedHeader(): boolean { return this.template.fixedHeader === undefined ? true : this.template.fixedHeader; }

get tableHeight(): string { return this.template.tableHeight ? this.template.tableHeight : 'auto'; }

constructor(private cdRef: ChangeDetectorRef,
private formBuilder: UntypedFormBuilder,
protected _focusMonitor: FocusMonitor,
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/lib/entity/shared/entity.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface EntityTableTemplate {
selectMany?: boolean;
sort?: boolean;
fixedHeader?: boolean;
tableHeight?:string;
valueAccessor?: (entity: object, property: string, record: EntityRecord<object>) => any;
headerClassFunc?: () => {
[key: string]: boolean;
Expand Down
3 changes: 2 additions & 1 deletion packages/geo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"ol": "^7.1.0",
"proj4": "^2.8.0",
"rxjs": "^7.5.6",
"striptags": "^3.2.0"
"striptags": "^3.2.0",
"ngx-color-picker": "^13.0.0"
},
"optionalDependencies": {
"file-saver": "^2.0.2",
Expand Down
19 changes: 10 additions & 9 deletions packages/geo/src/lib/draw/draw/draw-popup.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<div mat-dialog-content>
<p class="mat-typography">
{{ 'igo.geo.draw.dialogInstruction' | translate }}
</p>
<p class="mat-typography">{{ 'igo.geo.draw.dialogInstruction' | translate }}</p>
<mat-form-field class="example-full-width">
<input
#input
matInput
placeholder="{{ 'igo.geo.draw.dialogTitle' | translate }}"
value="{{ data.currentLabel }}"/>
placeholder="{{'igo.geo.draw.dialogTitle' | translate}}"
value="{{data.currentLabel}}"/>
</mat-form-field>
</div>
<div mat-dialog-actions>
<button mat-raised-button (click)="cancelDrawing()">
{{ 'igo.geo.draw.cancel' | translate }}
<button
mat-raised-button
(click)="cancelDrawing()">{{'igo.geo.draw.cancel' | translate}}
</button>
<button mat-raised-button color="primary" (click)="confirm(input.value)">
OK
<button
mat-raised-button
color="primary"
(click)="confirm(input.value)">OK
</button>
</div>
10 changes: 3 additions & 7 deletions packages/geo/src/lib/draw/draw/draw-popup.component.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
import { Component, Inject, Input } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';

export interface DialogData {
label: string;
}

@Component({
selector: 'igo-draw-popup-component',
templateUrl: './draw-popup.component.html',
styleUrls: ['./draw-popup.component.scss']
})
})
export class DrawPopupComponent {
@Input() confirmFlag: boolean = false;

constructor(
public dialogRef: MatDialogRef<DrawPopupComponent>,
@Inject(MAT_DIALOG_DATA) public data: { currentLabel: string }
) {}
@Inject(MAT_DIALOG_DATA) public data: { currentLabel: string }){}

cancelDrawing() {
this.dialogRef.close();
}

confirm(labelString: string) {
this.confirmFlag = true;
this.dialogRef.close(labelString);
Expand Down
202 changes: 57 additions & 145 deletions packages/geo/src/lib/draw/draw/draw.component.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<div>
<div class="geometry-type-toggle mat-typography">
<mat-button-toggle-group (change)="onGeometryTypeChange($event.value)" [value]="geometryType.Point">

<mat-button-toggle-group
(change)="onGeometryTypeChange($event.value)" [value]="geometryType.Point">
<mat-button-toggle [value]="geometryType.Point">
{{ 'igo.geo.draw.' + geometryType.Point | translate }}
{{'igo.geo.draw.' + geometryType.Point | translate}}
</mat-button-toggle>

<mat-button-toggle [value]="geometryType.LineString">
{{ 'igo.geo.draw.' + geometryType.LineString | translate }}
{{'igo.geo.draw.' + geometryType.LineString | translate}}
</mat-button-toggle>

<mat-button-toggle [value]="geometryType.Polygon">
{{ 'igo.geo.draw.' + geometryType.Polygon | translate }}
{{'igo.geo.draw.' + geometryType.Polygon | translate}}
</mat-button-toggle>

<mat-button-toggle [value]="geometryType.Circle">
{{ 'igo.geo.draw.' + geometryType.Circle | translate }}
{{'igo.geo.draw.' + geometryType.Circle | translate}}
</mat-button-toggle>
</mat-button-toggle-group>
</div>
Expand All @@ -26,148 +26,19 @@
[checked]="drawControlIsActive"
[labelPosition]="'before'"
(change)="onToggleDrawControl($event.checked)">
{{ 'igo.geo.spatialFilter.drawControl' | translate }}
{{'igo.geo.spatialFilter.drawControl' | translate}}
</mat-slide-toggle>

<mat-slide-toggle
[checked]="labelsAreShown"
[labelPosition]="'before'"
(change)="onToggleLabels()">
{{ 'igo.geo.draw.toggleMapTooltips' | translate }}
{{'igo.geo.draw.toggleMapTooltips' | translate}}
</mat-slide-toggle>
</div>

<form class="igo-form" [formGroup]="form">
<div class="fill-color-picker mat-typography">
<span>
<mat-icon class="stroke-palette-icon" svgIcon="square"></mat-icon>
{{ 'igo.geo.draw.fill' | translate }}
</span>

<mat-form-field
class="fill-field"
appearance="outline"
floatLabel="always"
tooltip-position="below"
matTooltipShowDelay="500"
[matTooltip]="'igo.geo.draw.colorPicker' | translate">
<mat-label>{{ fillColor }}</mat-label>

<input
formControlName="fill"
matInput
type="text"
[(colorPicker)]="fillColor"
[style.background]="fillColor"
[readonly]="true"
[colorPicker]="fillColor"
[cpWidth]="'200px'"
[cpOutputFormat]="'rgba'"
[cpPosition]="'bottom'"
[cpPositionOffset]="'-75%'"
[cpCancelButton]="true"
[cpCancelButtonText]="'igo.geo.draw.cancel' | translate"
[cpOKButton]="true"
(colorPickerChange)="onColorChange(labelsAreShown, false)"/>
</mat-form-field>
</div>

<div class="stroke-color-picker mat-typography">
<span>
<mat-icon class="stroke-palette-icon" svgIcon="square-outline"></mat-icon>
{{ 'igo.geo.draw.stroke' | translate }}
</span>

<mat-form-field
class="stroke-field"
appearance="outline"
floatLabel="always"
tooltip-position="below"
matTooltipShowDelay="500"
[matTooltip]="'igo.geo.draw.colorPicker' | translate">
<mat-label>{{ strokeColor }}</mat-label>
<input
formControlName="stroke"
matInput
type="text"
[(colorPicker)]="strokeColor"
[style.background]="strokeColor"
[readonly]="true"
[colorPicker]="strokeColor"
[cpWidth]="'200px'"
[cpPosition]="'bottom'"
[cpPositionOffset]="'-75%'"
[cpOutputFormat]="'rgba'"
[cpCancelButton]="true"
[cpCancelButtonText]="'igo.geo.draw.cancel' | translate"
[cpOKButton]="true"
(colorPickerChange)="onColorChange(labelsAreShown, false)">
</mat-form-field>
</div>

<div>
<mat-form-field *ngIf="icons.length >= 1">
<mat-label>{{ 'igo.geo.draw.icon' | translate }}</mat-label>
<mat-select>
<mat-select-trigger>
<div *ngIf="icon" class="box">
<img src="{{ icon }}">
</div>
</mat-select-trigger>
<mat-option value="" (click)="onIconChange()">{{ 'igo.geo.draw.noIcon' | translate }}</mat-option>
<mat-option
*ngFor="let icon_html of icons"
[value]="icon_html"
(click)="onIconChange(icon_html)">
<div class="box">
<img src="{{ icon_html }}">
</div>
</mat-option>
</mat-select>
</mat-form-field>
</div>
</form>


<div class="igo-form-font">
<mat-form-field appearance="outline" class="igo-form-fontSize">
<mat-label>{{ 'igo.geo.draw.fontSize' | translate }}</mat-label>
<input
matInput
#testFontSize
type="number"
placeholder="10"
min="10"
onkeydown="return event.keyCode !== 69"
[value]="fontSize"
(input)="
onFontChange(
labelsAreShown,
$event.target.value,
testFontStyle.value
)"
/>
<span matSuffix>px</span>
</mat-form-field>
<mat-form-field appearance="outline" class="igo-form-fontStyle">
<mat-label>{{ 'igo.geo.draw.fontStyle' | translate }}</mat-label>
<mat-select
#testFontStyle
[value]="fontStyle"
(selectionChange)="onFontChange(labelsAreShown, testFontSize.value, $event.value)">
<mat-option
*ngFor="let fontSelect of allFontStyles"
[value]="fontSelect">
{{ fontSelect }}
</mat-option>
</mat-select>
</mat-form-field>
</div>

<mat-divider></mat-divider>
<div>
<button
*ngIf="store.count$.getValue() > 0"
<button *ngIf="store.count$.getValue() > 0"
class="deleteBtn"
mat-icon-button
color="warn"
Expand All @@ -179,15 +50,56 @@
<mat-icon svgIcon="delete"></mat-icon>
</button>

<igo-entity-table
#table
class="table-compact"
[store]="store"
[template]="tableTemplate"
(dblclick)="editLabelDrawing()">
</igo-entity-table>
<div>
<igo-entity-table
#table
class="table-compact"
id="storeElements"
[store]="store"
[template]="tableTemplate"
(dblclick)="editLabelDrawing()">
</igo-entity-table>
</div>
</div>

<div class="icon-options">
<mat-form-field *ngIf="icons.length >= 1">
<mat-label>{{ 'igo.geo.draw.icon' | translate }}</mat-label>
<mat-select>
<mat-select-trigger>
<div *ngIf="icon" class="box">
<img src="{{ icon }}">
</div>
</mat-select-trigger>
<mat-option value="" (click)="onIconChange()">{{ 'igo.geo.draw.noIcon' | translate }}</mat-option>
<mat-option
*ngFor="let icon_html of icons"
[value]="icon_html"
(click)="onIconChange(icon_html)">
<div class="box">
<img src="{{ icon_html }}">
</div>
</mat-option>
</mat-select>
</mat-form-field>
</div>

<button
*ngIf="selectedFeatures$.value.length"
mat-raised-button
color="primary"
(click)="openStyleModalDialog()"
[matTooltip]="'igo.geo.layer.style.styleModalTooltip' | translate">
{{'igo.geo.layer.style.styleModal' | translate}}
<mat-icon
class="style-icon"
svgIcon="palette"
[matBadge]="selectedFeatures$.value.length"
matBadgeColor="warn"
matBadgeSize="medium">
</mat-icon>
</button>

<button
mat-icon-button
color="accent"
Expand Down
Loading