mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
parent
5dfcc56047
commit
523c80f695
2 changed files with 63 additions and 29 deletions
|
|
@ -31,7 +31,6 @@ export const GlobalDataSourcesPage = ({ darkMode = false, updateSelectedDatasour
|
|||
const [addingDataSource, setAddingDataSource] = useState(false);
|
||||
const [suggestingDataSource, setSuggestingDataSource] = useState(false);
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const { admin } = authenticationService.currentSessionValue;
|
||||
const marketplaceEnabled = admin && window.public_config?.ENABLE_MARKETPLACE_FEATURE == 'true';
|
||||
const [modalProps, setModalProps] = useState({
|
||||
|
|
@ -296,34 +295,6 @@ export const GlobalDataSourcesPage = ({ darkMode = false, updateSelectedDatasour
|
|||
};
|
||||
|
||||
const renderCardGroup = (source, type) => {
|
||||
if (type === 'Plugins' && source.length === 0) {
|
||||
return (
|
||||
<div className="add-plugins-container">
|
||||
<div className="warning-container mb-2">
|
||||
<SolidIcon name="warning" />
|
||||
</div>
|
||||
<div className="tj-text-sm font-weight-500 tj-text">No plugins added</div>
|
||||
{admin && (
|
||||
<>
|
||||
<div className="tj-text-xsm font-weight-400 mt-2 mb-3">
|
||||
Browse through plugins in marketplace to add them as a Data Source.{' '}
|
||||
</div>
|
||||
<ButtonSolid
|
||||
onClick={() => {
|
||||
marketplaceEnabled
|
||||
? navigate('/integrations')
|
||||
: toast.error('Please enable marketplace to add plugins');
|
||||
}}
|
||||
style={{ margin: 'auto' }}
|
||||
variant="secondary"
|
||||
>
|
||||
Add plugins
|
||||
</ButtonSolid>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const addDataSourceBtn = (item) => (
|
||||
<ButtonSolid
|
||||
disabled={addingDataSource}
|
||||
|
|
@ -366,6 +337,36 @@ export const GlobalDataSourcesPage = ({ darkMode = false, updateSelectedDatasour
|
|||
titleClassName={'datasource-card-title'}
|
||||
/>
|
||||
))}
|
||||
{type === 'Plugins' && (
|
||||
<div style={{ height: '122px', width: '164px' }} className={`col-md-2 mb-4 `}>
|
||||
<div
|
||||
className="card add-plugin-card"
|
||||
role="button"
|
||||
onClick={() => {
|
||||
if (marketplaceEnabled) {
|
||||
window.open('/integrations', '_blank');
|
||||
} else {
|
||||
toast.error('Please enable marketplace to add plugins');
|
||||
}
|
||||
}}
|
||||
data-cy={`data-source-add-plugin`}
|
||||
>
|
||||
<div className="card-body">
|
||||
<center style={{ paddingTop: '5px' }}>
|
||||
<SolidIcon
|
||||
name="plus"
|
||||
fill={'var(--icon-default)'}
|
||||
width={35}
|
||||
height={35}
|
||||
style={{ marginBottom: '8px' }}
|
||||
/>
|
||||
<br></br>
|
||||
<span className={`datasource-card-title add-plugin-card-title`}>Add plugin</span>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -300,4 +300,37 @@
|
|||
border-radius: 6px;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.add-plugin-card{
|
||||
border: 1px dashed var(--border-default, #CCD1D5);
|
||||
background-color: var(--interactive-weak);
|
||||
|
||||
&:hover{
|
||||
border: 1px dashed var(--border-strong, #CCD1D5);
|
||||
background-color: var(--interactive-default);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.add-plugin-card-title{
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: var(--text-default);
|
||||
}
|
||||
|
||||
|
||||
.dark-theme{
|
||||
.add-plugin-card{
|
||||
border: 1px dashed var(--border-default, #CCD1D5);
|
||||
background-color: var(--interactive-weak);
|
||||
|
||||
&:hover{
|
||||
border: 1px dashed var(--border-strong, #CCD1D5);
|
||||
background-color: var(--interactive-default);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue