forked from open-metadata/OpenMetadata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: clean-up in data insight page (open-metadata#13193)
* ui: clean-up in data insight page * updated datePickerMenu with type * added option to allow/disallowed Custom Range * added icon and some utils change * refactor cost analysis page * translation * DI enum * updated di interface file * removed duplicated code * updated date picker * export the getEntryFormattedValue function * miner fix * created dataInsight provider and move all the props in to provider, created classBase file * translation sync * fixed failing unit test * fixed failing unite test
- Loading branch information
1 parent
40b3048
commit 48a892c
Showing
36 changed files
with
1,201 additions
and
679 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
openmetadata-ui/src/main/resources/ui/src/assets/svg/dollar-bag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions
48
...sources/ui/src/components/DataInsightDetail/AppAnalyticsTab/AppAnalyticsTab.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 2023 Collate. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Col, Row } from 'antd'; | ||
import React from 'react'; | ||
import { useDataInsightProvider } from '../../../pages/DataInsightPage/DataInsightProvider'; | ||
import DailyActiveUsersChart from '../DailyActiveUsersChart'; | ||
import PageViewsByEntitiesChart from '../PageViewsByEntitiesChart'; | ||
import TopActiveUsers from '../TopActiveUsers'; | ||
import TopViewEntities from '../TopViewEntities'; | ||
|
||
const AppAnalyticsTab = () => { | ||
const { chartFilter, selectedDaysFilter } = useDataInsightProvider(); | ||
|
||
return ( | ||
<Row gutter={[16, 16]}> | ||
<Col span={24}> | ||
<TopViewEntities chartFilter={chartFilter} /> | ||
</Col> | ||
<Col span={24}> | ||
<PageViewsByEntitiesChart | ||
chartFilter={chartFilter} | ||
selectedDays={selectedDaysFilter} | ||
/> | ||
</Col> | ||
<Col span={24}> | ||
<DailyActiveUsersChart | ||
chartFilter={chartFilter} | ||
selectedDays={selectedDaysFilter} | ||
/> | ||
</Col> | ||
<Col span={24}> | ||
<TopActiveUsers chartFilter={chartFilter} /> | ||
</Col> | ||
</Row> | ||
); | ||
}; | ||
|
||
export default AppAnalyticsTab; |
122 changes: 122 additions & 0 deletions
122
...n/resources/ui/src/components/DataInsightDetail/DataAssetsTab/DataAssetsTab.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/* | ||
* Copyright 2023 Collate. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Col, Row } from 'antd'; | ||
import React, { useMemo } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { DataInsightChartType } from '../../../generated/dataInsight/dataInsightChartResult'; | ||
import { useDataInsightProvider } from '../../../pages/DataInsightPage/DataInsightProvider'; | ||
import Loader from '../../Loader/Loader'; | ||
import DescriptionInsight from '../DescriptionInsight'; | ||
import OwnerInsight from '../OwnerInsight'; | ||
import TierInsight from '../TierInsight'; | ||
import TotalEntityInsight from '../TotalEntityInsight'; | ||
|
||
const DataAssetsTab = () => { | ||
const { | ||
chartFilter, | ||
selectedDaysFilter, | ||
kpi, | ||
tierTag: tier, | ||
} = useDataInsightProvider(); | ||
const { t } = useTranslation(); | ||
const { descriptionKpi, ownerKpi } = useMemo(() => { | ||
return { | ||
descriptionKpi: kpi.data.find( | ||
(value) => | ||
value.dataInsightChart.name === | ||
DataInsightChartType.PercentageOfEntitiesWithDescriptionByType | ||
), | ||
ownerKpi: kpi.data.find( | ||
(value) => | ||
value.dataInsightChart.name === | ||
DataInsightChartType.PercentageOfEntitiesWithOwnerByType | ||
), | ||
}; | ||
}, [kpi]); | ||
|
||
if (kpi.isLoading) { | ||
return <Loader />; | ||
} | ||
|
||
return ( | ||
<Row gutter={[16, 16]}> | ||
<Col span={24}> | ||
<TotalEntityInsight | ||
chartFilter={chartFilter} | ||
selectedDays={selectedDaysFilter} | ||
/> | ||
</Col> | ||
<Col span={24}> | ||
<DescriptionInsight | ||
chartFilter={chartFilter} | ||
dataInsightChartName={ | ||
DataInsightChartType.PercentageOfEntitiesWithDescriptionByType | ||
} | ||
header={t('label.data-insight-description-summary-type', { | ||
type: t('label.data-asset'), | ||
})} | ||
kpi={descriptionKpi} | ||
selectedDays={selectedDaysFilter} | ||
/> | ||
</Col> | ||
<Col span={24}> | ||
<OwnerInsight | ||
chartFilter={chartFilter} | ||
dataInsightChartName={ | ||
DataInsightChartType.PercentageOfEntitiesWithOwnerByType | ||
} | ||
header={t('label.data-insight-owner-summary-type', { | ||
type: t('label.data-asset'), | ||
})} | ||
kpi={ownerKpi} | ||
selectedDays={selectedDaysFilter} | ||
/> | ||
</Col> | ||
<Col span={24}> | ||
<DescriptionInsight | ||
chartFilter={chartFilter} | ||
dataInsightChartName={ | ||
DataInsightChartType.PercentageOfServicesWithDescription | ||
} | ||
header={t('label.data-insight-description-summary-type', { | ||
type: t('label.service'), | ||
})} | ||
kpi={descriptionKpi} | ||
selectedDays={selectedDaysFilter} | ||
/> | ||
</Col> | ||
<Col span={24}> | ||
<OwnerInsight | ||
chartFilter={chartFilter} | ||
dataInsightChartName={ | ||
DataInsightChartType.PercentageOfServicesWithOwner | ||
} | ||
header={t('label.data-insight-owner-summary-type', { | ||
type: t('label.service'), | ||
})} | ||
kpi={ownerKpi} | ||
selectedDays={selectedDaysFilter} | ||
/> | ||
</Col> | ||
<Col span={24}> | ||
<TierInsight | ||
chartFilter={chartFilter} | ||
selectedDays={selectedDaysFilter} | ||
tierTags={tier} | ||
/> | ||
</Col> | ||
</Row> | ||
); | ||
}; | ||
|
||
export default DataAssetsTab; |
22 changes: 22 additions & 0 deletions
22
...in/resources/ui/src/components/DataInsightDetail/DataAssetsTab/DataAssetsTab.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2023 Collate. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Kpi } from '../../../generated/dataInsight/kpi/kpi'; | ||
import { Tag } from '../../../generated/entity/classification/tag'; | ||
import { ChartFilter } from '../../../interface/data-insight.interface'; | ||
|
||
export interface DataAssetsTabProps { | ||
chartFilter: ChartFilter; | ||
selectedDaysFilter: number; | ||
kpiList: Kpi[]; | ||
tier: { tags: Tag[]; isLoading: boolean }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.