Skip to content

Commit

Permalink
Merge pull request #26 from infra-geo-ouverte/master
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
drekss authored Nov 15, 2019
2 parents 776658c + cc89f47 commit dafec8a
Show file tree
Hide file tree
Showing 43 changed files with 2,643 additions and 1,698 deletions.
1,274 changes: 684 additions & 590 deletions CHANGELOG.md

Large diffs are not rendered by default.

13 changes: 1 addition & 12 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,10 @@
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "packages/integration/src/test.ts",
"tsConfig": "packages/integration/tsconfig.spec.json",
"karmaConfig": "packages/integration/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"packages/integration/tsconfig.lib.json",
"packages/integration/tsconfig.spec.json"
],
"tsConfig": ["packages/integration/tsconfig.lib.json"],
"exclude": ["**/node_modules/**"]
}
}
Expand Down
2,319 changes: 1,479 additions & 840 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo/demo",
"version": "1.0.0",
"version": "1.1.0",
"description": "IGO Library",
"author": "MSP",
"license": "MIT",
Expand Down Expand Up @@ -98,6 +98,7 @@
"moment": "^2.22.2",
"ngx-cacheable": "^1.0.9",
"ol": "^5.3.0",
"ol-mapbox-style": "^4.3.0",
"proj4": "^2.5.0",
"rxjs": "^6.4.0",
"scroll-into-view-if-needed": "^2.2.20",
Expand All @@ -107,8 +108,7 @@
"typy": "^2.0.1",
"unorm": "^1.4.1",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.29",
"ol-mapbox-style": "^4.3.0"
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.2",
Expand Down Expand Up @@ -150,6 +150,7 @@
"tslint": "^5.12.1",
"typescript": "~3.2.4",
"wait-on": "^3.2.0",
"webdriver-manager": "^12.1.6"
"webdriver-manager": "^12.1.6",
"webpack": "^4.41.2"
}
}
6 changes: 3 additions & 3 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/auth",
"version": "1.0.0",
"version": "1.1.0",
"description": "IGO Library",
"author": "MSP",
"keywords": ["igo"],
Expand All @@ -22,8 +22,8 @@
"@angular/core": "^7.2.6",
"@angular/forms": "^7.2.6",
"@angular/material": "^7.3.3",
"@igo2/core": "^1.0.0",
"@igo2/utils": "^1.0.0",
"@igo2/core": "^1.1.0",
"@igo2/utils": "^1.1.0",
"rxjs": "^6.4.0"
}
}
17 changes: 7 additions & 10 deletions packages/auth/src/lib/shared/auth.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import { TestBed, inject } from '@angular/core/testing';
import { HttpClientModule} from '@angular/common/http';
import { HttpClientModule } from '@angular/common/http';

import { IgoLanguageModule } from '@igo2/core';
import { IgoLanguageModule, IgoMessageModule } from '@igo2/core';

import { AuthService } from './auth.service';

describe('ShareMapService', () => {
describe('AuthService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientModule, IgoLanguageModule],
imports: [HttpClientModule, IgoLanguageModule, IgoMessageModule],
providers: [AuthService]
});
});

it(
'should ...',
inject([AuthService], (service: AuthService) => {
expect(service).toBeTruthy();
})
);
it('should ...', inject([AuthService], (service: AuthService) => {
expect(service).toBeTruthy();
}));
});
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/common",
"version": "1.0.0",
"version": "1.1.0",
"description": "IGO Library",
"author": "MSP",
"keywords": ["igo"],
Expand All @@ -17,8 +17,8 @@
"@angular/common": "^7.2.6",
"@angular/core": "^7.2.6",
"@angular/material": "^7.3.3",
"@igo2/core": "^1.0.0",
"@igo2/utils": "^1.0.0",
"@igo2/core": "^1.1.0",
"@igo2/utils": "^1.1.0",
"scroll-into-view-if-needed": "^2.2.20",
"typy": "^2.0.1"
}
Expand Down
39 changes: 39 additions & 0 deletions packages/common/src/lib/badge-icon/badge-icon.directive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Directive, Input, ElementRef, OnInit } from '@angular/core';
import { MatIconRegistry } from '@angular/material';

@Directive({
selector: '[igoMatBadgeIcon]'
})
export class MatBadgeIconDirective implements OnInit {
@Input()
set igoMatBadgeIcon(value: string) {
this.matIconRegistry
.getNamedSvgIcon(value)
.subscribe(svgObj => {
this.badge.innerHTML = '';
this.badge.appendChild(svgObj);
});
}

@Input()
set matBadgeHidden(value: boolean) {
this.badge.style.display = value
? 'none'
: 'flex';
}

get badge() {
return this.el.nativeElement.querySelector('.mat-badge-content');
}

constructor(
private el: ElementRef,
private matIconRegistry: MatIconRegistry
) {}

ngOnInit() {
this.badge.style.alignItems = 'center';
this.badge.style.justifyContent = 'center';
this.badge.style.background = 'none';
}
}
17 changes: 17 additions & 0 deletions packages/common/src/lib/badge-icon/badge-icon.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { MatBadgeIconDirective } from './badge-icon.directive';
import { MatBadgeModule, MatIconModule } from '@angular/material';

@NgModule({
imports: [MatBadgeModule, MatIconModule],
declarations: [MatBadgeIconDirective],
exports: [MatBadgeIconDirective]
})
export class IgoMatBadgeIconModule {
static forRoot() {
return {
ngModule: IgoMatBadgeIconModule,
providers: []
};
}
}
1 change: 1 addition & 0 deletions packages/common/src/lib/badge-icon/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './badge-icon.directive';
1 change: 1 addition & 0 deletions packages/common/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
export * from './lib/action/action.module';
export * from './lib/action/actionbar/actionbar.module';
export * from './lib/backdrop/backdrop.module';
export * from './lib/badge-icon/badge-icon.module';
export * from './lib/clickout/clickout.module';
export * from './lib/clone/clone.module';
export * from './lib/collapsible/collapsible.module';
Expand Down
12 changes: 6 additions & 6 deletions packages/context/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/context",
"version": "1.0.0",
"version": "1.1.0",
"description": "IGO Library",
"author": "MSP",
"keywords": ["igo"],
Expand All @@ -19,11 +19,11 @@
"@angular/core": "^7.2.6",
"@angular/forms": "^7.2.6",
"@angular/material": "^7.3.3",
"@igo2/auth": "^1.0.0",
"@igo2/common": "^1.0.0",
"@igo2/core": "^1.0.0",
"@igo2/utils": "^1.0.0",
"@igo2/geo": "^1.0.0",
"@igo2/auth": "^1.1.0",
"@igo2/common": "^1.1.0",
"@igo2/core": "^1.1.0",
"@igo2/utils": "^1.1.0",
"@igo2/geo": "^1.1.0",
"ol": "^5.3.0",
"rxjs": "^6.4.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/core",
"version": "1.0.0",
"version": "1.1.0",
"description": "IGO Library",
"author": "MSP",
"keywords": ["igo"],
Expand All @@ -21,7 +21,7 @@
"@angular/common": "^7.2.6",
"@angular/core": "^7.2.6",
"@angular/cdk": "^7.3.3",
"@igo2/utils": "^1.0.0",
"@igo2/utils": "^1.1.0",
"rxjs": "^6.4.0"
}
}
2 changes: 1 addition & 1 deletion packages/core/src/lib/config/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export interface Version {
}

export const version: Version = {
lib: '1.0.0'
lib: '1.1.0'
};
10 changes: 5 additions & 5 deletions packages/geo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/geo",
"version": "1.0.0",
"version": "1.1.0",
"description": "IGO Library",
"author": "MSP",
"keywords": ["igo"],
Expand All @@ -24,9 +24,9 @@
"@angular/core": "^7.2.6",
"@angular/forms": "^7.2.6",
"@angular/material": "^7.3.3",
"@igo2/common": "^1.0.0",
"@igo2/core": "^1.0.0",
"@igo2/utils": "^1.0.0",
"@igo2/common": "^1.1.0",
"@igo2/core": "^1.1.0",
"@igo2/utils": "^1.1.0",
"ol": "^5.3.0",
"proj4": "^2.5.0",
"rxjs": "^6.4.0",
Expand All @@ -41,4 +41,4 @@
"moment": "^2.24.0",
"stream": "^0.0.2"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
(toggle)="onToggleCollapsed($event)">
</mat-icon>

<h4 matLine>{{title}}</h4>

<ng-container *ngIf="added$ | async; else notadded">
<h4 class="igo-catalog-group-title" mat-line matTooltipShowDelay="500" [matTooltip]="title" (click)="onTitleClick()">{{title}}</h4>
<ng-container *ngIf="(added$ | async) && !(preview$ | async); else notadded">
<button
mat-icon-button
tooltip-position="below"
Expand Down Expand Up @@ -44,7 +43,9 @@ <h4 matLine>{{title}}</h4>
<igo-catalog-browser-layer
igoListItem
[layer]="item"
[resolution]="resolution"
[added]="state.get(item).added"
(addedLayerIsPreview)="onLayerPreview($event)"
(addedChange)="onLayerAddedChange($event)">
</igo-catalog-browser-layer>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.igo-catalog-group-title {
cursor: pointer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
@Component({
selector: 'igo-catalog-browser-group',
templateUrl: './catalog-browser-group.component.html',
styleUrls: ['./catalog-browser-group.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CatalogBrowserGroupComponent implements OnInit, OnDestroy {
Expand All @@ -42,7 +43,7 @@ export class CatalogBrowserGroupComponent implements OnInit, OnDestroy {
* @internal
*/
added$: BehaviorSubject<boolean> = new BehaviorSubject(false);

preview$: BehaviorSubject<boolean> = new BehaviorSubject(false);
/**
* Whether the toggle button is disabled
* @internal
Expand All @@ -64,6 +65,8 @@ export class CatalogBrowserGroupComponent implements OnInit, OnDestroy {
*/
@Input() collapsed: boolean = true;

@Input() resolution: number;

/**
* Whether the group can be toggled when it's collapsed
*/
Expand Down Expand Up @@ -184,6 +187,10 @@ export class CatalogBrowserGroupComponent implements OnInit, OnDestroy {
});
}

onLayerPreview(event) {
this.preview$.next(event);
}

/**
* If all the layers of the group added or removed, add or remove the group itself.
* @param event The last layer added change event to occur
Expand Down Expand Up @@ -218,4 +225,8 @@ export class CatalogBrowserGroupComponent implements OnInit, OnDestroy {
}
this.disabled$.next(disabled);
}

onTitleClick() {
this.collapsed = !this.collapsed;
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
<mat-list-item>
<mat-icon mat-list-avatar svgIcon="blank"></mat-icon>
<h4 mat-line>{{title}}</h4>
<h4 mat-line matTooltipShowDelay="500" [matTooltip]="title">{{title}}</h4>

<igo-metadata-button [layer]="layer"></igo-metadata-button>

<button
(mouseenter)="onMouseEvent($event)" (mouseleave)="onMouseEvent($event)"
mat-icon-button
tooltip-position="below"
matTooltipShowDelay="500"
[matTooltip]="(added ? 'igo.geo.catalog.layer.removeFromMap' : 'igo.geo.catalog.layer.addToMap') | translate"
[color]="added ? 'warn' : ''"
(click)="onToggleClick()">
<mat-icon [svgIcon]="added ? 'delete' : 'plus'"></mat-icon>
[matTooltip]="computeTooltip() | translate"
[color]="(isPreview$ | async) ? '' : added ? 'warn' : ''"
(click)="onToggleClick($event)">
<mat-icon
matBadge
igoMatBadgeIcon="eye-off"
[matBadgeHidden]="isInResolutionsRange()"
matBadgeColor="accent"
matBadgeSize="small"
matBadgePosition="after"
[svgIcon]="(isPreview$ | async) ? 'plus' : added ? 'delete' : 'plus'">
</mat-icon>
</button>

</mat-list-item>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.mat-badge-small .mat-badge-content {
color: rgba(0, 0, 0, 0.38);
}

Loading

0 comments on commit dafec8a

Please sign in to comment.