Skip to content

Commit

Permalink
feat: Cleanup after delete @foblex/core
Browse files Browse the repository at this point in the history
  • Loading branch information
siarheihuzarevich committed Sep 14, 2024
1 parent 26d9631 commit 9aa5717
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 31 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@angular/platform-server": "^18.2.0",
"@angular/router": "^18.2.0",
"@angular/ssr": "^18.2.3",
"@foblex/core": "1.2.6",
"@foblex/f-docs": "1.3.0",
"@foblex/platform": "1.0.3",
"@foblex/mediator": "1.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IPoint, PointExtensions } from '@foblex/2d';
import { graphlib } from 'dagre';
import Graph = graphlib.Graph;
import { FCheckboxComponent } from '@foblex/f-docs';
import { generateGuid } from '@foblex/utils';

interface INodeViewModel {
id: string;
Expand Down Expand Up @@ -132,11 +133,3 @@ const GRAPH_DATA = [
{ id: 'Node7', parentId: 'Node3' },
{ id: 'Node8', parentId: 'Node2' }
];

function generateGuid(): string {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { EFConnectableSide, FCanvasComponent, FFlowComponent, FFlowModule } from '@foblex/flow';
import { PointExtensions } from '@foblex/2d';
import { GuidExtensions } from '@foblex/core';
import { FCheckboxComponent } from '@foblex/f-docs';
import { generateGuid } from '@foblex/utils';

@Component({
selector: 'elkjs-layout-example',
Expand Down Expand Up @@ -85,7 +85,7 @@ export class ElkjsLayoutExampleComponent implements OnInit {
private getNodes(data: any): any[] {
return data.children!.map((node: any) => {
return {
id: GuidExtensions.generate(),
id: generateGuid(),
connectorId: node.id,
position: PointExtensions.initialize(node.x, node.y)
};
Expand All @@ -95,7 +95,7 @@ export class ElkjsLayoutExampleComponent implements OnInit {
private getConnections(data: any): any[] {
return data.edges!.map((edge: any) => {
return {
id: GuidExtensions.generate(),
id: generateGuid(),
from: edge.sources[ 0 ],
to: edge.targets[ 0 ]
};
Expand Down
1 change: 0 additions & 1 deletion projects/f-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@angular/common": ">=12.0.0",
"@angular/core": ">=12.0.0",
"@foblex/platform": "1.0.3",
"@foblex/core": "1.2.6",
"@foblex/mediator": "1.1.0",
"@foblex/2d": "1.1.0",
"@foblex/drag-toolkit": "1.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GuidExtensions } from '@foblex/core';
import { IHandler } from '@foblex/mediator';
import { CreateConnectionRequest } from './create-connection.request';
import { IDatabaseStorage } from '../../database.storage';
import { generateGuid } from '@foblex/utils';

export class CreateConnectionHandler implements IHandler<CreateConnectionRequest> {

Expand All @@ -14,7 +14,7 @@ export class CreateConnectionHandler implements IHandler<CreateConnectionRequest
this.getConnection(request.outputId, request.inputId);

this.storage.connections.push({
id: GuidExtensions.generate(),
id: generateGuid(),
from: request.outputId,
to: request.inputId,
type: request.type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ITableConnectionStorageModel } from './connection';
import { ETableRelationType } from './connection';
import { ETableColumnKey, ETableColumnType } from './table';
import { IGroupStorageModel } from './group';
import { generateGuid } from './generate-guid';
import { generateGuid } from '@foblex/utils';

export interface IDatabaseStorage {

Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions projects/f-pro-examples/db-management-example/domain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ export * from './database.api-service';

export * from './database.storage';

export * from './generate-guid';

export * from './i-database-model';
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CreateColumnRequest } from './create-column.request';
import { IDatabaseStorage } from '../../database.storage';
import { ITableStorageModel } from '../i-table-storage-model';
import { ETableColumnType } from '../e-table-column-type';
import { generateGuid } from '../../generate-guid';
import { generateGuid } from '@foblex/utils';

export class CreateColumnHandler implements IHandler<CreateColumnRequest> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IHandler } from '@foblex/mediator';
import { CreateTableRequest } from './create-table.request';
import { IDatabaseStorage } from '../../database.storage';
import { ETableColumnType } from '../e-table-column-type';
import { generateGuid } from '../../generate-guid';
import { generateGuid } from '@foblex/utils';

export class CreateTableHandler implements IHandler<CreateTableRequest> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GuidExtensions } from '@foblex/core';
import { IHandler } from '@foblex/mediator';
import { AddNewNodeToFlowRequest } from './add-new-node-to-flow.request';
import { IFlowStorage } from '../../flow.storage';
import { generateGuid } from '@foblex/utils';

export class AddNewNodeToFlowHandler implements IHandler<AddNewNodeToFlowRequest> {

Expand All @@ -12,9 +12,9 @@ export class AddNewNodeToFlowHandler implements IHandler<AddNewNodeToFlowRequest

public handle(request: AddNewNodeToFlowRequest): void {
this.flow.nodes.push({
id: GuidExtensions.generate(),
input: GuidExtensions.generate(),
output: GuidExtensions.generate(),
id: generateGuid(),
input: generateGuid(),
output: generateGuid(),
type: request.type,
position: request.position,
});
Expand Down

0 comments on commit 9aa5717

Please sign in to comment.