mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-17 03:38:18 +00:00
* fix(#9775): UI - Teams owner can only be another user not another team * fix:cy tests
This commit is contained in:
parent
7f111584b8
commit
4bf60bd2f4
@ -805,7 +805,7 @@ export const deleteCreatedProperty = (propertyName) => {
|
||||
.should('be.visible');
|
||||
};
|
||||
|
||||
export const updateOwner = () => {
|
||||
export const updateOwner = (isAddingOwnerToTeam = false) => {
|
||||
cy.get('[data-testid="avatar"]').should('be.visible').click();
|
||||
cy.get('[data-testid="user-name"]')
|
||||
.should('exist')
|
||||
@ -822,12 +822,14 @@ export const updateOwner = () => {
|
||||
|
||||
verifyResponseStatusCode('@getTeams', 200);
|
||||
|
||||
// Clicking on users tab
|
||||
cy.get('button[data-testid="dropdown-tab"]')
|
||||
.should('exist')
|
||||
.should('be.visible')
|
||||
.contains('Users')
|
||||
.click();
|
||||
if (!isAddingOwnerToTeam) {
|
||||
// Clicking on users tab
|
||||
cy.get('button[data-testid="dropdown-tab"]')
|
||||
.should('exist')
|
||||
.should('be.visible')
|
||||
.contains('Users')
|
||||
.click();
|
||||
}
|
||||
|
||||
cy.get('[data-testid="list-item"]')
|
||||
.first()
|
||||
|
@ -74,7 +74,7 @@ describe('Teams flow should work properly', () => {
|
||||
cy.get(`[data-row-key="${TEAM_DETAILS.name}"]`)
|
||||
.contains(TEAM_DETAILS.name)
|
||||
.click();
|
||||
updateOwner();
|
||||
updateOwner(true);
|
||||
});
|
||||
|
||||
it('Add user to created team', () => {
|
||||
|
@ -1119,6 +1119,7 @@ const TeamDetailsV1 = ({
|
||||
{extraInfo.map((info, index) => (
|
||||
<Fragment key={uniqueId()}>
|
||||
<EntitySummaryDetails
|
||||
allowTeamOwner={false}
|
||||
currentOwner={currentTeam.owner}
|
||||
data={info}
|
||||
isGroupType={isGroupType}
|
||||
|
@ -45,6 +45,7 @@ export interface GetInfoElementsProps {
|
||||
currentOwner?: Dashboard['owner'];
|
||||
removeTier?: () => void;
|
||||
deleted?: boolean;
|
||||
allowTeamOwner?: boolean;
|
||||
}
|
||||
|
||||
const EditIcon = ({ iconClasses }: { iconClasses?: string }): JSX.Element => (
|
||||
@ -80,6 +81,7 @@ const EntitySummaryDetails = ({
|
||||
removeTier,
|
||||
currentOwner,
|
||||
deleted = false,
|
||||
allowTeamOwner = true,
|
||||
}: GetInfoElementsProps) => {
|
||||
let retVal = <></>;
|
||||
const { t } = useTranslation();
|
||||
@ -360,6 +362,7 @@ const EntitySummaryDetails = ({
|
||||
</>
|
||||
)}
|
||||
<OwnerWidgetWrapper
|
||||
allowTeamOwner={allowTeamOwner}
|
||||
currentUser={currentOwner}
|
||||
hideWidget={() => setShow(false)}
|
||||
removeOwner={removeOwner}
|
||||
|
@ -204,9 +204,9 @@ const OwnerWidgetWrapper = ({
|
||||
}
|
||||
}, [searchText]);
|
||||
|
||||
const getOwnerGroup = () => {
|
||||
const ownerGroupList = useMemo(() => {
|
||||
return allowTeamOwner ? ['Teams', 'Users'] : ['Users'];
|
||||
};
|
||||
}, [allowTeamOwner]);
|
||||
|
||||
const handleSearchOwnerDropdown = (text: string) => {
|
||||
setSearchText(text);
|
||||
@ -237,9 +237,9 @@ const OwnerWidgetWrapper = ({
|
||||
controlledSearchStr={searchText}
|
||||
dropDownList={listOwners}
|
||||
getTotalCountForGroup={handleTotalCountForGroup}
|
||||
groupType="tab"
|
||||
groupType={ownerGroupList.length > 1 ? 'tab' : 'label'}
|
||||
isLoading={isUserLoading}
|
||||
listGroups={getOwnerGroup()}
|
||||
listGroups={ownerGroupList}
|
||||
removeOwner={handleRemoveOwner}
|
||||
showSearchBar={isCurrentUserAdmin()}
|
||||
value={owner?.id || ''}
|
||||
|
Loading…
x
Reference in New Issue
Block a user