comment out app installation/configuration button

This commit is contained in:
Maarten de Waard 2022-10-05 11:47:53 +02:00
parent bb1adc8d76
commit fef455074a
No known key found for this signature in database
GPG key ID: 1D3E893A657CC8DA

View file

@ -75,37 +75,42 @@ export const Apps: React.FC = () => {
},
width: 'auto',
},
{
Header: ' ',
Cell: (e: any) => {
const navigate = useNavigate();
const appStatus = e.cell.row.original.status as AppStatusEnum;
if (appStatus === AppStatusEnum.Installing) {
return null;
}
const { slug } = e.cell.row.original;
let buttonFuntion = () => navigate(`/apps/${slug}`);
if (appStatus === AppStatusEnum.NotInstalled) {
buttonFuntion = () => {
setAppSlug(slug);
setInstallModalOpen(true);
};
}
return (
<div className="text-right opacity-0 group-hover:opacity-100 transition-opacity">
<button
onClick={buttonFuntion}
type="button"
className="inline-flex items-center px-4 py-2 border border-gray-200 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500"
>
{getConstForStatus(appStatus, 'buttonIcon')}
{getConstForStatus(appStatus, 'buttonTitle')}
</button>
</div>
);
},
width: 'auto',
},
// Uncomment this to have an "Install" or "Configure" button for
// applications.
//
// We need to implement installation and configuration in the back-end to be
// able to use those buttons.
// {
// Header: ' ',
// Cell: (e: any) => {
// const navigate = useNavigate();
// const appStatus = e.cell.row.original.status as AppStatusEnum;
// if (appStatus === AppStatusEnum.Installing) {
// return null;
// }
// const { slug } = e.cell.row.original;
// let buttonFuntion = () => navigate(`/apps/${slug}`);
// if (appStatus === AppStatusEnum.NotInstalled) {
// buttonFuntion = () => {
// setAppSlug(slug);
// setInstallModalOpen(true);
// };
// }
// return (
// <div className="text-right opacity-0 group-hover:opacity-100 transition-opacity">
// <button
// onClick={buttonFuntion}
// type="button"
// className="inline-flex items-center px-4 py-2 border border-gray-200 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500"
// >
// {getConstForStatus(appStatus, 'buttonIcon')}
// {getConstForStatus(appStatus, 'buttonTitle')}
// </button>
// </div>
// );
// },
// width: 'auto',
// },
];
return (