Compare commits

...

3 Commits

9 changed files with 770 additions and 553 deletions

1257
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -66,11 +66,11 @@
"@types/arcgis-rest-api": "^10.4.5", "@types/arcgis-rest-api": "^10.4.5",
"@types/jasmine": "~2.8.8", "@types/jasmine": "~2.8.8",
"@types/jasminewd2": "^2.0.9", "@types/jasminewd2": "^2.0.9",
"@types/node": "^12.20.15", "@types/node": "^18.11.6",
"@typescript-eslint/eslint-plugin": "^6.18.0", "@typescript-eslint/eslint-plugin": "^6.18.0",
"@typescript-eslint/eslint-plugin-tslint": "^6.18.0", "@typescript-eslint/eslint-plugin-tslint": "^6.18.0",
"@typescript-eslint/parser": "^6.18.0", "@typescript-eslint/parser": "^6.18.0",
"codelyzer": "^0.0.28", "codelyzer": "^6.0.2",
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.27.5",

View File

@ -9,7 +9,7 @@ import { ActionReducer, MetaReducer, StoreModule } from '@ngrx/store';
import { AngularOpenlayersModule } from 'ng-openlayers'; import { AngularOpenlayersModule } from 'ng-openlayers';
//common modules //common modules
import { AppCommonModule, ItemService, ItemTypeService, FolderService } from '@farmmaps/common'; import { AppCommonModule } from '@farmmaps/common';
import * as mapActions from './actions/map.actions'; import * as mapActions from './actions/map.actions';
import * as mapEffects from './effects/map.effects'; import * as mapEffects from './effects/map.effects';
@ -212,9 +212,6 @@ export {
GeolocationService, GeolocationService,
DeviceOrientationService, DeviceOrientationService,
TemporalService, TemporalService,
ItemTypeService,
ItemService,
FolderService,
{ provide: AbstractFeatureListComponent, useClass: FeatureListCroppingschemeComponent, multi: true }, { provide: AbstractFeatureListComponent, useClass: FeatureListCroppingschemeComponent, multi: true },
{ provide: AbstractFeatureListComponent, useClass: FeatureListCropfieldComponent, multi: true }, { provide: AbstractFeatureListComponent, useClass: FeatureListCropfieldComponent, multi: true },
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureComponent, multi: true }, { provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureComponent, multi: true },

View File

@ -23,7 +23,7 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen
public items: Observable<IListItem[]>; public items: Observable<IListItem[]>;
constructor(store: Store<mapReducers.State | commonReducers.State>, @Inject('itemTypeService') itemTypeService: ItemTypeService, location: Location, router: Router, @Inject('itemService$') private itemService$: ItemService,@Inject('folderService$') private folderService$: FolderService) { constructor(store: Store<mapReducers.State | commonReducers.State>, @Inject('itemTypeService') itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService, private folderService$: FolderService) {
super(store, itemTypeService,location,router); super(store, itemTypeService,location,router);
} }

View File

@ -15,37 +15,37 @@ export class ItemTypeService {
getIcon(itemType: string) { getIcon(itemType: string) {
let icon = "fal fa-file"; let icon = "fal fa-file";
if (this.itemTypes[itemType]) icon = this.itemTypes[itemType].icon; if (this.itemTypes && this.itemTypes[itemType]) icon = this.itemTypes[itemType].icon;
return icon; return icon;
} }
getColor(itemType: string) { getColor(itemType: string) {
let color = "#000000"; let color = "#000000";
if (this.itemTypes[itemType]) color = this.itemTypes[itemType].iconColor; if (this.itemTypes && this.itemTypes[itemType]) color = this.itemTypes[itemType].iconColor;
return color; return color;
} }
getExtraAttributes(itemType: string) { getExtraAttributes(itemType: string) {
let extraAttributes = null; let extraAttributes = null;
if (this.itemTypes[itemType] && this.itemTypes[itemType].extraAttributes) extraAttributes = this.itemTypes[itemType].extraAttributes; if (this.itemTypes && this.itemTypes[itemType] && this.itemTypes[itemType].extraAttributes) extraAttributes = this.itemTypes[itemType].extraAttributes;
return extraAttributes; return extraAttributes;
} }
getSchema(itemType: string): string { getSchema(itemType: string): string {
let schema = null; let schema = null;
if (this.itemTypes[itemType]) schema = this.itemTypes[itemType].schema; if (this.itemTypes && this.itemTypes[itemType]) schema = this.itemTypes[itemType].schema;
return schema; return schema;
} }
hasViewer(item: IItem) { hasViewer(item: IItem) {
const itemType: string = item.itemType; const itemType: string = item.itemType;
if (this.itemTypes[itemType]) return this.itemTypes[itemType].viewer !== undefined; if (this.itemTypes && this.itemTypes[itemType]) return this.itemTypes[itemType].viewer !== undefined;
return false; return false;
} }
hasEditor(item: IItem) { hasEditor(item: IItem) {
const itemType: string = item.itemType; const itemType: string = item.itemType;
if (this.itemTypes[itemType]) return this.itemTypes[itemType].editor !== undefined; if (this.itemTypes && this.itemTypes[itemType]) return this.itemTypes[itemType].editor !== undefined;
return false; return false;
} }

View File

@ -1,16 +1,16 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, UrlSegment, ExtraOptions } from '@angular/router'; import { RouterModule, UrlSegment } from '@angular/router';
import { AuthGuard, FullScreenGuard } from '@farmmaps/common'; import { AuthGuard, FullScreenGuard } from '@farmmaps/common';
//import { MapComponent } from '@farmmaps/common-map'; //import { MapComponent } from '@farmmaps/common-map';
//import { Switch2D3DComponent } from '@farmmaps/common-map3d'; //import { Switch2D3DComponent } from '@farmmaps/common-map3d';
import { NotImplementedComponent } from '@farmmaps/common';
import { NavBarGuard } from 'projects/common/src/public-api';
import { LandingpageComponent } from './landingpage/landingpage.component';
import { LogoComponent } from './logo/logo.component'; import { LogoComponent } from './logo/logo.component';
import { MenuComponent } from './menu/menu.component'; import { MenuComponent } from './menu/menu.component';
import { RegisterDeviceComponent } from './registerdevice/registerdevice.component'; import { RegisterDeviceComponent } from './registerdevice/registerdevice.component';
import { NotImplementedComponent } from '@farmmaps/common';
import { NavBarGuard } from 'projects/common/src/public-api';
import { TestComponent } from './test/test.component'; import { TestComponent } from './test/test.component';
import { LandingpageComponent } from './landingpage/landingpage.component';
export function urlMatcher(url: UrlSegment[]) { export function urlMatcher(url: UrlSegment[]) {
return { consumed: url }; return { consumed: url };

View File

@ -1,8 +1,9 @@
import { import {
NgModule,
Inject,
APP_BOOTSTRAP_LISTENER, APP_BOOTSTRAP_LISTENER,
InjectionToken, Type, Inject,
InjectionToken,
NgModule,
Type,
} from '@angular/core'; } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
@ -10,19 +11,17 @@ import { AppCommonModule,AppCommonServiceModule,AuthConfigFactory,FM_COMMON_STAR
import { AppRootComponent } from './app.component'; import { AppRootComponent } from './app.component';
import {StoreModule, ActionReducer,MetaReducer} from '@ngrx/store'; import { EffectSources, EffectsModule } from '@ngrx/effects';
import {EffectsModule, EffectSources} from '@ngrx/effects';
import { StoreRouterConnectingModule, routerReducer } from '@ngrx/router-store'; import { StoreRouterConnectingModule, routerReducer } from '@ngrx/router-store';
import { ActionReducer, MetaReducer, StoreModule } from '@ngrx/store';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { Id4AuthconfigFactory } from './id4AuthconfigFactory';
import { LandingpageComponent } from './landingpage/landingpage.component';
import { LogoComponent } from './logo/logo.component'; import { LogoComponent } from './logo/logo.component';
import { MenuComponent } from './menu/menu.component'; import { MenuComponent } from './menu/menu.component';
import { RegisterDeviceComponent } from './registerdevice/registerdevice.component'; import { RegisterDeviceComponent } from './registerdevice/registerdevice.component';
import { SecureOAuthStorage} from '@farmmaps/common';
import { OAuthStorage } from 'angular-oauth2-oidc';
import {Id4AuthconfigFactory} from './id4AuthconfigFactory';
import { TestComponent } from './test/test.component'; import { TestComponent } from './test/test.component';
import { LandingpageComponent } from './landingpage/landingpage.component';
export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects'); export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects');

View File

@ -1,6 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ItemService} from '@farmmaps/common';
import { Observable} from 'rxjs';
@Component({ @Component({
selector: 'app-test', selector: 'app-test',
@ -11,7 +9,7 @@ export class LandingpageComponent implements OnInit {
//public gradientItems:Observable<any[]> //public gradientItems:Observable<any[]>
constructor(private itemService$:ItemService) { constructor() {
} }
ngOnInit(): void { ngOnInit(): void {

View File

@ -20,7 +20,7 @@ export class TestComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
} }
onTest(Event) { onTest() {
const a = {"unread":"1"} const a = {"unread":"1"}
this.store$.dispatch(new commonActions.NotificationEvent(a)); this.store$.dispatch(new commonActions.NotificationEvent(a));
} }