Fix #8993 Add Datainsight ingestion option available even after a pipeline already running (#9075)

* Fix #8993 Add Datainsight ingestion option available even after a pipeline already running

* Remove tailwind class

* Remove tailwind

* refactor : the code to check if Data InSight Ingestion Exists
This commit is contained in:
Sachin Chaurasiya 2022-11-30 23:14:31 +05:30 committed by GitHub
parent ee21654342
commit 317a8f1711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View File

@ -252,6 +252,14 @@ const Ingestion: React.FC<IngestionProps> = ({
}
};
const isDataSightIngestionExists = useMemo(
() =>
ingestionData.some(
(ingestion) => ingestion.pipelineType === PipelineType.DataInsight
),
[ingestionData]
);
const getAddIngestionButton = (type: PipelineType) => {
return (
<Button
@ -297,6 +305,10 @@ const Ingestion: React.FC<IngestionProps> = ({
<DropDownList
horzPosRight
dropDownList={types.map((type) => ({
disabled:
type === PipelineType.DataInsight
? isDataSightIngestionExists
: false,
name: `${t('label.add')} ${startCase(type)} ${
type === PipelineType.ElasticSearchReindex
? ''

View File

@ -137,10 +137,11 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
<div
aria-disabled={item.disabled as boolean}
className={classNames(
'tw-text-gray-700 tw-flex tw-px-4 tw-py-2 tw-text-sm hover:tw-bg-body-hover tw-cursor-pointer',
'text-body flex px-4 py-2 text-sm hover:tw-bg-body-hover',
!isNil(value) && item.value === value ? 'tw-bg-primary-lite' : null,
{
'tw-cursor-not-allowed': item.disabled,
'opacity-60 cursor-not-allowed': item.disabled,
'cursor-pointer': !item.disabled,
}
)}
data-testid="list-item"

View File

@ -417,6 +417,17 @@
.p-b-lg {
padding-bottom: @padding-lg;
}
.px-4 {
padding-left: @padding-md;
padding-right: @padding-md;
}
.py-2 {
padding-top: @padding-xs;
padding-bottom: @padding-xs;
}
.take-to-right {
position: absolute;
right: 15px;