mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-07 21:17:07 +00:00
Fix #1537 UI : Remove search from service page and reposition Add service with different service tabs. (#1538)
* Fix #1537 UI : Remove search from service page and reposition Add service with different service tabs. * Fixed name overflow issue on user card.
This commit is contained in:
parent
181e95414d
commit
5bc73ced28
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
import { AxiosError, AxiosResponse } from 'axios';
|
import { AxiosError, AxiosResponse } from 'axios';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isNil, isNull, lowerCase } from 'lodash';
|
import { isNil, isNull } from 'lodash';
|
||||||
import { Paging, ServiceCollection, ServiceData, ServiceTypes } from 'Models';
|
import { Paging, ServiceCollection, ServiceData, ServiceTypes } from 'Models';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
@ -28,7 +28,6 @@ import { Button } from '../../components/buttons/Button/Button';
|
|||||||
import NextPrevious from '../../components/common/next-previous/NextPrevious';
|
import NextPrevious from '../../components/common/next-previous/NextPrevious';
|
||||||
import NonAdminAction from '../../components/common/non-admin-action/NonAdminAction';
|
import NonAdminAction from '../../components/common/non-admin-action/NonAdminAction';
|
||||||
import RichTextEditorPreviewer from '../../components/common/rich-text-editor/RichTextEditorPreviewer';
|
import RichTextEditorPreviewer from '../../components/common/rich-text-editor/RichTextEditorPreviewer';
|
||||||
import Searchbar from '../../components/common/searchbar/Searchbar';
|
|
||||||
import PageContainer from '../../components/containers/PageContainer';
|
import PageContainer from '../../components/containers/PageContainer';
|
||||||
import Loader from '../../components/Loader/Loader';
|
import Loader from '../../components/Loader/Loader';
|
||||||
import {
|
import {
|
||||||
@ -169,17 +168,7 @@ const ServicesPage = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const handleSearchAction = (searchValue: string) => {
|
|
||||||
setSearchText(searchValue);
|
|
||||||
const curServ = services[serviceName];
|
|
||||||
const updatedResult = (curServ as unknown as Array<ServiceDataObj>).filter(
|
|
||||||
(serv) =>
|
|
||||||
lowerCase(serv.description)?.includes(lowerCase(searchValue)) ||
|
|
||||||
lowerCase(serv.name)?.includes(lowerCase(searchValue))
|
|
||||||
);
|
|
||||||
setServiceList(updatedResult);
|
|
||||||
setServicesCount({ ...servicesCount, [serviceName]: updatedResult.length });
|
|
||||||
};
|
|
||||||
const handleAddService = () => {
|
const handleAddService = () => {
|
||||||
setEditData(undefined);
|
setEditData(undefined);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
@ -480,19 +469,28 @@ const ServicesPage = () => {
|
|||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
|
<div className="tw-self-end tw-ml-auto">
|
||||||
|
{serviceList.length > 0 ? (
|
||||||
|
<NonAdminAction
|
||||||
|
position="bottom"
|
||||||
|
title={TITLE_FOR_NON_ADMIN_ACTION}>
|
||||||
|
<Button
|
||||||
|
className={classNames('tw-h-8 tw-rounded tw-mb-2', {
|
||||||
|
'tw-opacity-40': !isAdminUser && !isAuthDisabled,
|
||||||
|
})}
|
||||||
|
data-testid="add-new-user-button"
|
||||||
|
size="small"
|
||||||
|
theme="primary"
|
||||||
|
variant="contained"
|
||||||
|
onClick={() => handleAddService()}>
|
||||||
|
Add New Service
|
||||||
|
</Button>
|
||||||
|
</NonAdminAction>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div className="tw-flex">
|
{/* <div className="tw-flex">
|
||||||
<div className="tw-w-4/12">
|
|
||||||
{searchText || serviceList.length > 0 ? (
|
|
||||||
<Searchbar
|
|
||||||
placeholder={`Search for ${servicesDisplayName[serviceName]}...`}
|
|
||||||
searchValue={searchText}
|
|
||||||
typingInterval={100}
|
|
||||||
onSearch={handleSearchAction}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
<div className="tw-w-8/12 tw-flex tw-justify-end">
|
<div className="tw-w-8/12 tw-flex tw-justify-end">
|
||||||
{serviceList.length > 0 ? (
|
{serviceList.length > 0 ? (
|
||||||
<NonAdminAction
|
<NonAdminAction
|
||||||
@ -512,7 +510,7 @@ const ServicesPage = () => {
|
|||||||
</NonAdminAction>
|
</NonAdminAction>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
{serviceList.length ? (
|
{serviceList.length ? (
|
||||||
<div
|
<div
|
||||||
className="tw-grid tw-grid-cols-4 tw-gap-4 tw-mb-4"
|
className="tw-grid tw-grid-cols-4 tw-gap-4 tw-mb-4"
|
||||||
|
|||||||
@ -41,6 +41,7 @@ import { Team } from '../../generated/entity/teams/team';
|
|||||||
import { User } from '../../generated/entity/teams/user';
|
import { User } from '../../generated/entity/teams/user';
|
||||||
import { useAuth } from '../../hooks/authHooks';
|
import { useAuth } from '../../hooks/authHooks';
|
||||||
import { UserTeam } from '../../interface/team.interface';
|
import { UserTeam } from '../../interface/team.interface';
|
||||||
|
import { getNameFromEmail } from '../../utils/AuthProvider.util';
|
||||||
import { getCountBadge } from '../../utils/CommonUtils';
|
import { getCountBadge } from '../../utils/CommonUtils';
|
||||||
import SVGIcons from '../../utils/SvgUtils';
|
import SVGIcons from '../../utils/SvgUtils';
|
||||||
import AddUsersModal from './AddUsersModal';
|
import AddUsersModal from './AddUsersModal';
|
||||||
@ -214,7 +215,7 @@ const TeamsPage = () => {
|
|||||||
{currentTeam?.users?.map((user, index) => {
|
{currentTeam?.users?.map((user, index) => {
|
||||||
const User = {
|
const User = {
|
||||||
description: user.displayName || user.name || '',
|
description: user.displayName || user.name || '',
|
||||||
name: user.name || '',
|
name: getNameFromEmail(user.name || '') || '',
|
||||||
id: user.id,
|
id: user.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -345,7 +346,7 @@ const TeamsPage = () => {
|
|||||||
description: user.displayName || '',
|
description: user.displayName || '',
|
||||||
id: user.id,
|
id: user.id,
|
||||||
href: user.href,
|
href: user.href,
|
||||||
name: user.name,
|
name: getNameFromEmail(user.name),
|
||||||
type: 'user',
|
type: 'user',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user