Skip to content

Commit

Permalink
Web split (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw authored Sep 12, 2024
1 parent 93c9300 commit 24e3515
Show file tree
Hide file tree
Showing 889 changed files with 316,762 additions and 6,425 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test.web-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: pack
run: |
npm pack ./web-app/dist/core-lib
npm pack ./web-app/dist/app
npm pack ./web-app/dist
- name: upload packages
uses: actions/upload-artifact@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions service/src/app.impl/systemInfo/app.impl.systemInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ export function CreateReadSystemInfo(
const legacyUsers = Users as any;
const userCount = await new Promise(resolve => {
legacyUsers.count({}, (err:any, count:any) => {
resolve(count)
});
resolve(count)
});
});

// Initialize with base system info
let systemInfoResponse: ExoRedactedSystemInfo = {
version: versionInfo,
initial: userCount == 0,
disclaimer: (await settingsModule.getSetting('disclaimer')) || {},
contactInfo: (await settingsModule.getSetting('contactInfo')) || {}
initial: userCount == 0,
disclaimer: (await settingsModule.getSetting('disclaimer'))?.settings || {},
contactInfo: (await settingsModule.getSetting('contactinfo'))?.settings || {}
};

// Add environment details for authenticated users with permission
Expand Down
3 changes: 2 additions & 1 deletion service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ async function initWebLayer(repos: Repositories, app: AppLayer, webUIPlugins: st
try {
const webappPackagePath = require.resolve('@ngageoint/mage.web-app/package.json')
const webappDir = path.dirname(webappPackagePath)
webController.use(express.static(webappDir))
webController.use(express.static(webappDir + '/app'))
webController.use('/admin', express.static(webappDir + '/admin'))
}
catch (err) {
console.warn('failed to load mage web app package', err)
Expand Down
17 changes: 17 additions & 0 deletions web-app/admin/src/@types/leaflet/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as L from 'leaflet';

declare module 'leaflet' {

export interface FixedWidthMarkerOptions extends L.MarkerOptions {
iconUrl?: string;
}

/**
* Creates a Fixed Width Marker.
*/
export function fixedWidthMarker(latlng: L.LatLngExpression, options?: FixedWidthMarkerOptions): L.Marker;

export class FixedWidthMarker extends Marker {
constructor(latlng: LatLngExpression, options?: FixedWidthMarkerOptions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TypeChoice } from './admin-create.model';
import { AdminBreadcrumb } from '../../admin-breadcrumb/admin-breadcrumb.model';
import { CdkStepper, STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { StateService } from '@uirouter/core';
import { AuthenticationConfigurationService } from 'src/app/upgrade/ajs-upgraded-providers';
import { AuthenticationConfigurationService } from '../../../../app/upgrade/ajs-upgraded-providers';
import { MatSnackBar } from '@angular/material/snack-bar';
import { Strategy } from '../../admin-authentication/admin-settings.model';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AfterViewInit, Component, Inject } from '@angular/core'
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Strategy } from '../../admin-authentication/admin-settings.model';
import { AuthenticationConfigurationService } from 'src/app/upgrade/ajs-upgraded-providers';
import { AuthenticationConfigurationService } from '../../../../app/upgrade/ajs-upgraded-providers';

@Component({
selector: 'admin-authentication-delete',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { MatInputModule } from '@angular/material/input'
import { By } from '@angular/platform-browser'
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import * as _ from 'lodash'
import { JsonSchemaModule } from 'src/app/json-schema/json-schema.module';
import { JsonSchemaModule } from '../../../../../../app/json-schema/json-schema.module';
import { AdminFeedEditItemPropertiesComponent, SchemaFormValue, SimpleJsonSchema, SimplePropertyJsonSchema } from './admin-feed-edit-item-properties.component';


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { StateService } from '@uirouter/angular';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { BehaviorSubject, of } from 'rxjs'
import { AdminBreadcrumbModule } from 'src/app/admin/admin-breadcrumb/admin-breadcrumb.module';
import { AdminBreadcrumbModule } from '../../../../../app/admin/admin-breadcrumb/admin-breadcrumb.module';
import { MageCommonModule } from '@ngageoint/mage.web-core-lib/common'
import { FeedItemSummaryComponent } from 'src/app/feed/feed-item/feed-item-summary/feed-item-summary.component';
import { FeedItemSummaryComponent } from '../../../../../app/feed/feed-item/feed-item-summary/feed-item-summary.component';
import { ServiceType, FeedService } from '@ngageoint/mage.web-core-lib/feed'
import { JsonSchemaWidgetAutocompleteComponent } from 'src/app/json-schema/json-schema-widget/json-schema-widget-autocomplete.component';
import { JsonSchemaModule } from 'src/app/json-schema/json-schema.module';
import { MomentModule } from 'src/app/moment/moment.module';
import { JsonSchemaWidgetAutocompleteComponent } from '../../../../../app/json-schema/json-schema-widget/json-schema-widget-autocomplete.component';
import { JsonSchemaModule } from '../../../../../app/json-schema/json-schema.module';
import { MomentModule } from '../../../../../app/moment/moment.module';
import { StaticIconModule } from '@ngageoint/mage.web-core-lib/static-icon'
import { AdminServiceEditComponent } from '../../admin-service/admin-service-edit/admin-service-edit.component';
import { AdminFeedEditConfigurationComponent } from './admin-feed-edit-configuration.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const emptyState: Readonly<FeedEditState> = Object.freeze({
preview: null,
})

const emptyPreview: Readonly<FeedPreview> = Object.freeze({
const emptyPreview: Readonly<FeedPreview> = {
content: {
feed: 'empty',
items: {
Expand All @@ -33,7 +33,7 @@ const emptyPreview: Readonly<FeedPreview> = Object.freeze({
service: 'empty',
topic: 'empty'
}
})
}

const services: Service[] = [
Object.freeze({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MatSelectModule } from '@angular/material/select'
import { MatSnackBarModule } from '@angular/material/snack-bar'
import { StateService } from '@uirouter/angular';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { Event, UserService } from 'src/app/upgrade/ajs-upgraded-providers';
import { Event, UserService } from '../../../../app/upgrade/ajs-upgraded-providers';
import { AdminBreadcrumbModule } from '../../admin-breadcrumb/admin-breadcrumb.module';
import { AdminFeedComponent } from './admin-feed.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/t
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { StateService } from '@uirouter/angular';
import { UserService } from 'src/app/upgrade/ajs-upgraded-providers';
import { UserService } from '../../../app/upgrade/ajs-upgraded-providers';
import { AdminFeedsComponent } from './admin-feeds.component';
import { AdminBreadcrumbModule } from '../admin-breadcrumb/admin-breadcrumb.module';
import { MatCardModule } from '@angular/material/card'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { UpgradeModule } from '@angular/upgrade/static';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { MomentModule } from 'src/app/moment/moment.module';
import { MomentModule } from '../../../app/moment/moment.module';
import { AdminBreadcrumbModule } from '../admin-breadcrumb/admin-breadcrumb.module';
import { AdminFeedsComponent } from './admin-feeds.component';
import { AdminFeedComponent } from './admin-feed/admin-feed.component';
import { AdminFeedDeleteComponent } from './admin-feed/admin-feed-delete/admin-feed-delete.component';
import { AdminFeedEditComponent } from './admin-feed/admin-feed-edit/admin-feed-edit.component';
import { JsonSchemaWidgetAutocompleteComponent } from 'src/app/json-schema/json-schema-widget/json-schema-widget-autocomplete.component';
import { JsonSchemaWidgetAutocompleteComponent } from '../../../app/json-schema/json-schema-widget/json-schema-widget-autocomplete.component';
import { AdminServiceEditComponent } from './admin-service/admin-service-edit/admin-service-edit.component';
import { AdminFeedEditItemPropertiesComponent } from './admin-feed/admin-feed-edit/admin-feed-edit-item-properties/admin-feed-edit-item-properties.component';
import { AdminFeedEditTopicComponent } from './admin-feed/admin-feed-edit/admin-feed-edit-topic/admin-feed-edit-topic.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { Service, ServiceType } from '@ngageoint/mage.web-core-lib/feed';
import { AdminServiceEditComponent } from './admin-service-edit.component';
import { JsonSchemaModule } from 'src/app/json-schema/json-schema.module'
import { JsonSchemaModule } from '../../../../../app/json-schema/json-schema.module'

describe('AdminServiceEditComponent', () => {
@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { RawParams, StateOrName, StateService, TransitionOptions, TransitionProm
import { of } from 'rxjs';
import { Observable } from 'rxjs/internal/Observable';
import { FeedExpanded, ServiceType } from '@ngageoint/mage.web-core-lib/feed/feed.model';
import { JsonSchemaModule } from 'src/app/json-schema/json-schema.module';
import { UserService } from 'src/app/upgrade/ajs-upgraded-providers';
import { JsonSchemaModule } from '../../../../app/json-schema/json-schema.module';
import { UserService } from '../../../../app/upgrade/ajs-upgraded-providers';
import { AdminBreadcrumbModule } from '../../admin-breadcrumb/admin-breadcrumb.module';
import { AdminServiceComponent } from './admin-service.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MatDialog } from '@angular/material/dialog';
import { StateService } from '@uirouter/angular';
import { forkJoin } from 'rxjs';
import { Feed, FeedExpanded, Service, ServiceType, FeedService } from '@ngageoint/mage.web-core-lib/feed';
import { UserService } from 'src/app/upgrade/ajs-upgraded-providers';
import { UserService } from '../../../../app/upgrade/ajs-upgraded-providers';
import _ from 'underscore';
import { AdminBreadcrumb } from '../../admin-breadcrumb/admin-breadcrumb.model';
import { AdminServiceDeleteComponent } from './admin-service-delete/admin-service-delete.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { AdminBreadcrumb } from '../admin-breadcrumb/admin-breadcrumb.model'
import { MapSettingsService } from 'src/app/map/settings/map.settings.service';
import { MapSettingsService } from '../../../app/map/settings/map.settings.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MapSettings } from 'src/app/entities/map/entities.map';
import { MapSettings } from '../../../app/entities/map/entities.map';

@Component({
selector: 'mage-admin-map',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { MatOptionModule, MatNativeDateModule } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { FormsModule } from '@angular/forms';
import { MatChipsModule } from '@angular/material/chips';
import { LocalStorageService, Settings, Team, Event, AuthenticationConfigurationService, UserService } from 'src/app/upgrade/ajs-upgraded-providers';
import { LocalStorageService, Settings, Team, Event, AuthenticationConfigurationService, UserService } from '../../../app/upgrade/ajs-upgraded-providers';
import { Subject, Observable } from 'rxjs';
import { StateService, TransitionService } from '@uirouter/core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { Settings } from "src/app/upgrade/ajs-upgraded-providers";
import { Settings } from "../../../../app/upgrade/ajs-upgraded-providers";
import { ContactInfoComponent } from "./contact-info.component";
import { HttpClientTestingModule } from '@angular/common/http/testing';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, EventEmitter, Inject, Input, OnChanges, OnInit, Output, SimpleChanges } from "@angular/core";
import { Settings } from "src/app/upgrade/ajs-upgraded-providers";
import { Settings } from "../../../../app/upgrade/ajs-upgraded-providers";

@Component({
selector: 'contact-info',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { Settings } from "src/app/upgrade/ajs-upgraded-providers";
import { Settings } from "../../../../app/upgrade/ajs-upgraded-providers";
import { SecurityBannerComponent } from "./security-banner.component";

class MockSettings {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit, Inject, Output, EventEmitter, ViewChild, Input, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
import { Banner } from './security-banner.model';
import { Settings } from 'src/app/upgrade/ajs-upgraded-providers';
import { ColorPickerComponent } from 'src/app/color-picker/color-picker.component';
import { Settings } from '../../../../app/upgrade/ajs-upgraded-providers';
import { ColorPickerComponent } from '../../../../app/color-picker/color-picker.component';
import { Subscription } from 'rxjs';

@Component({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { Settings } from "src/app/upgrade/ajs-upgraded-providers";
import { Settings } from "../../../../app/upgrade/ajs-upgraded-providers";
import { SecurityDisclaimerComponent } from "./security-disclaimer.component";

class MockSettings {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnInit, Inject, Output, EventEmitter, Input, OnChanges, SimpleChanges } from '@angular/core';
import { Disclaimer } from './security-disclaimer.model';
import { Settings } from 'src/app/upgrade/ajs-upgraded-providers';
import { Settings } from '../../../../app/upgrade/ajs-upgraded-providers';

@Component({
selector: 'security-disclaimer',
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions web-app/admin/src/app/api/api.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { HttpClient } from '@angular/common/http';
import { HttpTestingController, HttpClientTestingModule } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';
import { ApiService } from './api.service';

describe('API Service Tests', () => {
let httpClient: HttpClient;
let httpTestingController: HttpTestingController;

beforeEach(() => {
TestBed.configureTestingModule({
providers: [],
imports: [HttpClientTestingModule]
});

// Inject the http service and test controller for each test
httpClient = TestBed.inject(HttpClient);
httpTestingController = TestBed.inject(HttpTestingController);
});

afterEach(() => {
// After every test, assert that there are no more pending requests.
httpTestingController.verify();
});

it('should be created', () => {
const service: ApiService = TestBed.inject(ApiService);
expect(service).toBeTruthy();
});
});
14 changes: 14 additions & 0 deletions web-app/admin/src/app/api/api.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { HttpClient } from "@angular/common/http";
import { Injectable } from "@angular/core";
import { Observable } from "rxjs";

@Injectable({
providedIn: 'root'
})
export class ApiService {
constructor(private client: HttpClient) { }

getApi(): Observable<any> {
return this.client.get<any>('/api');
}
}
Loading

0 comments on commit 24e3515

Please sign in to comment.