Skip to content

Commit

Permalink
refactor: moved all core files to top level
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Mar 11, 2024
1 parent fb3e7c7 commit 8cea5be
Show file tree
Hide file tree
Showing 68 changed files with 103 additions and 105 deletions.
44 changes: 22 additions & 22 deletions libs/angular-accelerator/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// directives
export * from './lib/core/directives/if-permission.directive'
export * from './lib/directives/if-permission.directive'

// components
export * from './lib/core/components/column-group-selection/column-group-selection.component'
export * from './lib/core/components/custom-group-column-selector/custom-group-column-selector.component'
export * from './lib/core/components/data-layout-selection/data-layout-selection.component'
export * from './lib/core/components/data-list-grid/data-list-grid.component'
export * from './lib/core/components/data-list-grid-sorting/data-list-grid-sorting.component'
export * from './lib/core/components/data-table/data-table.component'
export * from './lib/core/components/data-view/data-view.component'
export * from './lib/core/components/diagram/diagram.component'
export * from './lib/core/components/group-by-count-diagram/group-by-count-diagram.component'
export * from './lib/core/components/interactive-data-view/interactive-data-view.component'
export * from './lib/core/components/page-header/page-header.component'
export * from './lib/core/components/search-config/search-config.component'
export * from './lib/core/components/search-header/search-header.component'
export * from './lib/components/column-group-selection/column-group-selection.component'
export * from './lib/components/custom-group-column-selector/custom-group-column-selector.component'
export * from './lib/components/data-layout-selection/data-layout-selection.component'
export * from './lib/components/data-list-grid/data-list-grid.component'
export * from './lib/components/data-list-grid-sorting/data-list-grid-sorting.component'
export * from './lib/components/data-table/data-table.component'
export * from './lib/components/data-view/data-view.component'
export * from './lib/components/diagram/diagram.component'
export * from './lib/components/group-by-count-diagram/group-by-count-diagram.component'
export * from './lib/components/interactive-data-view/interactive-data-view.component'
export * from './lib/components/page-header/page-header.component'
export * from './lib/components/search-config/search-config.component'
export * from './lib/components/search-header/search-header.component'

// services
export * from './lib/services/app-state.service'
export * from './lib/services/breadcrumb.service'
export * from './lib/services/user.service'

// pipes
export * from './lib/core/pipes/dynamic.pipe'
export * from './lib/core/pipes/relative-date.pipe'
export * from './lib/pipes/dynamic.pipe'
export * from './lib/pipes/relative-date.pipe'

// models
export * from './lib/model/breadcrumb-menu-item.model'
Expand All @@ -38,14 +38,14 @@ export * from './lib/model/diagram-type'
export * from './lib/model/search-config'

// core
export * from './lib/core/angular-accelerator.module'
// export * from './lib/core/primeng.module'
export * from './lib/angular-accelerator.module'
// export * from './lib/primeng.module'

// functions
export * from './lib/functions/flatten-object'

// utils
export * from './lib/core/utils/colorutils'
export * from './lib/core/utils/dateutils'
export * from './lib/core/utils/objectutils'
export * from './lib/core/utils/primeicon.utils'
export * from './lib/utils/colorutils'
export * from './lib/utils/dateutils'
export * from './lib/utils/objectutils'
export * from './lib/utils/primeicon.utils'
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { DynamicPipe } from './pipes/dynamic.pipe'
import { RelativeDatePipe } from './pipes/relative-date.pipe'

import { IfPermissionDirective } from './directives/if-permission.directive'
import { UserService } from '../services/user.service'
import { UserService } from './services/user.service'

export class AngularAcceleratorMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { BehaviorSubject, combineLatest, map, Observable } from 'rxjs'
import { DataTableColumn } from '../../../model/data-table-column.model'
import { DataTableColumn } from '../../model/data-table-column.model'

export type GroupSelectionChangedEvent = { activeColumns: DataTableColumn[]; groupKey: string }
@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ButtonModule } from 'primeng/button'
import { importProvidersFrom } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { ColumnType } from '../../../model/column-type.model'
import { ColumnType } from '../../model/column-type.model'
import { DropdownModule } from 'primeng/dropdown'
import { DialogModule } from 'primeng/dialog'
import { PickListModule } from 'primeng/picklist'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, EventEmitter, Input, Output } from '@angular/core'
import { TranslateService } from '@ngx-translate/core'
import { DataTableColumn } from '../../../model/data-table-column.model'
import { DataTableColumn } from '../../model/data-table-column.model'

export type ColumnSelectionChangedEvent = { activeColumns: DataTableColumn[] }
export type ActionColumnChangedEvent = {
Expand Down Expand Up @@ -69,14 +69,17 @@ export class CustomGroupColumnSelectorComponent {

onSaveClick() {
this.visible = false
const colIdsBefore = this.displayedColumns.map(column => column.id)
const colIdsAfter = this.displayedColumnsModel.map(column => column.id)
if(!colIdsAfter.every((colId, i) => colId === colIdsBefore[i])) {
const colIdsBefore = this.displayedColumns.map((column) => column.id)
const colIdsAfter = this.displayedColumnsModel.map((column) => column.id)

if (!colIdsAfter.every((colId, i) => colId === colIdsBefore[i])) {
this.columnSelectionChanged.emit({ activeColumns: [...this.displayedColumnsModel] })
}

if(this.frozenActionColumn != this.frozenActionColumnModel || this.actionColumnPosition != this.actionColumnPositionModel) {

if (
this.frozenActionColumn != this.frozenActionColumnModel ||
this.actionColumnPosition != this.actionColumnPositionModel
) {
this.actionColumnConfigChanged.emit({
frozenActionColumn: this.frozenActionColumnModel,
actionColumnPosition: this.actionColumnPositionModel,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { DataSortDirection } from '../../../model/data-sort-direction'
import { DataSortDirection } from '../../model/data-sort-direction'
import { BehaviorSubject } from 'rxjs'
import { DataColumnNameId } from '../../../model/data-column-name-id.model'
import { DataTableColumn } from '../../../model/data-table-column.model'
import { DataColumnNameId } from '../../model/data-column-name-id.model'
import { DataTableColumn } from '../../model/data-table-column.model'

@Component({
selector: 'ocx-data-list-grid-sorting',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core'
import { DataListGridComponent } from './data-list-grid.component'
import { PrimeNgModule } from '../../primeng.module'
import { TranslateTestingModule } from 'ngx-translate-testing'
import { ColumnType } from '../../../model/column-type.model'
import { DataListGridHarness } from '../../../../../testing/data-list-grid.harness'
import { DataTableHarness } from '../../../../../testing/data-table.harness'
import { ColumnType } from '../../model/column-type.model'
import { DataListGridHarness } from '../../../../testing/data-list-grid.harness'
import { DataTableHarness } from '../../../../testing/data-table.harness'
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { ActivatedRoute, RouterModule } from '@angular/router'
import { AngularAcceleratorModule } from '../../angular-accelerator.module'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { Router } from '@angular/router'
import { TranslateService } from '@ngx-translate/core'
import { MenuItem, PrimeIcons } from 'primeng/api'
import { BehaviorSubject, Observable, combineLatest, map, mergeMap } from 'rxjs'
import { DataAction } from '../../../model/data-action'
import { DataSortDirection } from '../../../model/data-sort-direction'
import { DataTableColumn } from '../../../model/data-table-column.model'
import { DataAction } from '../../model/data-action'
import { DataSortDirection } from '../../model/data-sort-direction'
import { DataTableColumn } from '../../model/data-table-column.model'
import { MfeInfo } from '@onecx/integration-interface'
import { AppStateService } from '../../../services/app-state.service'
import { UserService } from '../../../services/user.service'
import { AppStateService } from '../../services/app-state.service'
import { UserService } from '../../services/user.service'
import { ObjectUtils } from '../../utils/objectutils'
import { DataSortBase } from '../data-sort-base/data-sort-base'
import { Filter, Row } from '../data-table/data-table.component'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TranslateService } from '@ngx-translate/core'
import { Observable, map, of } from 'rxjs'
import { flattenObject } from '../../../functions/flatten-object'
import { ColumnType } from '../../../model/column-type.model'
import { DataSortDirection } from '../../../model/data-sort-direction'
import { DataTableColumn } from '../../../model/data-table-column.model'
import { flattenObject } from '../../functions/flatten-object'
import { ColumnType } from '../../model/column-type.model'
import { DataSortDirection } from '../../model/data-sort-direction'
import { DataTableColumn } from '../../model/data-table-column.model'
import { ListGridData } from '../../components/data-list-grid/data-list-grid.component'
import { Row, Filter } from '../../components/data-table/data-table.component'
import { ObjectUtils } from '../../utils/objectutils'
Expand All @@ -14,12 +14,7 @@ export class DataSortBase {
constructor(protected locale: string, protected translateService: TranslateService) {}

translateItems(
[items, filters, sortColumn, sortDirection]: [
RowListGridData[],
Filter[],
string,
DataSortDirection,
],
[items, filters, sortColumn, sortDirection]: [RowListGridData[], Filter[], string, DataSortDirection],
columns: DataTableColumn[],
clientSideFiltering: boolean,
clientSideSorting: boolean
Expand Down Expand Up @@ -126,7 +121,7 @@ export class DataSortBase {
createCompareFunction(
translatedColValues: Record<string, string>,
sortColumn: string,
sortDirection: DataSortDirection,
sortDirection: DataSortDirection
): (a: Record<string, any>, b: Record<string, any>) => number {
let direction = 0
if (sortDirection === DataSortDirection.ASCENDING) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core'
import { DataTableComponent, Row } from './data-table.component'
import { PrimeNgModule } from '../../primeng.module'
import { TranslateTestingModule } from 'ngx-translate-testing'
import { ColumnType } from '../../../model/column-type.model'
import { ColumnType } from '../../model/column-type.model'
import { AngularAcceleratorModule } from '../../angular-accelerator.module'
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { DataTableHarness } from '../../../../../testing'
import { DataTableHarness } from '../../../../testing'
import { PTableCheckboxHarness } from '@onecx/angular-testing'

describe('DataTableComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MultiSelectModule } from 'primeng/multiselect'
import { importProvidersFrom } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { ColumnType } from '../../../model/column-type.model'
import { ColumnType } from '../../model/column-type.model'
type DataTableInputTypes = Pick<DataTableComponent, 'rows' | 'columns' | 'emptyResultsMessage' | 'selectedRows'>
const DataTableComponentSBConfig: Meta<DataTableComponent> = {
title: 'DataTableComponent',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { Router } from '@angular/router'
import { TranslateService } from '@ngx-translate/core'
import { SelectItem } from 'primeng/api'
import { BehaviorSubject, Observable, combineLatest, map, mergeMap, of } from 'rxjs'
import { ColumnType } from '../../../model/column-type.model'
import { DataAction } from '../../../model/data-action'
import { DataSortDirection } from '../../../model/data-sort-direction'
import { DataTableColumn } from '../../../model/data-table-column.model'
import { ColumnType } from '../../model/column-type.model'
import { DataAction } from '../../model/data-action'
import { DataSortDirection } from '../../model/data-sort-direction'
import { DataTableColumn } from '../../model/data-table-column.model'
import { DataSortBase } from '../data-sort-base/data-sort-base'

type Primitive = number | string | boolean | bigint | Date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { TranslateTestingModule } from 'ngx-translate-testing'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { DataTableComponent } from '../data-table/data-table.component'
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { DataListGridHarness, DataTableHarness, DataViewHarness } from '../../../../../testing'
import { ColumnType } from '../../../model/column-type.model'
import { DataListGridHarness, DataTableHarness, DataViewHarness } from '../../../../testing'
import { ColumnType } from '../../model/column-type.model'
import { AngularAcceleratorModule } from '../../angular-accelerator.module'

describe('DataViewComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
} from '@angular/core'
import { DataListGridComponent, ListGridData } from '../data-list-grid/data-list-grid.component'
import { Row, Filter, Sort, DataTableComponent } from '../data-table/data-table.component'
import { DataTableColumn } from '../../../model/data-table-column.model'
import { DataSortDirection } from '../../../model/data-sort-direction'
import { DataAction } from '../../../model/data-action'
import { DataTableColumn } from '../../model/data-table-column.model'
import { DataSortDirection } from '../../model/data-sort-direction'
import { DataAction } from '../../model/data-action'

export type RowListGridData = ListGridData & Row
@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import 'jest-canvas-mock'
import { TranslateTestingModule } from 'ngx-translate-testing'
import { ChartModule } from 'primeng/chart'
import { MessageModule } from 'primeng/message'
import { DiagramHarness, TestbedHarnessEnvironment } from '../../../../../testing'
import { DiagramType } from '../../../model/diagram-type'
import { DiagramHarness, TestbedHarnessEnvironment } from '../../../../testing'
import { DiagramType } from '../../model/diagram-type'
import { DiagramComponent, DiagramLayouts } from './diagram.component'
import { PrimeIcons } from 'primeng/api'
import { SelectButtonModule } from 'primeng/selectbutton'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { SkeletonModule } from 'primeng/skeleton'
import { DynamicPipe } from '../../pipes/dynamic.pipe'
import { StorybookTranslateModule } from '../../storybook-translate.module'
import { DiagramComponent } from './diagram.component'
import { DiagramType } from '../../../model/diagram-type'
import { DiagramData } from '../../../model/diagram-data'
import { DiagramType } from '../../model/diagram-type'
import { DiagramData } from '../../model/diagram-data'
import { ChartModule } from 'primeng/chart'
import { SelectButtonModule } from 'primeng/selectbutton'
import { FormsModule } from '@angular/forms'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { TranslateService } from '@ngx-translate/core'
import { ChartData, ChartOptions } from 'chart.js'
import * as d3 from 'd3-scale-chromatic'
import { PrimeIcons } from 'primeng/api'
import { DiagramData } from '../../../model/diagram-data'
import { DiagramType } from '../../../model/diagram-type'
import { DiagramData } from '../../model/diagram-data'
import { DiagramType } from '../../model/diagram-type'
import { ColorUtils } from '../../utils/colorutils'
import { PrimeIcon } from '../../utils/primeicon.utils'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { TranslateTestingModule } from 'ngx-translate-testing'
import { ChartModule } from 'primeng/chart'
import { MessageModule } from 'primeng/message'
import { firstValueFrom, of } from 'rxjs'
import { DiagramHarness } from '../../../../../testing'
import { ColumnType } from '../../../model/column-type.model'
import { DiagramHarness } from '../../../../testing'
import { ColumnType } from '../../model/column-type.model'
import { DiagramComponent } from '../diagram/diagram.component'
import { GroupByCountDiagramComponent } from './group-by-count-diagram.component'
import { DiagramType } from '../../../model/diagram-type'
import { DiagramType } from '../../model/diagram-type'

describe('GroupByCountDiagramComponent', () => {
let translateService: TranslateService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { MenuModule } from 'primeng/menu'
import { SkeletonModule } from 'primeng/skeleton'
import { DynamicPipe } from '../../pipes/dynamic.pipe'
import { StorybookTranslateModule } from '../../storybook-translate.module'
import { DiagramType } from '../../../model/diagram-type'
import { DiagramType } from '../../model/diagram-type'
import { ChartModule } from 'primeng/chart'
import { SelectButtonModule } from 'primeng/selectbutton'
import { GroupByCountDiagramComponent } from './group-by-count-diagram.component'
import { DiagramComponent } from '../diagram/diagram.component'
import { ColumnType } from '../../../model/column-type.model'
import { ColumnType } from '../../model/column-type.model'

export default {
title: 'GroupByCountDiagramComponent',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { ColumnType } from '../../../model/column-type.model'
import { DiagramColumn } from '../../../model/diagram-column'
import { ColumnType } from '../../model/column-type.model'
import { DiagramColumn } from '../../model/diagram-column'
import { ObjectUtils } from '../../utils/objectutils'
import { BehaviorSubject, Observable, combineLatest, map, mergeMap, of } from 'rxjs'
import { TranslateService } from '@ngx-translate/core'
import { DiagramData } from '../../../model/diagram-data'
import { DiagramType } from '../../../model/diagram-type'
import { DiagramData } from '../../model/diagram-data'
import { DiagramType } from '../../model/diagram-type'

@Component({
selector: 'ocx-group-by-count-diagram',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { TranslateModule } from '@ngx-translate/core'
import { HarnessLoader, parallel, TestElement } from '@angular/cdk/testing'
import { AngularAcceleratorModule } from '../../angular-accelerator.module'
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { ColumnType } from '../../../model/column-type.model'
import { ColumnType } from '../../model/column-type.model'
import {
DataViewHarness,
ColumnGroupSelectionHarness,
Expand All @@ -23,7 +23,7 @@ import {
DefaultGridItemHarness,
DefaultListItemHarness,
InteractiveDataViewHarness,
} from '../../../../../testing'
} from '../../../../testing'
import {
PDropdownHarness,
PButtonHarness,
Expand All @@ -39,8 +39,8 @@ import { TranslateTestingModule } from 'ngx-translate-testing'
import { NoopAnimationsModule } from '@angular/platform-browser/animations'
import { DateUtils } from '../../utils/dateutils'
import { HttpClientModule } from '@angular/common/http'
import { UserService } from '../../../services/user.service'
import { MockUserService } from '../../../../../mocks/mock-user-service'
import { UserService } from '../../services/user.service'
import { MockUserService } from '../../../../mocks/mock-user-service'

describe('InteractiveDataViewComponent', () => {
let component: InteractiveDataViewComponent
Expand Down
Loading

0 comments on commit 8cea5be

Please sign in to comment.