diff --git a/Changelog.md b/Changelog.md index f5286e498..45289a614 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,8 @@ ## Upcoming Release +- **Changed** to allow editing and deleting default connections + ([#801](https://github.com/aws/graph-explorer/pull/801)) - **Fixed** issue where nodes and edges without any labels were causing the app to crash ([#799](https://github.com/aws/graph-explorer/pull/799)) diff --git a/packages/graph-explorer/src/core/AppStatusLoader.tsx b/packages/graph-explorer/src/core/AppStatusLoader.tsx index eb1876866..57afd6763 100644 --- a/packages/graph-explorer/src/core/AppStatusLoader.tsx +++ b/packages/graph-explorer/src/core/AppStatusLoader.tsx @@ -55,7 +55,6 @@ const AppStatusLoader = ({ children }: PropsWithChildren) => { !configuration.get(defaultConnectionConfig.id) ) { const newConfig: RawConfiguration = cloneDeep(defaultConnectionConfig); - newConfig.__fileBase = true; let activeConfigId = defaultConnectionConfig.id; logger.debug("Adding new config to store", newConfig); diff --git a/packages/graph-explorer/src/core/ConfigurationProvider/types.ts b/packages/graph-explorer/src/core/ConfigurationProvider/types.ts index 348f9c22d..21cf6be25 100644 --- a/packages/graph-explorer/src/core/ConfigurationProvider/types.ts +++ b/packages/graph-explorer/src/core/ConfigurationProvider/types.ts @@ -137,10 +137,6 @@ export type RawConfiguration = { * Database schema: types, names, labels, icons, ... */ schema?: Schema; - /** - * Mark as created from a file - */ - __fileBase?: boolean; }; export type ConfigurationContextProps = RawConfiguration & { diff --git a/packages/graph-explorer/src/core/StateProvider/configuration.ts b/packages/graph-explorer/src/core/StateProvider/configuration.ts index 9bbeaf4b4..6de37b7de 100644 --- a/packages/graph-explorer/src/core/StateProvider/configuration.ts +++ b/packages/graph-explorer/src/core/StateProvider/configuration.ts @@ -119,7 +119,6 @@ export function mergeConfiguration( return { id: currentConfig.id, displayLabel: currentConfig.displayLabel, - __fileBase: currentConfig.__fileBase, connection: { ...(currentConfig.connection || {}), // Remove trailing slash diff --git a/packages/graph-explorer/src/modules/ConnectionDetail/ConnectionDetail.tsx b/packages/graph-explorer/src/modules/ConnectionDetail/ConnectionDetail.tsx index 32bb165a2..7885f01e3 100644 --- a/packages/graph-explorer/src/modules/ConnectionDetail/ConnectionDetail.tsx +++ b/packages/graph-explorer/src/modules/ConnectionDetail/ConnectionDetail.tsx @@ -96,7 +96,6 @@ const ConnectionDetail = ({ isSync, onSyncChange }: ConnectionDetailProps) => { const lastSyncUpdate = config?.schema?.lastUpdate; const lastSyncFail = config?.schema?.lastSyncFail === true; - const isFileBased = config.__fileBase === true; return ( @@ -126,10 +125,10 @@ const ConnectionDetail = ({ isSync, onSyncChange }: ConnectionDetailProps) => { onActionClick={() => setEdit(true)} /> } color="error" - isDisabled={isFileBased || isSync} + isDisabled={isSync} onActionClick={onConfigDelete} /> diff --git a/packages/graph-explorer/src/modules/CreateConnection/CreateConnection.tsx b/packages/graph-explorer/src/modules/CreateConnection/CreateConnection.tsx index 34addbcb5..193b6cd8b 100644 --- a/packages/graph-explorer/src/modules/CreateConnection/CreateConnection.tsx +++ b/packages/graph-explorer/src/modules/CreateConnection/CreateConnection.tsx @@ -81,9 +81,6 @@ const CreateConnection = ({ const styleWithTheme = useWithTheme(); const configId = existingConfig?.id; - const disabledFields: (keyof ConnectionForm)[] = existingConfig?.__fileBase - ? ["queryEngine", "url", "serviceType"] - : []; const initialData: ConnectionForm | undefined = existingConfig ? { ...(existingConfig.connection || {}), @@ -239,17 +236,13 @@ const CreateConnection = ({ onChange={onFormChange("name")} errorMessage="Name is required" validationState={hasError && !form.name ? "invalid" : "valid"} - isDisabled={disabledFields.includes("name")} />