Create ESLint rule to discourage usage of navigate() and prefer Link (#5642)
### Description Create ESLint rule to discourage usage of navigate() and prefer Link ### Refs #5468 ### Demo   Fixes #5468 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -27,10 +27,6 @@ export const SettingsIntegrationDatabaseConnectionShowContainer = () => {
|
||||
navigate(`${settingsIntegrationsPagePath}/${databaseKey}`);
|
||||
};
|
||||
|
||||
const onEdit = () => {
|
||||
navigate('./edit');
|
||||
};
|
||||
|
||||
const settingsIntegrationsPagePath = getSettingsPagePath(
|
||||
SettingsPath.Integrations,
|
||||
);
|
||||
@ -57,7 +53,6 @@ export const SettingsIntegrationDatabaseConnectionShowContainer = () => {
|
||||
connectionId={connection.id}
|
||||
connectionLabel={connection.label}
|
||||
onRemove={deleteConnection}
|
||||
onEdit={onEdit}
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
|
||||
@ -7,6 +7,7 @@ import { LightIconButton } from '@/ui/input/button/components/LightIconButton';
|
||||
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
||||
import { DropdownMenu } from '@/ui/layout/dropdown/components/DropdownMenu';
|
||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||
import { UndecoratedLink } from '@/ui/navigation/link/components/UndecoratedLink';
|
||||
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||
|
||||
type SettingsIntegrationDatabaseConnectionSummaryCardProps = {
|
||||
@ -14,7 +15,6 @@ type SettingsIntegrationDatabaseConnectionSummaryCardProps = {
|
||||
connectionId: string;
|
||||
connectionLabel: string;
|
||||
onRemove: () => void;
|
||||
onEdit: () => void;
|
||||
};
|
||||
|
||||
const StyledDatabaseLogoContainer = styled.div`
|
||||
@ -34,7 +34,6 @@ export const SettingsIntegrationDatabaseConnectionSummaryCard = ({
|
||||
connectionId,
|
||||
connectionLabel,
|
||||
onRemove,
|
||||
onEdit,
|
||||
}: SettingsIntegrationDatabaseConnectionSummaryCardProps) => {
|
||||
const dropdownId =
|
||||
'settings-integration-database-connection-summary-card-dropdown';
|
||||
@ -69,11 +68,9 @@ export const SettingsIntegrationDatabaseConnectionSummaryCard = ({
|
||||
text="Remove"
|
||||
onClick={onRemove}
|
||||
/>
|
||||
<MenuItem
|
||||
LeftIcon={IconPencil}
|
||||
text="Edit"
|
||||
onClick={onEdit}
|
||||
/>
|
||||
<UndecoratedLink to="./edit">
|
||||
<MenuItem LeftIcon={IconPencil} text="Edit" />
|
||||
</UndecoratedLink>
|
||||
</DropdownMenuItemsContainer>
|
||||
</DropdownMenu>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user