Skip to content

Commit 8e50cf5

Browse files
authored
Merge pull request #43 from skbkontur/semke/add-edi-ui
Add edi-ui, remove custom components & utils
2 parents 6363cfc + 0cc6cdd commit 8e50cf5

32 files changed

+166
-874
lines changed

cassandra-distributed-task-queue-ui/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
},
3838
"peerDependencies": {
3939
"@skbkontur/icons": ">=1 <2",
40-
"@skbkontur/react-ui": ">=2 <=4",
40+
"@skbkontur/react-ui": ">=4",
4141
"react": ">=16 <=18",
4242
"react-dom": ">=16 <=18",
4343
"react-router-dom": ">=6"
4444
},
4545
"dependencies": {
46+
"@skbkontur/edi-ui": "^0.2.4",
4647
"@skbkontur/react-stack-layout": "^1.0.3",
4748
"copy-to-clipboard": "^3.3.1",
4849
"date-fns": "^2.29.2",
@@ -54,7 +55,7 @@
5455
},
5556
"devDependencies": {
5657
"@skbkontur/icons": "^1.3.0",
57-
"@skbkontur/react-ui": "^4.1.0",
58+
"@skbkontur/react-ui": "^4.22.0",
5859
"@storybook/addon-actions": "^7.0.7",
5960
"@storybook/addons": "^7.0.7",
6061
"@storybook/cli": "^7.4.6",

cassandra-distributed-task-queue-ui/src/Domain/CustomRenderer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { TimeUtils } from "@skbkontur/edi-ui";
2+
13
import { RangeSelector } from "../components/DateTimeRangePicker/RangeSelector";
24

35
import { RtqMonitoringSearchRequest } from "./Api/RtqMonitoringSearchRequest";
46
import { RtqMonitoringTaskModel } from "./Api/RtqMonitoringTaskModel";
5-
import { TimeUtils } from "./Utils/TimeUtils";
67

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

cassandra-distributed-task-queue-ui/src/Domain/DataTypes/DateTimeRange.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export type RussianDateFormat = string;
2-
31
export interface DateTimeRange {
42
lowerBound: Nullable<Date>;
53
upperBound: Nullable<Date>;

cassandra-distributed-task-queue-ui/src/Domain/DataTypes/Time.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

cassandra-distributed-task-queue-ui/src/Domain/QueryStringMapping/Mappers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
import { DateUtils } from "@skbkontur/edi-ui";
12
import { endOfDay, isValid, parse as parseDateInternal, startOfDay } from "date-fns";
23
import difference from "lodash/difference";
34

45
import { DateTimeRange } from "../DataTypes/DateTimeRange";
5-
import { DateUtils } from "../Utils/DateUtils";
66

77
export type QueryObject = any;
88

99
export interface Mapper<T> {
1010
parse(parsedQueryString: QueryObject): Nullable<T>;
11+
1112
stringify(parsedQueryString: QueryObject, value: Nullable<T>): QueryObject;
1213
}
1314

@@ -132,7 +133,7 @@ export class DateTimeRangeMapper {
132133
}
133134

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

138139
public parse(parsedQueryString: QueryObject): Nullable<DateTimeRange> {

cassandra-distributed-task-queue-ui/src/Domain/QueryStringMapping/QueryStringMappingBuilder.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { Lens, pathLens, PropertyPicker } from "@skbkontur/edi-ui";
2+
13
import { DateTimeRange } from "../DataTypes/DateTimeRange";
2-
import { Lens, pathLens, PropertyPicker } from "../lens";
34

45
import { Mapper, IntegerMapper, StringArrayMapper, DateTimeRangeMapper, StringMapper, SetMapper } from "./Mappers";
56
import { Parser, QueryStringMapping, Stringifier } from "./QueryStringMapping";

cassandra-distributed-task-queue-ui/src/Domain/RtqMonitoringSearchRequestUtils.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { TimeUtils } from "@skbkontur/edi-ui";
2+
13
import { RangeSelector } from "../components/DateTimeRangePicker/RangeSelector";
24

35
import { RtqMonitoringSearchRequest } from "./Api/RtqMonitoringSearchRequest";
46
import { DateTimeRange } from "./DataTypes/DateTimeRange";
5-
import { TimeUtils } from "./Utils/TimeUtils";
67

78
function isDateTimeRangeEmpty(range: Nullable<DateTimeRange>): boolean {
89
return !(range && (range.lowerBound || range.upperBound));
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import Decimal from "decimal.js";
22

3-
export function ticksToMilliseconds(timeStr: Nullable<string>): Nullable<string> {
3+
export const ticksToMilliseconds = (timeStr: Nullable<string>): Nullable<string> => {
44
if (!timeStr) {
55
return null;
66
}
77
const commonTime = new Decimal(timeStr);
88
return commonTime.div(10000).toString();
9-
}
9+
};

cassandra-distributed-task-queue-ui/src/Domain/Utils/DateUtils.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

cassandra-distributed-task-queue-ui/src/Domain/Utils/StringUtils.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)