Skip to content

Commit

Permalink
Add edi-ui, remove custom components & utils
Browse files Browse the repository at this point in the history
  • Loading branch information
semkedaniil committed Jun 13, 2024
1 parent 6363cfc commit 15e2a21
Show file tree
Hide file tree
Showing 31 changed files with 169 additions and 866 deletions.
5 changes: 3 additions & 2 deletions cassandra-distributed-task-queue-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
},
"peerDependencies": {
"@skbkontur/icons": ">=1 <2",
"@skbkontur/react-ui": ">=2 <=4",
"@skbkontur/react-ui": ">=4",
"react": ">=16 <=18",
"react-dom": ">=16 <=18",
"react-router-dom": ">=6"
},
"dependencies": {
"@skbkontur/edi-ui": "^0.2.2",
"@skbkontur/react-stack-layout": "^1.0.3",
"copy-to-clipboard": "^3.3.1",
"date-fns": "^2.29.2",
Expand All @@ -54,7 +55,7 @@
},
"devDependencies": {
"@skbkontur/icons": "^1.3.0",
"@skbkontur/react-ui": "^4.1.0",
"@skbkontur/react-ui": "^4.22.0",
"@storybook/addon-actions": "^7.0.7",
"@storybook/addons": "^7.0.7",
"@storybook/cli": "^7.4.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { TimeUtils } from "@skbkontur/edi-ui";

import { RangeSelector } from "../components/DateTimeRangePicker/RangeSelector";

import { RtqMonitoringSearchRequest } from "./Api/RtqMonitoringSearchRequest";
import { RtqMonitoringTaskModel } from "./Api/RtqMonitoringTaskModel";
import { TimeUtils } from "./Utils/TimeUtils";

export interface ICustomRenderer {
renderDetails: (target: any, path: string[]) => null | JSX.Element;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { formatDate, fromLocalToUtc } from "@skbkontur/edi-ui";
import { endOfDay, isValid, parse as parseDateInternal, startOfDay } from "date-fns";
import difference from "lodash/difference";

import { DateTimeRange } from "../DataTypes/DateTimeRange";
import { DateUtils } from "../Utils/DateUtils";

export type QueryObject = any;

export interface Mapper<T> {
parse(parsedQueryString: QueryObject): Nullable<T>;

stringify(parsedQueryString: QueryObject, value: Nullable<T>): QueryObject;
}

Expand Down Expand Up @@ -128,11 +129,11 @@ export class DateTimeRangeMapper {
return null;
}
const parsedValue = parseDateInternal(parameterValue, "yyyy-MM-dd", new Date());
return isValid(parsedValue) ? DateUtils.fromLocalToUtc(parsedValue) : null;
return isValid(parsedValue) ? fromLocalToUtc(parsedValue) : null;
}

public stringifyDate(value: Nullable<Date>): Nullable<string> {
return value ? DateUtils.convertDateToString(value, undefined, "yyyy-MM-dd") : undefined;
return value ? formatDate(value, "yyyy-MM-dd") : undefined;
}

public parse(parsedQueryString: QueryObject): Nullable<DateTimeRange> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Lens, pathLens, PropertyPicker } from "@skbkontur/edi-ui";

import { DateTimeRange } from "../DataTypes/DateTimeRange";
import { Lens, pathLens, PropertyPicker } from "../lens";

import { Mapper, IntegerMapper, StringArrayMapper, DateTimeRangeMapper, StringMapper, SetMapper } from "./Mappers";
import { Parser, QueryStringMapping, Stringifier } from "./QueryStringMapping";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { TimeUtils } from "@skbkontur/edi-ui";

import { RangeSelector } from "../components/DateTimeRangePicker/RangeSelector";

import { RtqMonitoringSearchRequest } from "./Api/RtqMonitoringSearchRequest";
import { DateTimeRange } from "./DataTypes/DateTimeRange";
import { TimeUtils } from "./Utils/TimeUtils";

function isDateTimeRangeEmpty(range: Nullable<DateTimeRange>): boolean {
return !(range && (range.lowerBound || range.upperBound));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Decimal from "decimal.js";

export function ticksToMilliseconds(timeStr: Nullable<string>): Nullable<string> {
export const ticksToMilliseconds = (timeStr: Nullable<string>): Nullable<string> => {
if (!timeStr) {
return null;
}
const commonTime = new Decimal(timeStr);
return commonTime.div(10000).toString();
}
};
35 changes: 0 additions & 35 deletions cassandra-distributed-task-queue-ui/src/Domain/Utils/DateUtils.ts

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions cassandra-distributed-task-queue-ui/src/Domain/Utils/TimeUtils.ts

This file was deleted.

32 changes: 0 additions & 32 deletions cassandra-distributed-task-queue-ui/src/Domain/lens.ts

This file was deleted.

This file was deleted.

Loading

0 comments on commit 15e2a21

Please sign in to comment.