Skip to content

Commit

Permalink
cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Dec 20, 2023
1 parent 4c83348 commit eb6c256
Show file tree
Hide file tree
Showing 37 changed files with 197 additions and 199 deletions.
67 changes: 39 additions & 28 deletions dashboard/client/src/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import {Alert, Chip, Container, Grid, Typography, useMediaQuery, useTheme} from '@mui/material';
import {
Alert,
Chip,
Container,
Grid,
Typography,
useMediaQuery,
useTheme,
} from '@mui/material';
import Service from './Service';
import ClientApp from './ClientApp.tsx';
import config from './config.ts';
import ApiIcon from "@mui/icons-material/Api";
import ApiIcon from '@mui/icons-material/Api';
import SellIcon from '@mui/icons-material/Sell';
import keycloakImg from './images/keycloak.png'
import databoxImg from './images/databox.png'
import uploaderImg from './images/uploader.png'
import exposeImg from './images/expose.png'
import notifyImg from './images/notify.png'
import keycloakImg from './images/keycloak.png';
import databoxImg from './images/databox.png';
import uploaderImg from './images/uploader.png';
import exposeImg from './images/expose.png';
import notifyImg from './images/notify.png';

type Props = {};

Expand All @@ -34,28 +42,31 @@ export default function Root({}: Props) {

return (
<Container>
{isLarge && <Typography
variant={'h1'}
sx={{
'.MuiChip-root': {
ml: 2,
fontWeight: 400,
}
}}
>
{STACK_NAME}
<Chip
icon={<SellIcon/>}
label={STACK_VERSION}
/>
</Typography>}
{isLarge && (
<Typography
variant={'h1'}
sx={{
'.MuiChip-root': {
ml: 2,
fontWeight: 400,
},
}}
>
{STACK_NAME}
<Chip icon={<SellIcon />} label={STACK_VERSION} />
</Typography>
)}

{isLarge && DEV_MODE && <Alert
sx={{
mt: 2,
}}
severity={'info'}
>Developer Mode is enabled</Alert>}
{isLarge && DEV_MODE && (
<Alert
sx={{
mt: 2,
}}
severity={'info'}
>
Developer Mode is enabled
</Alert>
)}

<Grid
sx={{
Expand Down
2 changes: 1 addition & 1 deletion dashboard/client/src/Service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function Service({
display: {
xs: 'none',
md: 'block',
}
},
}}
>
{description}
Expand Down
5 changes: 2 additions & 3 deletions dashboard/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import Root from './Root.tsx';
import React from 'react';
import {CssBaseline, GlobalStyles, responsiveFontSizes} from '@mui/material';
import {ThemeEditorProvider} from '@alchemy/theme-editor';
import {scrollbarWidth, theme} from "./theme.ts";
import {scrollbarWidth, theme} from './theme.ts';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<ThemeEditorProvider
defaultTheme={theme}
transformTheme={(theme) => responsiveFontSizes(theme, {
})}
transformTheme={theme => responsiveFontSizes(theme, {})}
>
<CssBaseline />
<GlobalStyles
Expand Down
2 changes: 1 addition & 1 deletion dashboard/client/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ThemeOptions} from "@mui/material";
import {ThemeOptions} from '@mui/material';

export const theme: ThemeOptions = {
typography: {
Expand Down
2 changes: 1 addition & 1 deletion databox/client/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const AppProxy = React.memo(() => {
export default function App() {
const {logout} = useAuth();
const onError = useRequestErrorHandler({
logout: (redirectPathAfterLogin) => {
logout: redirectPathAfterLogin => {
logout(redirectPathAfterLogin, true);
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ export default function EditCollection({data, onClose, minHeight}: Props) {
},
});

const {
submitting,
remoteErrors,
forbidNavigation,
} = usedFormSubmit;
const {submitting, remoteErrors, forbidNavigation} = usedFormSubmit;
useInRouterDirtyFormPrompt(t, forbidNavigation);

const formId = 'edit-collection';
Expand Down
5 changes: 4 additions & 1 deletion databox/client/src/components/Dialog/Tabbed/FormTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {LoadingButton} from '@mui/lab';
import SaveIcon from '@mui/icons-material/Save';
import RemoteErrors from '../../Form/RemoteErrors';
import {useTranslation} from 'react-i18next';
import {useInRouterDirtyFormPrompt, useOutsideRouterDirtyFormPrompt} from '@alchemy/navigation';
import {
useInRouterDirtyFormPrompt,
useOutsideRouterDirtyFormPrompt,
} from '@alchemy/navigation';

type Props = PropsWithChildren<{
loading: boolean;
Expand Down
13 changes: 7 additions & 6 deletions databox/client/src/components/Dialog/Tabbed/TabbedDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ export default function TabbedDialog<P extends {}>({
);
})}
</Tabs>
{currentTab && React.createElement(currentTab.component, {
...rest,
...currentTab.props,
onClose: closeModal,
minHeight,
})}
{currentTab &&
React.createElement(currentTab.component, {
...rest,
...currentTab.props,
onClose: closeModal,
minHeight,
})}
</BootstrapDialog>
)}
</RouteDialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,7 @@ export default function DefinitionManager<D extends DefinitionBase>({
},
});

const {
submitting,
remoteErrors,
forbidNavigation,
reset,
} = usedFormSubmit;
const {submitting, remoteErrors, forbidNavigation, reset} = usedFormSubmit;

React.useEffect(() => {
if (item && 'new' !== item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import RenditionClassSelect from '../../Form/RenditionClassSelect';
import CheckboxWidget from '../../Form/CheckboxWidget';
import apiClient from '../../../api/api-client';
import {toast} from 'react-toastify';
import React from "react";
import React from 'react';

function Item({
data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import RenditionDefinitionManager from './RenditionDefinitionManager';
import InfoWorkspace from './InfoWorkspace';
import {modalRoutes} from '../../../routes.ts';
import {useForceLogin} from '@alchemy/react-auth';
import config from "../../../config.ts";
import {keycloakClient} from "../../../api/api-client.ts";
import config from '../../../config.ts';
import {keycloakClient} from '../../../api/api-client.ts';

type Props = {};

Expand Down
4 changes: 1 addition & 3 deletions databox/client/src/components/Layout/ChangeTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import {StackedModalProps, useModals} from '@alchemy/navigation';

type Props = {} & StackedModalProps;

export default function ChangeTheme({
open,
}: Props) {
export default function ChangeTheme({open}: Props) {
const {t} = useTranslation();
const prefContext = useContext(UserPreferencesContext);
const {preferences, updatePreference} = prefContext;
Expand Down
43 changes: 24 additions & 19 deletions databox/client/src/components/Layout/MainAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {keycloakClient} from '../../api/api-client.ts';
import {useUser} from '../../lib/auth.ts';
import {DashboardMenu} from '@alchemy/react-ps';
import {useModals} from '@alchemy/navigation';
import ChangeTheme from "./ChangeTheme.tsx";
import ThemeEditor from "./ThemeEditor.tsx";
import ChangeTheme from './ChangeTheme.tsx';
import ThemeEditor from './ThemeEditor.tsx';

export const menuHeight = 42;

Expand Down Expand Up @@ -218,14 +218,19 @@ export default function MainAppBar({onToggleLeftPanel}: Props) {
</MenuItem>
<MenuItem
onClick={() => {
openModal(ThemeEditor, {}, {
forwardedContexts: [
{
context: ThemeEditorContext,
value: themeEditorContext,
}
]
});
openModal(
ThemeEditor,
{},
{
forwardedContexts: [
{
context:
ThemeEditorContext,
value: themeEditorContext,
},
],
}
);
handleCloseUserMenu();
}}
>
Expand Down Expand Up @@ -263,15 +268,15 @@ export default function MainAppBar({onToggleLeftPanel}: Props) {

{config.displayServicesMenu && (
<div style={{flexGrow: 0}}>
<DashboardMenu
style={{
position: 'relative',
marginLeft: 5,
}}
bodyPadding={0}
size={35}
dashboardBaseUrl={config.dashboardBaseUrl}
/>
<DashboardMenu
style={{
position: 'relative',
marginLeft: 5,
}}
bodyPadding={0}
size={35}
dashboardBaseUrl={config.dashboardBaseUrl}
/>
</div>
)}
</Toolbar>
Expand Down
23 changes: 8 additions & 15 deletions databox/client/src/components/Layout/ThemeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import AppDialog from "./AppDialog.tsx";
import AppDialog from './AppDialog.tsx';
import {StackedModalProps, useModals} from '@alchemy/navigation';
import {MuiThemeEditor} from '@alchemy/theme-editor';

type Props = {} & StackedModalProps;

export default function ThemeEditor({
open,
modalIndex,
}: Props) {
export default function ThemeEditor({open, modalIndex}: Props) {
const {closeModal} = useModals();

const onClose= () => closeModal();
const onClose = () => closeModal();

return <AppDialog
modalIndex={modalIndex}
open={open}
onClose={onClose}
>
<MuiThemeEditor
onClose={onClose}
/>
</AppDialog>
return (
<AppDialog modalIndex={modalIndex} open={open} onClose={onClose}>
<MuiThemeEditor onClose={onClose} />
</AppDialog>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import SaveAsButton from './Actions/SaveAsButton';
import {useNavigateToModal} from '../../Routing/ModalLink';
import SaveIcon from '@mui/icons-material/Save';
import {modalRoutes} from '../../../routes.ts';
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';

type Props = {
anchorPosition: PopoverPosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {CollectionChip, WorkspaceChip} from '../../Ui/Chips';
import {StackedModalProps, useModals} from '@alchemy/navigation';
import {OnCollectionEdit} from '../../Dialog/Collection/EditCollection';
import React from 'react';
import {useDirtyFormPromptOutsideRouter} from "../../Dialog/Tabbed/FormTab.tsx";
import {useDirtyFormPromptOutsideRouter} from '../../Dialog/Tabbed/FormTab.tsx';

type Props = {
parent?: string;
Expand Down Expand Up @@ -58,11 +58,7 @@ export default function CreateCollection({
},
});

const {
submitting,
remoteErrors,
forbidNavigation,
} = usedFormSubmit;
const {submitting, remoteErrors, forbidNavigation} = usedFormSubmit;
useDirtyFormPromptOutsideRouter(forbidNavigation);
const formId = 'create-collection';

Expand Down Expand Up @@ -96,10 +92,7 @@ export default function CreateCollection({
errors={remoteErrors}
open={open}
>
<CollectionForm
formId={formId}
usedFormSubmit={usedFormSubmit}
/>
<CollectionForm formId={formId} usedFormSubmit={usedFormSubmit} />
</FormDialog>
);
}
Loading

0 comments on commit eb6c256

Please sign in to comment.