-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): supported stored procedure in database (#13031)
* feat: supported stored procedure in database * minor fixes * fix sonar * optimize stored procedure code and supported deleted flag for it * feat(ui): supported code and activity tab in stored procedure (#13054) * supported code and activity tab in stored procedure * added support for task functionality * feat(ui): supported lineage tab in stored procedure (#13060) * supported code and activity tab in stored procedure * added support for task functionality * feat: supported lineage tab in stored procedure * feat(ui): supported custom property tab in stored procedure and setting page (#13063) * feat: supported custom property tab in stored procedure and setting page * added extension field * chanegs as per comments * chanegs as per comments
- Loading branch information
1 parent
db592a1
commit fe7f282
Showing
37 changed files
with
1,578 additions
and
6 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
openmetadata-ui/src/main/resources/ui/src/assets/svg/ic-stored-procedure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
132 changes: 132 additions & 0 deletions
132
...ts/Explore/EntitySummaryPanel/StoredProcedureSummary/StoredProcedureSummary.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,132 @@ | ||
/* | ||
* 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, Divider, Row, Typography } from 'antd'; | ||
import classNames from 'classnames'; | ||
import SummaryTagsDescription from 'components/common/SummaryTagsDescription/SummaryTagsDescription.component'; | ||
import SchemaEditor from 'components/schema-editor/SchemaEditor'; | ||
import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component'; | ||
import { CSMode } from 'enums/codemirror.enum'; | ||
import { ExplorePageTabs } from 'enums/Explore.enum'; | ||
import { StoredProcedureCodeObject } from 'generated/entity/data/storedProcedure'; | ||
import { isObject } from 'lodash'; | ||
import React, { useMemo } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Link } from 'react-router-dom'; | ||
import { | ||
DRAWER_NAVIGATION_OPTIONS, | ||
getEntityOverview, | ||
} from 'utils/EntityUtils'; | ||
import { StoredProcedureSummaryProps } from './StoredProcedureSummary.interface'; | ||
|
||
const StoredProcedureSummary = ({ | ||
entityDetails, | ||
componentType = DRAWER_NAVIGATION_OPTIONS.explore, | ||
tags, | ||
isLoading, | ||
}: StoredProcedureSummaryProps) => { | ||
const { t } = useTranslation(); | ||
|
||
const entityInfo = useMemo( | ||
() => getEntityOverview(ExplorePageTabs.STORED_PROCEDURE, entityDetails), | ||
[entityDetails] | ||
); | ||
|
||
return ( | ||
<SummaryPanelSkeleton loading={isLoading}> | ||
<> | ||
<Row className="m-md" gutter={[0, 4]}> | ||
<Col span={24}> | ||
<Row gutter={[0, 4]}> | ||
{entityInfo.map((info) => { | ||
const isOwner = info.name === t('label.owner'); | ||
|
||
return info.visible?.includes(componentType) ? ( | ||
<Col key={info.name} span={24}> | ||
<Row | ||
className={classNames('', { | ||
'p-b-md': isOwner, | ||
})} | ||
gutter={[16, 32]}> | ||
{!isOwner ? ( | ||
<Col data-testid={`${info.name}-label`} span={8}> | ||
<Typography.Text className="text-grey-muted"> | ||
{info.name} | ||
</Typography.Text> | ||
</Col> | ||
) : null} | ||
<Col data-testid={`${info.name}-value`} span={16}> | ||
{info.isLink ? ( | ||
<Link | ||
component={Typography.Link} | ||
target="_self" | ||
to={{ pathname: info.url }}> | ||
{info.value} | ||
</Link> | ||
) : ( | ||
<Typography.Text | ||
className={classNames('text-grey-muted', { | ||
'text-grey-body': !isOwner, | ||
})}> | ||
{info.value} | ||
</Typography.Text> | ||
)} | ||
</Col> | ||
</Row> | ||
</Col> | ||
) : null; | ||
})} | ||
</Row> | ||
</Col> | ||
</Row> | ||
|
||
<Divider className="m-y-xs" /> | ||
|
||
<SummaryTagsDescription | ||
entityDetail={entityDetails} | ||
tags={tags ?? []} | ||
/> | ||
<Divider className="m-y-xs" /> | ||
|
||
{isObject(entityDetails.storedProcedureCode) && ( | ||
<Row className="m-md" gutter={[0, 8]}> | ||
<Col span={24}> | ||
<Typography.Text | ||
className="text-base text-grey-muted" | ||
data-testid="column-header"> | ||
{t('label.code')} | ||
</Typography.Text> | ||
</Col> | ||
<Col span={24}> | ||
<SchemaEditor | ||
editorClass="custom-code-mirror-theme custom-query-editor" | ||
mode={{ name: CSMode.SQL }} | ||
options={{ | ||
styleActiveLine: false, | ||
readOnly: 'nocursor', | ||
}} | ||
value={ | ||
( | ||
entityDetails.storedProcedureCode as StoredProcedureCodeObject | ||
).code ?? '' | ||
} | ||
/> | ||
</Col> | ||
</Row> | ||
)} | ||
</> | ||
</SummaryPanelSkeleton> | ||
); | ||
}; | ||
|
||
export default StoredProcedureSummary; |
22 changes: 22 additions & 0 deletions
22
...nts/Explore/EntitySummaryPanel/StoredProcedureSummary/StoredProcedureSummary.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 { StoredProcedure } from 'generated/entity/data/storedProcedure'; | ||
import { TagLabel } from 'generated/type/tagLabel'; | ||
|
||
export interface StoredProcedureSummaryProps { | ||
entityDetails: StoredProcedure; | ||
componentType?: string; | ||
tags?: TagLabel[]; | ||
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
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
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.