Skip to content

Commit

Permalink
Merge pull request #43 from skbkontur/semke/add-edi-ui
Browse files Browse the repository at this point in the history
Add edi-ui, remove custom components & utils
  • Loading branch information
semkedaniil authored Jun 21, 2024
2 parents 6363cfc + 0cc6cdd commit 8e50cf5
Show file tree
Hide file tree
Showing 32 changed files with 166 additions and 874 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.4",
"@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
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export type RussianDateFormat = string;

export interface DateTimeRange {
lowerBound: Nullable<Date>;
upperBound: Nullable<Date>;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { DateUtils } 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 @@ -132,7 +133,7 @@ export class DateTimeRangeMapper {
}

public stringifyDate(value: Nullable<Date>): Nullable<string> {
return value ? DateUtils.convertDateToString(value, undefined, "yyyy-MM-dd") : undefined;
return value ? DateUtils.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 8e50cf5

Please sign in to comment.