Compare commits

...

10 Commits

Author SHA1 Message Date
719c699981 Merge branch 'feature/AW784_MergeFarmMapsMap_FarmMapsLibMap' into develop
Some checks failed
FarmMaps.Develop/FarmMapsLib/develop There was a failure building this commit
2019-12-20 09:59:04 +01:00
456628d014 AW-784 Reapply from Farmmaps commits
- cd035366: AW-718 Layout as requested by Thomas.
2019-12-20 09:53:22 +01:00
76a44a8f95 AW-784 Reapply from Farmmaps commits
- cd035366: AW-718 Layout as requested by Thomas.
2019-12-20 09:50:21 +01:00
f66428d04c AW-784 Reapply from Farmmaps commits
- cd035366: AW-718 Layout as requested by Thomas.
2019-12-20 09:47:33 +01:00
ee925d07b4 AW-784 Reapply from Farmmaps commits
- 47deb5f6: AW-772 Panels
2019-12-20 09:41:06 +01:00
9b03b49028 AW-784 Reapply from Farmmaps commits
- 47deb5f6: AW-772 Panels
2019-12-20 09:39:29 +01:00
15c224ff5d AW-784 Reapply from Farmmaps commits
- 5d11bfe8: Enable histogram for shape
2019-12-20 09:36:55 +01:00
7cb129dbc4 AW-784 Reapply from Farmmaps commits
- cd035366: AW-718 Layout as requested by Thomas.
2019-12-20 09:25:09 +01:00
2059b48abb AW-784 Reapply from Farmmaps commits
- a4bb051a: AW-738 fixed bug
2019-12-20 09:19:53 +01:00
e1ff44ed3c AW-784 Reapply from Farmmaps commits
- 6f79b625: AW-738 changed selected-item-container to allow forSourceTask annotation.
2019-12-20 09:18:00 +01:00
6 changed files with 72 additions and 28 deletions

View File

@ -19,12 +19,22 @@ export class SelectedItemContainerComponent {
@ViewChild(WidgetHostDirective, { static: true }) widgetHost: WidgetHostDirective;
loadComponent() {
var componentFactory: ComponentFactory<AbstractSelectedItemComponent> = this.componentFactoryResolver.resolveComponentFactory(SelectedItemComponent); // default
for (var i = 0; i < this.selectedItemComponents.length; i++) {
if (this.selectedItemComponents[i]['forItemType'] == this.item.itemType) {
componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.selectedItemComponents[i]['constructor'] as any);
let componentFactory: ComponentFactory<AbstractSelectedItemComponent> = this.componentFactoryResolver.resolveComponentFactory(SelectedItemComponent); // default
let firstComponentWithTypeAndTask = this.selectedItemComponents
.find(value => value['forSourceTask'] == this.item.sourceTask &&
value['forItemType'] == this.item.itemType
);
if (firstComponentWithTypeAndTask) {
componentFactory = this.componentFactoryResolver.resolveComponentFactory(firstComponentWithTypeAndTask['constructor'] as any);
} else {
let firstComponentWithType = this.selectedItemComponents
.find(value => value['forItemType'] == this.item.itemType);
if (firstComponentWithType) {
componentFactory = this.componentFactoryResolver.resolveComponentFactory(firstComponentWithType['constructor'] as any);
}
}
}
const viewContainerRef = this.widgetHost.viewContainerRef;
viewContainerRef.clear();

View File

@ -3,11 +3,15 @@
<div class="card border-0">
<div class="card-body">
<div><a href="#" (click)="handleBackToList($event)" i18n>Back</a></div>
<h4>Cropfield</h4>
<h1>{{item.name}}</h1>
<div>{{item.data.cropTypeName}}</div>
<div><span>{{item.data.startDate|date}}</span> - <span>{{item.data.endDate|date}}</span> </div>
<div class="mt-1"><a href="#" (click)="handleOnEdit(item)" i18n><i class="fa fa-pencil" aria-hidden="true" title="Edit"></i> Edit</a></div>
<div class="card menu-card">
<h1>Cropfield</h1>
<h4>{{item.name}}</h4>
<div>{{item.data.cropTypeName}}</div>
<div><span>{{item.data.startDate|date}}</span> - <span>{{item.data.endDate|date}}</span> </div>
<ul class="p-0 mt-2">
<li><a href="#" (click)="handleOnEdit(item)" i18n><i class="fa fa-pencil" aria-hidden="true" title="Edit"></i> Edit</a></li>
</ul>
</div>
</div>
<fm-map-item-list [items]="(items|async)"></fm-map-item-list>
<fm-map-item-widget-list [item]="item"></fm-map-item-widget-list>

View File

@ -1,5 +1,7 @@
@import "../../_theme.scss";
@import "~bootstrap/scss/bootstrap.scss";
@import "../../../app/theme.scss";
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins";
.big-icon {
width: 100%;
@ -13,6 +15,10 @@
font-size: 1rem;
}
.card-body {
padding-bottom: unset;
}
.spacer {
display: none;
height: 4rem;
@ -23,3 +29,11 @@
display: block;
}
}
.menu-card {
margin-left: -7px;
padding-left: 7px;
margin-right: -7px;
padding-right: 7px;
margin-bottom: 7px;
}

View File

@ -3,20 +3,26 @@
<div class="card border-0">
<div class="card-body">
<div class="mb-2"><a href="#" (click)="handleBackToList($event)" i18n>Back</a></div>
<h1>{{item.name}}</h1>
<div class="legend-container" *ngIf="item?.data.layers;let layers">
<div *ngIf="layers.length>1">
<select (change)="onLayerChanged($event.target.value)">
<option *ngFor="let l of layers;" [value]="l.index">{{l.name}}</option>
</select>
</div>
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layers[selectedLayer]" [histogramenabled]="false" histogramunit="ha"></fm-map-layer-legend>
<div class="card menu-card">
<h1>{{item.name}}</h1>
</div>
<ul class="p-0 mt-2">
<!--<li><a href="/api/v1/items/{{item.code}}/file" class="mt-1 mr-1" i18n><i class="fa fa-download" aria-hidden="true" title="Download"></i> Download</a></li>-->
<li><a href="#" class="mt-1 mr-1" (click)="handleOnEdit(item)" i18n><i class="fa fa-pencil" aria-hidden="true" title="Edit"></i> Edit</a></li>
<li *ngIf="itemTypeService.isLayer(item)"><a href="#" (click)="handleAddAsLayer(item,selectedLayer)" class="mt-1 mr-1" i18n><i class="fa fa-eye" aria-hidden="true" title="Add as layer"></i> Add as overlay</a></li>
</ul>
</div>
<div class="legend-container" *ngIf="item?.data.layers;let layers">
<div class="card menu-card">
<div *ngIf="layers.length>1">
<select (change)="onLayerChanged($event.target.value)">
<option *ngFor="let l of layers;" [value]="l.index">{{l.name}}</option>
</select>
</div>
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layers[selectedLayer]" [histogramenabled]="true"></fm-map-layer-legend>
</div>
</div>
<div class="card menu-card">
<ul class="p-0 mt-2">
<!--<li><a href="/api/v1/items/{{item.code}}/file" class="mt-1 mr-1" i18n><i class="fa fa-download" aria-hidden="true" title="Download"></i> Download</a></li>-->
<li><a href="#" class="mt-1 mr-1" (click)="handleOnEdit(item)" i18n><i class="fa fa-pencil" aria-hidden="true" title="Edit"></i> Edit</a></li>
<li *ngIf="itemTypeService.isLayer(item)"><a href="#" (click)="handleAddAsLayer(item,selectedLayer)" class="mt-1 mr-1" i18n><i class="fa fa-eye" aria-hidden="true" title="Add as layer"></i> Add as overlay</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>

View File

@ -39,3 +39,11 @@ li {
display: block;
}
}
.menu-card {
margin-left: -7px;
padding-left: 7px;
margin-right: -7px;
padding-right: 7px;
margin-bottom: 7px;
}

View File

@ -4,6 +4,8 @@
<div *ngIf="!item.thumbnail" class="big-icon" [style.background-color]="itemTypeService.getColor(item.itemType)">
<i [ngClass]="itemTypeService.getIcon(item.itemType)"></i>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="mb-2"><a href="#" (click)="handleBackToList($event)" i18n>Back</a></div>
<h1 class="card-title">{{item.name}}</h1>
@ -13,4 +15,4 @@
<a *ngIf="itemTypeService.isLayer(item)" href="#" (click)="handleAddAsLayer(item)" class="btn btn-outline-secondary" i18n><i class="fa fa-eye" aria-hidden="true" title="Add as layer"></i> Add as overlay</a>
</div>
</div>
</div>
</div>