Compare commits
No commits in common. "d8f56b8c34d509d8fb8a181d53f9f7bb94b6d251" and "8479b6d68ddf7e0fbd47b390926ee627f12e77ec" have entirely different histories.
d8f56b8c34
...
8479b6d68d
5 changed files with 62 additions and 128 deletions
|
|
@ -43,8 +43,6 @@ export class CalendarWidgetDataLoaderService
|
||||||
load(
|
load(
|
||||||
dataLoaderParams: any,
|
dataLoaderParams: any,
|
||||||
dashboardParams: any,
|
dashboardParams: any,
|
||||||
dashboardId: string,
|
|
||||||
widgetId: string,
|
|
||||||
): Promise<Result<any, AppError>> {
|
): Promise<Result<any, AppError>> {
|
||||||
// TODO: Логика для загрузки данных
|
// TODO: Логика для загрузки данных
|
||||||
throw new Error('Method not implemented.');
|
throw new Error('Method not implemented.');
|
||||||
|
|
@ -71,9 +69,6 @@ export class CalendarWidgetDataLoaderService
|
||||||
|
|
||||||
async load(
|
async load(
|
||||||
dataLoaderParams: DataLoaderParams,
|
dataLoaderParams: DataLoaderParams,
|
||||||
dashboardParams: any,
|
|
||||||
dashboardId: string,
|
|
||||||
widgetId: string,
|
|
||||||
): Promise<Result<IssueAndEvent[], AppError>> {
|
): Promise<Result<IssueAndEvent[], AppError>> {
|
||||||
let data: IssueAndEvent[];
|
let data: IssueAndEvent[];
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
46
frontend/package-lock.json
generated
46
frontend/package-lock.json
generated
|
|
@ -26,7 +26,6 @@
|
||||||
"react-router-dom": "^6.11.1",
|
"react-router-dom": "^6.11.1",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"uuid": "^11.0.5",
|
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
@ -14050,9 +14049,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react": {
|
"node_modules/react": {
|
||||||
"version": "18.3.1",
|
"version": "18.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
|
||||||
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
|
"integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"loose-envify": "^1.1.0"
|
"loose-envify": "^1.1.0"
|
||||||
},
|
},
|
||||||
|
|
@ -15110,14 +15109,6 @@
|
||||||
"websocket-driver": "^0.7.4"
|
"websocket-driver": "^0.7.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sockjs/node_modules/uuid": {
|
|
||||||
"version": "8.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
|
||||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
|
||||||
"bin": {
|
|
||||||
"uuid": "dist/bin/uuid"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/source-list-map": {
|
"node_modules/source-list-map": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
|
||||||
|
|
@ -16151,15 +16142,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/uuid": {
|
"node_modules/uuid": {
|
||||||
"version": "11.0.5",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==",
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
"funding": [
|
|
||||||
"https://github.com/sponsors/broofa",
|
|
||||||
"https://github.com/sponsors/ctavan"
|
|
||||||
],
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"uuid": "dist/esm/bin/uuid"
|
"uuid": "dist/bin/uuid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/v8-to-istanbul": {
|
"node_modules/v8-to-istanbul": {
|
||||||
|
|
@ -26972,9 +26959,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react": {
|
"react": {
|
||||||
"version": "18.3.1",
|
"version": "18.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
|
||||||
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
|
"integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"loose-envify": "^1.1.0"
|
"loose-envify": "^1.1.0"
|
||||||
}
|
}
|
||||||
|
|
@ -27740,13 +27727,6 @@
|
||||||
"faye-websocket": "^0.11.3",
|
"faye-websocket": "^0.11.3",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"websocket-driver": "^0.7.4"
|
"websocket-driver": "^0.7.4"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"uuid": {
|
|
||||||
"version": "8.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
|
||||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"source-list-map": {
|
"source-list-map": {
|
||||||
|
|
@ -28516,9 +28496,9 @@
|
||||||
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
|
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
|
||||||
},
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "11.0.5",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA=="
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
},
|
},
|
||||||
"v8-to-istanbul": {
|
"v8-to-istanbul": {
|
||||||
"version": "8.1.1",
|
"version": "8.1.1",
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"react-router-dom": "^6.11.1",
|
"react-router-dom": "^6.11.1",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"uuid": "^11.0.5",
|
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import * as DashboardStoreNs from '../dashboard-store';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { DebugInfo } from '../../misc-components/debug-info';
|
import { DebugInfo } from '../../misc-components/debug-info';
|
||||||
import { Instance, onSnapshot, types } from 'mobx-state-tree';
|
import { Instance, onSnapshot, types } from 'mobx-state-tree';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
|
|
||||||
export const DailyEccmV2Data = types.model({
|
export const DailyEccmV2Data = types.model({
|
||||||
id: types.string,
|
id: types.string,
|
||||||
|
|
@ -28,47 +27,6 @@ export const DailyEccmV2Store = types
|
||||||
|
|
||||||
export type IDailyEccmV2Store = Instance<typeof DailyEccmV2Store>;
|
export type IDailyEccmV2Store = Instance<typeof DailyEccmV2Store>;
|
||||||
|
|
||||||
const SimpleCounterViewComponent = (props: {
|
|
||||||
key?: string;
|
|
||||||
label: string;
|
|
||||||
count: number;
|
|
||||||
issueIds?: number[];
|
|
||||||
detailsLabel?: string;
|
|
||||||
details?: Record<string, number>;
|
|
||||||
}): JSX.Element => {
|
|
||||||
let detailsHintComponent = <></>;
|
|
||||||
if (props.details) {
|
|
||||||
const parentKey = props.key
|
|
||||||
? props.key
|
|
||||||
: `simple-counter-component-${uuidv4()}`;
|
|
||||||
const detailsKey = `${parentKey}-details`;
|
|
||||||
detailsHintComponent = (
|
|
||||||
<DetailsHintViewComponent
|
|
||||||
key={detailsKey}
|
|
||||||
mainLabel={props.detailsLabel ?? 'Details'}
|
|
||||||
details={props.details}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<span key={props.key}>
|
|
||||||
{props.label}: {props.count} {detailsHintComponent}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const DetailsHintViewComponent = (props: {
|
|
||||||
key?: string;
|
|
||||||
mainLabel: string;
|
|
||||||
details: Record<string, number>;
|
|
||||||
}): JSX.Element => {
|
|
||||||
return (
|
|
||||||
<span key={props.key} style={{ marginLeft: '10px', color: 'lightgray' }}>
|
|
||||||
({props.mainLabel}: {JSON.stringify(props.details)})
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const DailyEccmV2 = observer(
|
export const DailyEccmV2 = observer(
|
||||||
(props: { store: IDailyEccmV2Store }): JSX.Element => {
|
(props: { store: IDailyEccmV2Store }): JSX.Element => {
|
||||||
const dashboardId = props.store?.data?.dashboardId;
|
const dashboardId = props.store?.data?.dashboardId;
|
||||||
|
|
@ -84,55 +42,61 @@ export const DailyEccmV2 = observer(
|
||||||
|
|
||||||
const byStatusLi: JSX.Element[] = [];
|
const byStatusLi: JSX.Element[] = [];
|
||||||
|
|
||||||
Object.keys(issuesByStatusCount).forEach((statusName) => {
|
Object.keys(issuesByStatusCount).forEach((status) => {
|
||||||
const byStatusData = issuesByStatusCount[statusName];
|
let byStatusHint: JSX.Element;
|
||||||
const keyPrefixForCurrentStatusBlock = `${keyPrefix}-issuesByStatusCount-${statusName}`;
|
const byVersion = issuesByStatusCount[status]?.byVersion;
|
||||||
|
const keyPrefixForCurrentStatusBlock = `${keyPrefix}-issuesByStatusCount-${status}`;
|
||||||
|
if (byVersion && Object.keys(byVersion).length > 0) {
|
||||||
|
const byVersionSimple = Object.keys(byVersion).reduce(
|
||||||
|
(acc: Record<string, number>, version) => {
|
||||||
|
acc[version] = byVersion[version].count;
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{} as Record<string, number>,
|
||||||
|
);
|
||||||
|
byStatusHint = (
|
||||||
|
<span
|
||||||
|
key={`${keyPrefixForCurrentStatusBlock}-byVersionHint`}
|
||||||
|
style={{ marginLeft: '10px', color: 'lightgray' }}
|
||||||
|
>
|
||||||
|
(Версии: {JSON.stringify(byVersionSimple)})
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
byStatusHint = <></>;
|
||||||
|
}
|
||||||
byStatusLi.push(
|
byStatusLi.push(
|
||||||
<li key={`${keyPrefixForCurrentStatusBlock}-li`}>
|
<li key={`${keyPrefixForCurrentStatusBlock}`}>
|
||||||
<SimpleCounterViewComponent
|
{status}: {issuesByStatusCount[status].count} {byStatusHint}
|
||||||
key={`${keyPrefixForCurrentStatusBlock}`}
|
|
||||||
label={statusName}
|
|
||||||
count={byStatusData.count}
|
|
||||||
issueIds={byStatusData.issueIds}
|
|
||||||
details={byStatusData.byVersion}
|
|
||||||
detailsLabel="Версии"
|
|
||||||
/>
|
|
||||||
</li>,
|
</li>,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const byVersionsLi: JSX.Element[] = [];
|
const byVersionsLi: JSX.Element[] = [];
|
||||||
|
|
||||||
Object.keys(issuesByVersionsCount).forEach((versionName) => {
|
Object.keys(issuesByVersionsCount).forEach((version) => {
|
||||||
const byVersionData = issuesByVersionsCount[versionName];
|
const byStatus = issuesByVersionsCount[version].byStatus;
|
||||||
const keyPrefixForCurrentVersionBlock = `${keyPrefix}-issuesByVersionCount-${versionName}`;
|
const keyPrefixForCurrentVersionBlock = `${keyPrefix}-issuesByVersionsCount-${version}`;
|
||||||
|
|
||||||
|
let byStatusHint: JSX.Element = <></>;
|
||||||
|
if (byStatus && Object.keys(byStatus).length > 0) {
|
||||||
|
const byStatusSimple = Object.keys(byStatus).reduce((acc, status) => {
|
||||||
|
acc[status] = byStatus[status].count;
|
||||||
|
return acc;
|
||||||
|
}, {} as Record<string, number>);
|
||||||
|
byStatusHint = (
|
||||||
|
<span
|
||||||
|
style={{ marginLeft: '10px', color: 'lightgray' }}
|
||||||
|
key={`${keyPrefixForCurrentVersionBlock}-byStatusHint`}
|
||||||
|
>
|
||||||
|
(Статусы: {JSON.stringify(byStatusSimple)})
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
byVersionsLi.push(
|
byVersionsLi.push(
|
||||||
<li key={`${keyPrefixForCurrentVersionBlock}-li`}>
|
<li key={keyPrefixForCurrentVersionBlock}>
|
||||||
<SimpleCounterViewComponent
|
{version}: {issuesByVersionsCount[version].count} {byStatusHint}
|
||||||
key={keyPrefixForCurrentVersionBlock}
|
|
||||||
label={versionName}
|
|
||||||
count={byVersionData.count}
|
|
||||||
issueIds={byVersionData.issueIds}
|
|
||||||
details={byVersionData.byStatus}
|
|
||||||
detailsLabel="Статусы"
|
|
||||||
/>
|
|
||||||
</li>,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const byUsersLi: JSX.Element[] = [];
|
|
||||||
|
|
||||||
Object.keys(issuesByUsername).forEach((username) => {
|
|
||||||
const byUserNameData = issuesByUsername[username];
|
|
||||||
const keyPrefixForCurrentUserBlock = `${keyPrefix}-issuesByUsername-${username}`;
|
|
||||||
byUsersLi.push(
|
|
||||||
<li key={`${keyPrefixForCurrentUserBlock}-li`}>
|
|
||||||
<SimpleCounterViewComponent
|
|
||||||
key={keyPrefixForCurrentUserBlock}
|
|
||||||
label={username}
|
|
||||||
count={byUserNameData.count}
|
|
||||||
issueIds={byUserNameData.issueIds}
|
|
||||||
/>
|
|
||||||
</li>,
|
</li>,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
@ -154,10 +118,6 @@ export const DailyEccmV2 = observer(
|
||||||
По версиям:
|
По версиям:
|
||||||
<ul>{byVersionsLi}</ul>
|
<ul>{byVersionsLi}</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
По работникам:
|
|
||||||
<ul>{byUsersLi}</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -184,9 +184,9 @@ export class DailyEccmV2ReportTaskRunnerService {
|
||||||
if (version) {
|
if (version) {
|
||||||
if (!acc[status].byVersion[version]) {
|
if (!acc[status].byVersion[version]) {
|
||||||
acc[status].byVersion[version] = { count: 0, issueIds: [] };
|
acc[status].byVersion[version] = { count: 0, issueIds: [] };
|
||||||
|
acc[status].byVersion[version].count++;
|
||||||
|
acc[status].byVersion[version].issueIds.push(issue.id);
|
||||||
}
|
}
|
||||||
acc[status].byVersion[version].count++;
|
|
||||||
acc[status].byVersion[version].issueIds.push(issue.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue