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