Skip to content

Commit

Permalink
[REFACTOR] shorten imports (#603)
Browse files Browse the repository at this point in the history
* shortened and grouped imports
  • Loading branch information
aibcmars authored Sep 14, 2020
1 parent 410af86 commit 0c225ff
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 30 deletions.
3 changes: 1 addition & 2 deletions src/component/mxgraph/StyleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ShapeBpmnEventKind } from '../../model/bpmn/shape/ShapeBpmnEventKind';
import { ShapeBpmnSubProcessKind } from '../../model/bpmn/shape/ShapeBpmnSubProcessKind';
import { ShapeBpmnEventKind, ShapeBpmnSubProcessKind } from '../../model/bpmn/shape';
import { MessageVisibleKind } from '../../model/bpmn/edge/MessageVisibleKind';

export enum MarkerIdentifier {
Expand Down
3 changes: 1 addition & 2 deletions src/component/mxgraph/config/StyleConfigurator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ShapeBpmnElementKind } from '../../../model/bpmn/shape/ShapeBpmnElementKind';
import { ShapeBpmnElementKind, ShapeBpmnMarkerKind } from '../../../model/bpmn/shape';
import ShapeUtil from '../../../model/bpmn/shape/ShapeUtil';
import { SequenceFlowKind } from '../../../model/bpmn/edge/SequenceFlowKind';
import { MarkerIdentifier, StyleDefault, StyleIdentifier } from '../StyleUtils';
Expand All @@ -32,7 +32,6 @@ import { Font } from '../../../model/bpmn/Label';
import { FlowKind } from '../../../model/bpmn/edge/FlowKind';
import { AssociationFlow, SequenceFlow } from '../../../model/bpmn/edge/Flow';
import { AssociationDirectionKind } from '../../../model/bpmn/edge/AssociationDirectionKind';
import { ShapeBpmnMarkerKind } from '../../../model/bpmn/shape/ShapeBpmnMarkerKind';

/* eslint-disable @typescript-eslint/no-explicit-any */
export default class StyleConfigurator {
Expand Down
5 changes: 2 additions & 3 deletions src/component/mxgraph/shape/activity-shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
* limitations under the License.
*/
import StyleUtils, { StyleDefault } from '../StyleUtils';
import { buildPaintParameter, IconPainterProvider, PaintParameter } from './render/IconPainter';
import { ShapeBpmnSubProcessKind } from '../../../model/bpmn/shape/ShapeBpmnSubProcessKind';
import { ShapeBpmnMarkerKind } from '../../../model/bpmn/shape/ShapeBpmnMarkerKind';
import { buildPaintParameter, IconPainterProvider, PaintParameter } from './render';
import { ShapeBpmnSubProcessKind, ShapeBpmnMarkerKind } from '../../../model/bpmn/shape';
import BpmnCanvas from './render/BpmnCanvas';

function paintEnvelopeIcon(paintParameter: PaintParameter, isFilled: boolean): void {
Expand Down
4 changes: 2 additions & 2 deletions src/component/mxgraph/shape/event-shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ShapeBpmnEventKind } from '../../../model/bpmn/shape/ShapeBpmnEventKind';
import { PaintParameter, buildPaintParameter, IconPainterProvider } from './render/IconPainter';
import { ShapeBpmnEventKind } from '../../../model/bpmn/shape';
import { PaintParameter, buildPaintParameter, IconPainterProvider } from './render';
import StyleUtils, { StyleDefault } from '../StyleUtils';
import BpmnCanvas from './render/BpmnCanvas';

Expand Down
2 changes: 1 addition & 1 deletion src/component/mxgraph/shape/flow-shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { buildPaintParameter, IconPainterProvider } from './render/IconPainter';
import { buildPaintParameter, IconPainterProvider } from './render';
import StyleUtils from '../StyleUtils';
import { MessageVisibleKind } from '../../../model/bpmn/edge/MessageVisibleKind';

Expand Down
2 changes: 1 addition & 1 deletion src/component/mxgraph/shape/gateway-shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { StyleDefault } from '../StyleUtils';
import { PaintParameter, buildPaintParameter, IconPainterProvider } from './render/IconPainter';
import { PaintParameter, buildPaintParameter, IconPainterProvider } from './render';
import BpmnCanvas from './render/BpmnCanvas';

abstract class GatewayShape extends mxRhombus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { TDefinitions } from '../../xml/bpmn-json-model/BPMN20';
import { ShapeBpmnEventKind } from '../../../../model/bpmn/shape/ShapeBpmnEventKind';
import { ShapeBpmnEventKind } from '../../../../model/bpmn/shape';
import { TEventDefinition } from '../../xml/bpmn-json-model/baseElement/rootElement/eventDefinition';
import { ensureIsArray } from './ConverterUtil';

Expand Down
13 changes: 8 additions & 5 deletions src/component/parser/json/converter/ProcessConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ import ShapeBpmnElement, {
ShapeBpmnStartEvent,
ShapeBpmnSubProcess,
} from '../../../../model/bpmn/shape/ShapeBpmnElement';
import { ShapeBpmnElementKind } from '../../../../model/bpmn/shape/ShapeBpmnElementKind';
import {
ShapeBpmnElementKind,
ShapeBpmnCallActivityKind,
ShapeBpmnMarkerKind,
ShapeBpmnSubProcessKind,
ShapeBpmnEventKind,
supportedBpmnEventKinds,
} from '../../../../model/bpmn/shape';
import { AssociationFlow, SequenceFlow } from '../../../../model/bpmn/edge/Flow';
import { ShapeBpmnEventKind, supportedBpmnEventKinds } from '../../../../model/bpmn/shape/ShapeBpmnEventKind';
import ShapeUtil, { BpmnEventKind } from '../../../../model/bpmn/shape/ShapeUtil';
import { SequenceFlowKind } from '../../../../model/bpmn/edge/SequenceFlowKind';
import { ShapeBpmnSubProcessKind } from '../../../../model/bpmn/shape/ShapeBpmnSubProcessKind';
import { FlowKind } from '../../../../model/bpmn/edge/FlowKind';
import { TProcess } from '../../xml/bpmn-json-model/baseElement/rootElement/rootElement';
import { TBoundaryEvent, TCatchEvent, TThrowEvent } from '../../xml/bpmn-json-model/baseElement/flowNode/event';
Expand All @@ -38,10 +43,8 @@ import { TAssociation, TTextAnnotation } from '../../xml/bpmn-json-model/baseEle
import { AssociationDirectionKind } from '../../../../model/bpmn/edge/AssociationDirectionKind';
import { bpmnEventKinds, findEventDefinitionOfDefinitions } from './EventDefinitionConverter';
import { ensureIsArray } from './ConverterUtil';
import { ShapeBpmnMarkerKind } from '../../../../model/bpmn/shape/ShapeBpmnMarkerKind';
import { TEventBasedGateway } from '../../xml/bpmn-json-model/baseElement/flowNode/gateway';
import { TReceiveTask } from '../../xml/bpmn-json-model/baseElement/flowNode/activity/task';
import { ShapeBpmnCallActivityKind } from '../../../../model/bpmn/shape/ShapeBpmnCallActivityKind';
import { isGlobalTask } from './GlobalTaskConverter';

const convertedFlowNodeBpmnElements: Map<string, ShapeBpmnElement> = new Map();
Expand Down
6 changes: 1 addition & 5 deletions test/unit/component/mxgraph/config/StyleConfigurator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,17 @@ import ShapeBpmnElement, {
ShapeBpmnStartEvent,
ShapeBpmnSubProcess,
} from '../../../../../src/model/bpmn/shape/ShapeBpmnElement';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnElementKind';
import { ShapeBpmnElementKind, ShapeBpmnCallActivityKind, ShapeBpmnMarkerKind, ShapeBpmnSubProcessKind, ShapeBpmnEventKind } from '../../../../../src/model/bpmn/shape';
import Label, { Font } from '../../../../../src/model/bpmn/Label';
import { ExpectedFont } from '../../parser/json/JsonTestUtils';
import Edge from '../../../../../src/model/bpmn/edge/Edge';
import { AssociationFlow, MessageFlow, SequenceFlow } from '../../../../../src/model/bpmn/edge/Flow';
import { SequenceFlowKind } from '../../../../../src/model/bpmn/edge/SequenceFlowKind';
import Bounds from '../../../../../src/model/bpmn/Bounds';
import { ShapeBpmnEventKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnEventKind';
import { BpmnEventKind } from '../../../../../src/model/bpmn/shape/ShapeUtil';
import { ShapeBpmnSubProcessKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnSubProcessKind';
import each from 'jest-each';
import { MessageVisibleKind } from '../../../../../src/model/bpmn/edge/MessageVisibleKind';
import { AssociationDirectionKind } from '../../../../../src/model/bpmn/edge/AssociationDirectionKind';
import { ShapeBpmnMarkerKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnMarkerKind';
import { ShapeBpmnCallActivityKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnCallActivityKind';

function toFont(font: ExpectedFont): Font {
return new Font(font.name, font.size, font.isBold, font.isItalic, font.isUnderline, font.isStrikeThrough);
Expand Down
3 changes: 1 addition & 2 deletions test/unit/component/mxgraph/render/BpmnCanvas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { IconStyleConfiguration, ShapeConfiguration, Size } from '../../../../../src/component/mxgraph/shape/render/render-types';
import { computeScaledIconSize } from '../../../../../src/component/mxgraph/shape/render/BpmnCanvas';
import { IconStyleConfiguration, ShapeConfiguration, Size, computeScaledIconSize } from '../../../../../src/component/mxgraph/shape/render';

describe('compute scaled icon size', () => {
function newIconStyleConfiguration(strokeWidth = 0): IconStyleConfiguration {
Expand Down
6 changes: 1 addition & 5 deletions test/unit/component/parser/json/JsonTestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnElementKind';
import { ShapeBpmnElementKind, ShapeBpmnCallActivityKind, ShapeBpmnMarkerKind, ShapeBpmnSubProcessKind, ShapeBpmnEventKind } from '../../../../../src/model/bpmn/shape';
import Shape from '../../../../../src/model/bpmn/shape/Shape';
import { defaultBpmnJsonParser } from '../../../../../src/component/parser/json/BpmnJsonParser';
import Edge from '../../../../../src/model/bpmn/edge/Edge';
import BpmnModel from '../../../../../src/model/bpmn/BpmnModel';
import Waypoint from '../../../../../src/model/bpmn/edge/Waypoint';
import { ShapeBpmnActivity, ShapeBpmnCallActivity, ShapeBpmnEvent, ShapeBpmnSubProcess } from '../../../../../src/model/bpmn/shape/ShapeBpmnElement';
import { ShapeBpmnEventKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnEventKind';
import { SequenceFlowKind } from '../../../../../src/model/bpmn/edge/SequenceFlowKind';
import Label from '../../../../../src/model/bpmn/Label';
import { ShapeBpmnSubProcessKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnSubProcessKind';
import { SequenceFlow } from '../../../../../src/model/bpmn/edge/Flow';
import { FlowKind } from '../../../../../src/model/bpmn/edge/FlowKind';
import { MessageVisibleKind } from '../../../../../src/model/bpmn/edge/MessageVisibleKind';
import { BpmnJsonModel } from '../../../../../src/component/parser/xml/bpmn-json-model/BPMN20';
import { ShapeBpmnMarkerKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnMarkerKind';
import { ShapeBpmnCallActivityKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnCallActivityKind';

export interface ExpectedShape {
shapeId: string;
Expand Down
2 changes: 1 addition & 1 deletion test/unit/model/bpmn/shape/ShapeUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import ShapeUtil from '../../../../../src/model/bpmn/shape/ShapeUtil';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/shape/ShapeBpmnElementKind';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/shape';

describe('ShapeUtil', () => {
it('top level bpmn event kinds', () => {
Expand Down

0 comments on commit 0c225ff

Please sign in to comment.