diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/img/ss-landing.png b/openmetadata-ui/src/main/resources/ui/src/assets/img/ss-landing.png index 47ad65ee750..6a24cb829b4 100644 Binary files a/openmetadata-ui/src/main/resources/ui/src/assets/img/ss-landing.png and b/openmetadata-ui/src/main/resources/ui/src/assets/img/ss-landing.png differ diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx index f62328dbd34..69fd643e72d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx @@ -11,6 +11,7 @@ * limitations under the License. */ +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { AxiosResponse } from 'axios'; import classNames from 'classnames'; import { isEmpty } from 'lodash'; @@ -30,7 +31,6 @@ import { CardWithListItems } from '../card-list/CardListItem/CardWithListItems.i import NonAdminAction from '../common/non-admin-action/NonAdminAction'; import DropDownList from '../dropdown/DropDownList'; import Loader from '../Loader/Loader'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; type Props = { currentTier?: string; @@ -41,6 +41,7 @@ type Props = { tier: TableDetail['tier'] ) => Promise; hasEditAccess: boolean; + allowTeamOwner?: boolean; }; const ManageTab: FunctionComponent = ({ @@ -49,6 +50,7 @@ const ManageTab: FunctionComponent = ({ hideTier = false, onSave, hasEditAccess, + allowTeamOwner = true, }: Props) => { const { userPermissions } = useAuth(); const { isAuthDisabled } = useAuthContext(); @@ -121,6 +123,10 @@ const ManageTab: FunctionComponent = ({ return listOwners.find((item) => item.value === owner)?.name || ''; }; + const getOwnerGroup = () => { + return allowTeamOwner ? ['Teams', 'Users'] : ['Users']; + }; + const handleOwnerSelection = ( _e: React.MouseEvent, value?: string @@ -295,7 +301,7 @@ const ManageTab: FunctionComponent = ({ showSearchBar dropDownList={listOwners} groupType="tab" - listGroups={['Teams', 'Users']} + listGroups={getOwnerGroup()} value={owner} onSelect={handleOwnerSelection} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDownList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDownList.tsx index bda8aa77cf9..2155791a122 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDownList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDownList.tsx @@ -179,7 +179,7 @@ const DropDownList: FunctionComponent = ({ )} {groupType === 'tab' && ( -
+
{listGroups.map((grp, index) => { return ( +
); @@ -531,6 +565,33 @@ const TeamsPage = () => { return uniqueList; }; + const handleUpdateOwner = (owner: Team['owner']) => { + const updatedTeam = { + ...currentTeam, + owner, + }; + const jsonPatch = compare(currentTeam as Team, updatedTeam); + + return new Promise((_, reject) => { + patchTeamDetail(currentTeam?.id, jsonPatch) + .then((res: AxiosResponse) => { + fetchCurrentTeam(res.data.name, true); + }) + .catch((err: AxiosError) => { + reject(); + const message = err.response?.data?.message; + showToast({ + variant: 'error', + body: + message ?? + `${jsonData['api-error-messages']['update-owner-error']} for ${ + currentTeam?.displayName ?? currentTeam?.name + }`, + }); + }); + }); + }; + useEffect(() => { setUserList(AppState.users); }, [AppState.users]); @@ -549,90 +610,132 @@ const TeamsPage = () => { {error ? ( ) : ( - - + + {isLoading ? ( ) : ( -
+
{teams.length > 0 ? ( - <> -
+
+
- {currentTeam?.displayName ?? currentTeam?.name} + className="tw-flex tw-justify-between tw-items-center" + data-testid="header"> +
+ {currentTeam?.displayName ?? currentTeam?.name} +
+
+ + You do not have permission to update the team. + + } + isOwner={isOwner()} + permission={Operation.UpdateTeam} + position="bottom"> + + + + You do not have permission to delete the team. + + } + isOwner={isOwner()} + position="bottom"> + + +
-
- You do not have permission to update the team. +
+ {extraInfo.map((info, index) => ( + + {getInfoElements(info)} + {extraInfo.length !== 1 && + index < extraInfo.length - 1 ? ( + + | + + ) : null} + + ))} +
+
+ - - - You do not have permission to delete the team. - } - position="bottom"> - - + isEdit={isEditable} + onCancel={onCancel} + onDescriptionEdit={onDescriptionEdit} + onDescriptionUpdate={onDescriptionUpdate} + /> +
+ +
+ {getTabs()} + +
+ {currentTab === 1 && getUserCards()} + + {currentTab === 2 && getDatasetCards()} + + {currentTab === 3 && getDefaultRoles()} + + {currentTab === 4 && ( + + )}
-
- -
- - {getTabs()} - - {currentTab === 1 && getUserCards()} - - {currentTab === 2 && getDatasetCards()} - - {currentTab === 3 && getDefaultRoles()} {isAddingUsers && ( { onSave={(data) => createUsers(data)} /> )} - +
) : (

No Teams Added.

diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx index 0e6740bfba3..0f103891530 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx @@ -440,7 +440,7 @@ export const getInfoElements = (data: ExtraInfo) => { <> 32, }