Skip to content

Commit

Permalink
Merge branch 'master' into 2.14.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tkleinke committed Nov 14, 2019
2 parents f4663fb + 370c9fd commit 01f8f2b
Show file tree
Hide file tree
Showing 13 changed files with 211 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export class ImageOverviewTaskbarComponent {
private imageOverviewFacade: ImageOverviewFacade,
private persistenceHelper: PersistenceHelper,
private imageOverviewComponent: ImageOverviewComponent
) {
this.imageOverviewFacade.initialize();
}
) {}


public onKeyDown(event: KeyboardEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {ImageOverviewFacade} from '../view/imageoverview-facade';
import {ProjectConfiguration} from '../../../core/configuration/project-configuration';
import {FieldDefinition} from '../../../core/configuration/model/field-definition';
import {DocumentReadDatastore} from '../../../core/datastore/document-read-datastore';
import {clone} from '../../../core/util/object-util';


@Component({
Expand Down Expand Up @@ -47,7 +48,7 @@ export class ImageOverviewSearchConstraintsComponent extends SearchConstraintsCo

protected getCustomConstraints(): { [name: string]: string } {

return this.imageOverviewFacade.getCustomConstraints();
return clone(this.imageOverviewFacade.getCustomConstraints());
}


Expand Down
5 changes: 5 additions & 0 deletions app/components/imageoverview/view/imageoverview-facade.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Injectable} from '@angular/core';
import {equal} from 'tsfun';
import {Query, ImageDocument} from 'idai-components-2';
import {ImagesState} from './images-state';
import {ImageDocumentsManager} from './image-documents-manager';
Expand Down Expand Up @@ -96,11 +97,13 @@ export class ImageOverviewFacade {


public getPageCount() {

return Math.ceil(this.getTotalDocumentCount() / this.getNrImagesPerPage());
}


public getCurrentPage() {

return this.currentOffset / this.getNrImagesPerPage() + 1;
}

Expand Down Expand Up @@ -141,6 +144,8 @@ export class ImageOverviewFacade {

public setCustomConstraints(customConstraints: { [name: string]: string }) {

if (equal(this.imagesState.getCustomConstraints())(customConstraints)) return;

this.currentOffset = 0;

this.imagesState.setCustomConstraints(customConstraints);
Expand Down
4 changes: 3 additions & 1 deletion app/components/matrix/matrix-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {DotBuilder} from './dot-builder';
import {MatrixSelection, MatrixSelectionMode} from './matrix-selection';
import {Edges, EdgesBuilder, GraphRelationsConfiguration} from './edges-builder';
import {TabManager} from '../tab-manager';
import {ProjectConfiguration} from '../../core/configuration/project-configuration';
import {POSITION_RELATIONS, TIME_RELATIONS} from '../../core/model/relation-constants';
import IS_CONTEMPORARY_WITH = TIME_RELATIONS.IS_CONTEMPORARY_WITH;
import IS_EQUIVALENT_TO = POSITION_RELATIONS.IS_EQUIVALENT_TO;
Expand All @@ -21,7 +22,6 @@ import IS_ABOVE = POSITION_RELATIONS.IS_ABOVE;
import IS_BELOW = POSITION_RELATIONS.IS_BELOW;
import IS_CUT_BY = POSITION_RELATIONS.IS_CUT_BY;
import CUTS = POSITION_RELATIONS.CUTS;
import {ProjectConfiguration} from '../../core/configuration/project-configuration';


@Component({
Expand Down Expand Up @@ -159,6 +159,8 @@ export class MatrixViewComponent implements OnInit {

private async populateTrenches(): Promise<void> {

if (!this.projectConfiguration.getTypesMap()['Trench']) return;

this.trenches = (await this.datastore.find({ types: ['Trench'] })).documents;
if (this.trenches.length === 0) return;

Expand Down
14 changes: 9 additions & 5 deletions app/components/resources/navigation/navigation-service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {Injectable} from '@angular/core';
import {Observable, Observer} from 'rxjs';
import {FieldDocument, Document} from 'idai-components-2';
import {RoutingService} from '../../routing-service';
import {ViewFacade} from '../view/view-facade';
import {ObserverUtil} from '../../../core/util/observer-util';
import {Observable, Observer} from 'rxjs';
import {TypeUtility} from '../../../core/model/type-utility';
import {ProjectConfiguration} from '../../../core/configuration/project-configuration';
import {RelationDefinition} from '../../../core/configuration/model/relation-definition';
Expand All @@ -12,7 +12,8 @@ import {IdaiType} from '../../../core/configuration/model/idai-type';

@Injectable()
/**
* This serves to centralize the behaviour of navigation buttons of both the sidebar as well as the full scale list.
* This serves to centralize the behaviour of navigation buttons of both the sidebar as well as the
* full scale list.
*
* @author Daniel de Oliveira
* @author Thomas Kleinke
Expand Down Expand Up @@ -98,8 +99,11 @@ export class NavigationService {
if (!document.resource.id) return false; // do not show as long as it is not saved
if (this.viewFacade.getBypassHierarchy()) return false;

return this.projectConfiguration.getTypesMap()['Operation'].children
.map((type: IdaiType) => type.name)
.includes(document.resource.type);
const operationType: IdaiType|undefined = this.projectConfiguration.getTypesMap()['Operation'];

return operationType !== undefined && operationType.children !== undefined
&& operationType.children
.map((type: IdaiType) => type.name)
.includes(document.resource.type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {ViewFacade} from '../view/view-facade';
import {FieldDefinition} from '../../../core/configuration/model/field-definition';
import {ProjectConfiguration} from '../../../core/configuration/project-configuration';
import {DocumentReadDatastore} from '../../../core/datastore/document-read-datastore';
import {clone} from '../../../core/util/object-util';


@Component({
Expand Down Expand Up @@ -58,7 +59,7 @@ export class ResourcesSearchConstraintsComponent extends SearchConstraintsCompon

protected getCustomConstraints(): { [name: string]: string } {

return this.viewFacade.getCustomConstraints();
return clone(this.viewFacade.getCustomConstraints());
}


Expand Down
5 changes: 2 additions & 3 deletions app/core/settings/settings-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ export class SettingsService {
if (this.getSelectedProject().startsWith('monte-turcisi')) customProjectName = 'MonTur';
if (this.getSelectedProject().startsWith('al-ula')) customProjectName = 'AlUla';
if (this.getSelectedProject().startsWith('kalapodi')) customProjectName = 'Kalapodi';
if (this.getSelectedProject().startsWith('sudan-digital')) customProjectName = 'Sudan';

if (this.getSelectedProject().startsWith('sudan-heritage')) customProjectName = 'SudanHeritage';

try {
return await this.appConfigurator.go(
Expand Down Expand Up @@ -314,4 +313,4 @@ export class SettingsService {
modified: [{ user: username, date: new Date() }]
};
}
}
}
12 changes: 10 additions & 2 deletions app/widgets/search-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, EventEmitter, Input, Output, ViewChild, ElementRef} from '@angular/core';
import {Component, EventEmitter, Input, Output, ViewChild, ElementRef, OnChanges} from '@angular/core';
import {sameset} from 'tsfun';
import {TypeUtility} from '../core/model/type-utility';
import {IdaiType} from '../core/configuration/model/idai-type';
Expand All @@ -18,7 +18,7 @@ import {IdaiType} from '../core/configuration/model/idai-type';
* @author Thomas Kleinke
* @author Jan G. Wieners
*/
export class SearchBarComponent {
export class SearchBarComponent implements OnChanges {

@Input() filterOptions: Array<IdaiType> = [];
@Input() showFiltersMenu: boolean = true;
Expand All @@ -40,6 +40,14 @@ export class SearchBarComponent {
constructor(private typeUtility: TypeUtility) {}


ngOnChanges() {

if ((!this.types || this.types.length === 0) && this.filterOptions.length === 1) {
this.types = [this.filterOptions[0].name];
}
}


public isAllTypesOptionVisible = () => this.filterOptions && this.filterOptions.length > 1;


Expand Down
67 changes: 67 additions & 0 deletions config/Config-SudanHeritage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"Project:default": {
"hidden": [],
"fields": {}
},
"Place:default": {
"hidden": [
"buildingHistory",
"buildingResearchHistory",
"excavationHistory",
"findSituation",
"findspotClassification"
],
"typeFamily": "Place",
"description": {},
"createdBy": "",
"creationDate": "",
"color": "#5572A1",
"commons": [
"dating",
"description"
],
"valuelists": {
"siteClassification": "Place-siteClassification-SudanHeritage",
"periodSudanHeritage": "period-SudanHeritage"
},
"fields": {
"placeName": {
"inputType": "input"
},
"placeNameOriginalLanguage": {
"inputType": "input"
},
"periodSudanHeritage": {
"inputType": "checkboxes"
},
"researchHistory": {
"inputType": "text"
},
"modernIntervention": {
"inputType": "input"
},
"siteClassification": {
"inputType": "checkboxes"
},
"stateOfPreservation": {
"inputType": "text"
},
"conservationMeasures": {
"inputType": "text"
},
"objectCirculation": {
"inputType": "text"
},
"staffInCharge": {
"inputType": "text"
},
"securityMeasures": {
"inputType": "text"
}
}
},
"Image:default": {
"hidden": [],
"fields": {}
}
}
14 changes: 11 additions & 3 deletions config/Config-WES.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
},
"Find:default": {
"hidden": [],
"fields": {}
"fields": {},
"valuelists": {
"period": "periods-wes-1"
}
},
"Feature:default": {
"hidden": [],
Expand Down Expand Up @@ -135,7 +138,12 @@
"hidden": [],
"fields": {}
},
"Pottery:default": {
"Pottery:wes": {
"parent": "Find",
"typeFamily": "Pottery",
"description": {},
"createdBy": "Max Haibt",
"creationDate": "",
"fields": {
"vesselpart": {
"inputType": "checkboxes"
Expand Down Expand Up @@ -637,4 +645,4 @@
"classification": "Mollusk-classification-WES"
}
}
}
}
1 change: 1 addition & 0 deletions config/Language-SudanHeritage.de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
42 changes: 42 additions & 0 deletions config/Language-SudanHeritage.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"types": {
"Place": {
"label": "Heritage Site",
"fields": {
"placeName": {
"label": "Place name"
},
"placeNameOriginalLanguage": {
"label": "Place name in arabic"
},
"researchHistory": {
"label": "Research history"
},
"modernIntervention": {
"label": "Modern structures on the site"
},
"periodSudanHeritage": {
"label": "Periods observable on the site"
},
"siteClassification": {
"label": "General archaeological classification for the site"
},
"stateOfPreservation": {
"label": "Description of the state of preservation"
},
"conservationMeasures": {
"label": "Measures for conservation of the site"
},
"objectCirculation": {
"label": "Archaeological objects from this site in circulation"
},
"staffInCharge": {
"label": "Persons in charge of this site"
},
"securityMeasures": {
"label": "Measures for securing the site"
}
}
}
}
}
Loading

0 comments on commit 01f8f2b

Please sign in to comment.