Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
guergana committed Jul 26, 2024
1 parent 90245a0 commit 616328b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions client/components/Application/Dialogs/WelcomeBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { styled } from '@mui/material/styles'
import { saveConfig } from '../../../store/actions/config'

export default async function WelcomeBanner() {

const config = store.useStore((state) => state.config)

console.log('config', config)
Expand All @@ -22,7 +21,7 @@ export default async function WelcomeBanner() {
setChecked(event.target.checked)
// TODO: persist application variable hideScreen
// config.json as suggested by @pdelboca
saveConfig( { system: {}, project: {}, folder: 'folder', hideWelcomeScreen: checked } )
saveConfig({ system: {}, project: {}, folder: 'folder', hideWelcomeScreen: checked })
}

const StyledButton = styled(SimpleButton)({
Expand Down
6 changes: 2 additions & 4 deletions client/components/Editors/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ export default function TableEditor(props: TableEditorProps) {
setRowsPerPage(Math.floor(tableHeight / rowHeight) - 1)
}

const elem = document.querySelector('.css-neb4x5-MuiGrid-root')
const rect = elem?.getBoundingClientRect()

return (
<InovuaDatagrid
onReady={resizeTable}
Expand All @@ -71,7 +68,8 @@ export default function TableEditor(props: TableEditorProps) {
rowHeight={rowHeight}
showColumnMenuLockOptions={false}
showColumnMenuGroupOptions={false}
columnContextMenuConstrainTo={rect}
columnContextMenuConstrainTo={true}
columnContextMenuPosition={'fixed'}
{...others}
/>
)
Expand Down
7 changes: 6 additions & 1 deletion client/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ export const DEFUALT_TIME_FORMAT = 'HH:mm:ss'

// Initials

export const INITIAL_CONFIG: types.IConfig = { system: {}, project: {}, folder: 'folder', hideWelcomeScreen: false }
export const INITIAL_CONFIG: types.IConfig = {
system: {},
project: {},
folder: 'folder',
hideWelcomeScreen: false,
}
export const INITIAL_SCHEMA: types.ISchema = { fields: [] }
export const INITIAL_DIALECT: types.IDialect = {}
export const INITIAL_CONTROL: Partial<types.IControl> = { type: 'ckan' }
Expand Down
5 changes: 0 additions & 5 deletions client/store/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ export type IState = {
* Keeps track of the text state if current file is a text
**/
text?: ITextState

/**
* Records the decision of the user to show/hide the welcome screen
**/
hideWelcomeBanner?: boolean
}

export type ITableState = {
Expand Down
2 changes: 1 addition & 1 deletion client/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface IConfig {
system: ISystemConfig
project: IProjectConfig
folder: string,
folder: string
hideWelcomeScreen: boolean
}

Expand Down
3 changes: 2 additions & 1 deletion server/stores/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Config:
def __init__(self, project: Project):
self.system = project.system / "config.json"
self.project = project.private / "config.json"
self.hideWelcomeScreen = "config.json"
self.folder = project.public.resolve()
for fullpath in [self.system, self.project]:
if not fullpath.exists():
Expand All @@ -24,7 +25,7 @@ def __init__(self, project: Project):
def read(self):
system = JsonResource(path=str(self.system)).read_json()
project = JsonResource(path=str(self.project)).read_json()
config = models.Config(system=system, project=project, folder=str(self.folder))
config = models.Config(system=system, project=project, folder=str(self.folder), hideWelcomeScreen=bool(self.hideWelcomeScreen))
return config

def write(self, config: models.Config):
Expand Down

0 comments on commit 616328b

Please sign in to comment.