-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: #11346 Add UI Support to Add Custom Profiler Metrics #14132
Conversation
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
- Add - Edit - Delete table and column custom metric
- NoProfilerBanner - CustomMetricGraphs
const addButtonContent = [ | ||
{ | ||
label: <TabsLabel id="test-case" name={t('label.test-case')} />, | ||
key: '1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key: '1', | |
key: 'test-case', |
}, | ||
{ | ||
label: <TabsLabel id="metric" name={t('label.custom-metric')} />, | ||
key: '2', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key: '2', | |
key: 'custom-metric', |
...ta-ui/src/main/resources/ui/src/components/TableProfiler/QualityTab/QualityTab.component.tsx
Show resolved
Hide resolved
const testCaseTypeOption = useMemo(() => { | ||
const testCaseStatus: DefaultOptionType[] = map(TestType, (value, key) => ({ | ||
label: key, | ||
value: value, | ||
})); | ||
testCaseStatus.unshift({ | ||
label: t('label.all'), | ||
value: '', | ||
}); | ||
|
||
return testCaseStatus; | ||
}, []); | ||
|
||
const testCaseStatusOption = useMemo(() => { | ||
const testCaseStatus: DefaultOptionType[] = Object.values( | ||
TestCaseStatus | ||
).map((value) => ({ | ||
label: value, | ||
value: value, | ||
})); | ||
testCaseStatus.unshift({ | ||
label: t('label.all'), | ||
value: '', | ||
}); | ||
|
||
return testCaseStatus; | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have this things as const to execute it only once and use it across
); | ||
|
||
return searchData as { activeTab: string; activeColumnFqn: string }; | ||
}, [location.search, isTourOpen]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please import location
from useLocation
export const TableProfilerContext = createContext<TableProfilerContextType>( | ||
{} as TableProfilerContextType | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface
); | ||
|
||
return searchData as { activeTab: string; activeColumnFqn: string }; | ||
}, [location.search, isTourOpen]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import location
from useLocation
const isColumnProfile = activeTab === TableProfilerTab.COLUMN_PROFILE; | ||
const isDataQuality = activeTab === TableProfilerTab.DATA_QUALITY; | ||
const isTableProfile = activeTab === TableProfilerTab.TABLE_PROFILE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
// As we are encoding the fqn in API function to apply all over the application | ||
// and the datasetFQN comes form url parameter which is already encoded, | ||
// we are decoding FQN below to avoid double encoding in the API function | ||
const decodedDatasetFQN = decodeURIComponent(datasetFQN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const decodedDatasetFQN = decodeURIComponent(datasetFQN); | |
const decodedDatasetFQN = getDecodedFQN(datasetFQN); |
@@ -63,6 +63,8 @@ const DeleteWidgetModal = ({ | |||
afterDeleteAction, | |||
successMessage, | |||
deleteOptions, | |||
onDelete, | |||
loading = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why loading for Modal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's for the submit button, as we are also providing an option for onDelete, we also need to provide a loading option for that.
[open-metadata-ui] Kudos, SonarCloud Quality Gate passed! |
const fetchProfiler = | ||
!isTableDeleted && | ||
datasetFQN && | ||
!isTourOpen && | ||
[ | ||
TableProfilerTab.TABLE_PROFILE, | ||
TableProfilerTab.COLUMN_PROFILE, | ||
].includes(activeTab) && | ||
isUndefined(tableProfiler); | ||
|
||
if (fetchProfiler) { | ||
fetchLatestProfilerData(); | ||
} else { | ||
setIsProfilerDataLoading(false); | ||
} | ||
if (isTourOpen) { | ||
setTableProfiler(mockDatasetData.tableDetails as unknown as Table); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this conditions?
const fetchTest = | ||
viewTest && | ||
!isTourOpen && | ||
[TableProfilerTab.DATA_QUALITY, TableProfilerTab.COLUMN_PROFILE].includes( | ||
activeTab | ||
) && | ||
isEmpty(allTestCases); | ||
|
||
if (fetchTest) { | ||
fetchAllTests(); | ||
} else { | ||
setIsTestsLoading(false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this too
…cs (open-metadata#14132) * open-metadata#11346 Add UI Support to Add Custom Profiler Metrics * fixed failing unit test * fixed loading issue and added no profiler banner in column profile component * create context provider and removed all the common props to context * fixed failing unit test * miner fixes * added view part of custom metrics * added: - Edit action - Delete action - Basic structure of add form * translation * work on create custom metric for table and column. * refactor structure in addCustomMetric page * fixed failing unit test * fixed failing cypress test and added create custom metric cypress test * added cypress test for custom metric covered below scenarios - Add - Edit - Delete table and column custom metric * added unit test for customMetricForm * added unit test for - NoProfilerBanner - CustomMetricGraphs * unit test for addCustomMetricPage * added unit test for utils file * fixed failing unit test * fixed encoding issue * addressing comments
fixs #11346
Screen.Recording.2023-12-05.at.6.06.58.PM.mov
Screen.Recording.2023-12-05.at.6.08.36.PM.mov
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>