Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve schema viewer user experience #2816

Merged
merged 11 commits into from
Jan 20, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { writable } from '../../utils/types';
import { useCodeMirrorExtensions } from './EditorComponents';
import { PreferencesContext, useDarkMode } from '../UserPreferences/Hooks';
import { PreferencesContent } from '../UserPreferences';
import { useId } from '../../hooks/useId';
import { useLiveState } from '../../hooks/useLiveState';
import { appResourceSubTypes } from './types';
import { SerializedResource } from '../DataModel/helperTypes';
Expand Down Expand Up @@ -93,7 +92,6 @@ const UserPreferencesEditor: AppResourceTab = function ({
data,
onChange: handleChange,
}): JSX.Element {
const id = useId('user-preferences');
const [preferencesContext] = useLiveState<
React.ContextType<typeof PreferencesContext>
>(
Expand Down Expand Up @@ -124,7 +122,7 @@ const UserPreferencesEditor: AppResourceTab = function ({

return (
<PreferencesContext.Provider value={preferencesContext}>
<PreferencesContent id={id} isReadOnly={isReadOnly} />
<PreferencesContent isReadOnly={isReadOnly} />
</PreferencesContext.Provider>
);
};
Expand Down
6 changes: 3 additions & 3 deletions specifyweb/frontend/js_src/lib/components/Router/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export const routes: RA<EnhancedRoute> = [
index: true,
title: schemaText.databaseSchema(),
element: () =>
import('../Toolbar/Schema').then(
import('../Toolbar/DataModel').then(
({ DataModelTables }) => DataModelTables
),
},
{
path: ':tableName',
element: () =>
import('../Toolbar/Schema').then(
({ DataModelTable }) => DataModelTable
import('../Toolbar/DataModel').then(
({ DataModelRedirect }) => DataModelRedirect
),
},
],
Expand Down
Loading