Skip to content

Commit

Permalink
organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Jan 3, 2025
1 parent 9d6b618 commit 4a236ea
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
*
* @authors Christof Strack
*/
import { HttpStatusCode } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { AlertService, gettext } from '@c8y/ngx-components';
import { BsModalService } from 'ngx-bootstrap/modal';
import packageJson from '../../package.json';
import { ConnectorConfigurationService } from '../connector';
import { Feature, Operation, SharedService } from '../shared';
import { ServiceConfiguration } from './shared/configuration.model';
import { ConnectorConfigurationService } from '../connector';
import { HttpStatusCode } from '@angular/common/http';

@Component({
selector: 'd11r-mapping-service-configuration',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@

import { NgModule } from '@angular/core';
import { CoreModule, hookRoute } from '@c8y/ngx-components';
import { connectorResolver, SharedModule } from '../shared';
import { connectorResolver, SharedModule, ConnectorDetailsComponent } from '../shared';
import { ConnectorConfigurationComponent } from './connector-configuration.component';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { NODE3 } from '../shared/mapping/util';
import { ConnectorDetailsComponent } from '../shared/connector-details/connector-details.component';

@NgModule({
declarations: [ConnectorConfigurationComponent],
Expand Down
6 changes: 3 additions & 3 deletions dynamic-mapping-ui/src/extension/grid/extension.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

import { Component, OnDestroy, OnInit } from '@angular/core';
import { IManagedObject } from '@c8y/client';
import { AlertService } from '@c8y/ngx-components';
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { catchError, retry, shareReplay, switchMap, takeUntil, tap, timeout } from 'rxjs/operators';
import { ExtensionService } from '../extension.service';
import { AddExtensionComponent } from '../add/add-extension-modal.component';
import { AlertService } from '@c8y/ngx-components';
import { Feature, Operation, SharedService } from '../../shared';
import { AddExtensionComponent } from '../add/add-extension-modal.component';
import { ExtensionService } from '../extension.service';

interface ExtensionState {
reloading: boolean;
Expand Down
10 changes: 5 additions & 5 deletions dynamic-mapping-ui/src/extension/share/extension.model.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import { inject } from "@angular/core";
import { ResolveFn } from "@angular/router";
import { IManagedObject } from "@c8y/client";
import { ExtensionService } from "../extension.service";

/*
* Copyright (c) 2022 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA,
* and/or its subsidiaries and/or its affiliates and/or their licensors.
Expand All @@ -23,6 +18,11 @@ import { ExtensionService } from "../extension.service";
*
* @authors Christof Strack
*/
import { inject } from "@angular/core";
import { ResolveFn } from "@angular/router";
import { IManagedObject } from "@c8y/client";
import { ExtensionService } from "../extension.service";

export enum ERROR_TYPE {
TYPE_VALIDATION = 'TYPE_VALIDATION',
ALREADY_SUBSCRIBED = 'ALREADY_SUBSCRIBED',
Expand Down
3 changes: 1 addition & 2 deletions dynamic-mapping-ui/src/landing/landing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@

import { Component, OnInit, ViewChild } from '@angular/core';
import { MappingService } from '../mapping/core/mapping.service';
import { Direction, JsonEditorComponent } from '../shared';
import { Direction, JsonEditorComponent, NODE1, NODE3 } from '../shared';
import { BehaviorSubject, from, Subject } from 'rxjs';
import { ConnectorConfigurationService } from '../connector';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { NODE1, NODE3 } from '../shared/mapping/util';

@Component({
selector: 'd11r-landing',
Expand Down
4 changes: 2 additions & 2 deletions dynamic-mapping-ui/src/landing/landing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
*/

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CoreModule, hookRoute } from '@c8y/ngx-components';
import { CollapseModule } from 'ngx-bootstrap/collapse';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { SharedModule } from '../shared';
import { MappingModule } from '../mapping/mapping.module';
import { SharedModule } from '../shared';
import { LandingComponent } from './landing.component';
import { RouterModule } from '@angular/router';

@NgModule({
declarations: [LandingComponent],
Expand Down
4 changes: 2 additions & 2 deletions dynamic-mapping-ui/src/mapping-tree/tree.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
* @authors Christof Strack
*/
import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { MappingTreeService } from './tree.service';
import { JsonEditorComponent } from '../shared';
import { ActivatedRoute } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
import { JsonEditorComponent } from '../shared';
import { MappingTreeService } from './tree.service';

@Component({
selector: 'd11r-mapping-tree-grid',
Expand Down
4 changes: 2 additions & 2 deletions dynamic-mapping-ui/src/mapping-tree/tree.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
*
* @authors Christof Strack
*/
import { HttpStatusCode } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { FetchClient, InventoryService } from '@c8y/client';
import { AlertService } from '@c8y/ngx-components';
import { BASE_URL, PATH_MAPPING_TREE_ENDPOINT } from '../shared';
import * as _ from 'lodash';
import { HttpStatusCode } from '@angular/common/http';
import { isTypeOf } from '../mapping/shared/util';
import { BASE_URL, PATH_MAPPING_TREE_ENDPOINT } from '../shared';

@Injectable({ providedIn: 'root' })
export class MappingTreeService {
Expand Down
1 change: 0 additions & 1 deletion dynamic-mapping-ui/src/mapping/core/mapping.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import {
EventRealtimeService,
RealtimeSubjectService
} from '@c8y/ngx-components';
import { patchC8YTemplateForTesting } from '../shared/util';

@Injectable({
providedIn: 'root'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { Injectable } from '@angular/core';
import {
IExternalIdentity,
IFetchResponse,
IIdentified,
IResult,
IResultList
} from '@c8y/client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,29 @@
*
* @authors Christof Strack
*/
import { HttpStatusCode } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { IExternalIdentity } from '@c8y/client';
import { AlertService } from '@c8y/ngx-components';
import * as _ from 'lodash';
import {
API,
MAPPING_TEST_DEVICE_FRAGMENT,
MAPPING_TEST_DEVICE_TYPE,
Mapping,
RepairStrategy,
MAPPING_TEST_DEVICE_TYPE,
MAPPING_TEST_DEVICE_FRAGMENT
getPathTargetForDeviceIdentifiers, transformGenericPath2C8YPath
} from '../../../shared';
import { randomIdAsString, splitTopicExcludingSeparator } from '../../shared/util';
import { C8YAgent } from '../c8y-agent.service';
import {
IDENTITY,
ProcessingContext,
SubstituteValue,
SubstituteValueType
SubstituteValueType,
TOKEN_TOPIC_LEVEL,
getDeviceEntries, getTypedValue, substituteValueInPayload
} from './processor.model';
import { TOKEN_TOPIC_LEVEL } from './processor.model';
import { getDeviceEntries, getTypedValue, substituteValueInPayload } from './processor.model';
import { getPathTargetForDeviceIdentifiers, transformGenericPath2C8YPath } from '../../../shared/mapping/mapping.model';
import { HttpStatusCode } from '@angular/common/http';
import { IExternalIdentity } from '@c8y/client';
import { map } from 'cypress/types/bluebird';

@Injectable({ providedIn: 'root' })
export abstract class BaseProcessorInbound {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import {
splitTopicIncludingSeparator
} from '../../shared/util';
import { C8YAgent } from '../c8y-agent.service';
import { MQTTClient } from '../mqtt-client.service';
import {
ProcessingContext,
SubstituteValue,
SubstituteValueType
SubstituteValueType,
getTypedValue
} from './processor.model';
import { MQTTClient } from '../mqtt-client.service';
import { getTypedValue } from './processor.model';

@Injectable({ providedIn: 'root' })
export abstract class BaseProcessorOutbound {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@
import { Injectable } from '@angular/core';
import * as _ from 'lodash';
import { API, Mapping, RepairStrategy } from '../../../../shared';
import {
TIME,
} from '../../../shared/util';
import { BaseProcessorInbound } from '../base-processor-inbound.service';
import {
ProcessingContext,
processSubstitute,
SubstituteValue,
SubstituteValueType
} from '../processor.model';
import {
TIME,
TOKEN_TOPIC_LEVEL,
splitTopicExcludingSeparator
} from '../../../shared/util';
import { processSubstitute } from '../processor.model';

@Injectable({ providedIn: 'root' })
export class JSONProcessorInbound extends BaseProcessorInbound {
Expand Down
13 changes: 6 additions & 7 deletions dynamic-mapping-ui/src/mapping/grid/mapping.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,21 @@ import {
uuidCustom
} from '../../shared';

import { HttpStatusCode } from '@angular/common/http';
import { Router } from '@angular/router';
import { IIdentified } from '@c8y/client';
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
import { BehaviorSubject, filter, finalize, Subject, switchMap, take } from 'rxjs';
import { LabelRendererComponent, SharedService } from '../../shared';
import { BehaviorSubject, Subject, filter, finalize, switchMap, take } from 'rxjs';
import { DeploymentMapEntry, ExtensionType, LabelRendererComponent, MappingTypeDescriptionMap, SharedService, StepperConfiguration } from '../../shared';
import { MappingService } from '../core/mapping.service';
import { MappingFilterComponent } from '../filter/mapping-filter.component';
import { ImportMappingsComponent } from '../import/import-modal.component';
import { MappingTypeComponent } from '../mapping-type/mapping-type.component';
import { StatusActivationRendererComponent } from '../renderer/status-activation.renderer.component';
import { StatusRendererComponent } from '../renderer/status.renderer.component';
import { HttpStatusCode } from '@angular/common/http';
import { DeploymentMapEntry, ExtensionType, MappingTypeDescriptionMap, StepperConfiguration } from '../../shared';
import { MappingFilterComponent } from '../filter/mapping-filter.component';
import { MappingDeploymentRendererComponent } from '../renderer/mapping-deployment.renderer.component';
import { MappingIdCellRendererComponent } from '../renderer/mapping-id.renderer.component';
import { SnoopedTemplateRendererComponent } from '../renderer/snooped-template.renderer.component';
import { StatusActivationRendererComponent } from '../renderer/status-activation.renderer.component';
import { StatusRendererComponent } from '../renderer/status.renderer.component';
import {
PayloadWrapper
} from '../shared/mapping.model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { C8yStepper, ModalLabels } from '@c8y/ngx-components';
import { Subject } from 'rxjs';
import { Direction, MappingTypeDescriptionMap, MappingType } from '../../shared';
import { Direction, MappingType, MappingTypeDescriptionMap } from '../../shared';
import { isDisabled } from '../shared/util';

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ import {
API,
COLOR_HIGHLIGHTED,
ConnectorType,
countDeviceIdentifiers,
DeploymentMapEntry,
Direction,
Extension,
ExtensionEntry,
getExternalTemplate,
getGenericDeviceIdentifier,
getSchema,
JsonEditorComponent,
Mapping,
MappingSubstitution,
RepairStrategy,
SAMPLE_TEMPLATES_C8Y,
SnoopStatus,
StepperConfiguration,
countDeviceIdentifiers,
getGenericDeviceIdentifier
StepperConfiguration
} from '../../shared';
import { MappingService } from '../core/mapping.service';
import { ValidationError } from '../shared/mapping.model';
Expand Down
5 changes: 2 additions & 3 deletions dynamic-mapping-ui/src/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ export * from './mapping/mapping.model';
export * from './mapping/util';
export * from './misc/admin.guard';
export * from './misc/camel-case.pipe';
export * from './misc/filter-json.pipe';
export * from './misc/capitalize-case.pipe';
export * from './misc/filter-json.pipe';
export * from './misc/format-string.pipe';
export * from './misc/mapping-tab.factory';
export * from './misc/navigation.factory';
export * from './misc/overview.guard';
export * from './service/shared.model';
export * from './service/shared.service';
export * from './shared.module';

export * from './shared.module';

0 comments on commit 4a236ea

Please sign in to comment.