-
- {props.label}
-
-
onChange(ev.target.value)}
- error={props.error}
- required={props.required}
- helperText={props.helperText}
- onKeyDown={onKeyDown}
- placeholder={props.placeholder}
- onFocus={onFocus}
- onBlur={onBlur}
- autoFocus={props.autoFocus}
- />
+
+ {props.label}
+ onChange(ev.target.value)}
+ error={props.error}
+ required={props.required}
+ helperText={props.helperText}
+ onKeyDown={onKeyDown}
+ placeholder={props.placeholder}
+ onFocus={onFocus}
+ onBlur={onBlur}
+ autoFocus={props.autoFocus}
+ />
)
}
-export const StyledTextField = styled(TextField)(() => ({
- width: '100%',
+export const StyledTextField = styled(TextField, {
+})(() => ({
+ width: '100%',
'& label.Mui-focused': {
color: '#00D1FF',
},
'& .MuiInput-underline:after': {
borderBottomColor: '#00D1FF',
},
+ '& .MuiTextField-root': {
+ width: '100%'
+ },
'& .MuiOutlinedInput-root': {
'& fieldset': {
borderColor: 'gray',
diff --git a/client/components/Parts/Fields/Multiline.tsx b/client/components/Parts/Fields/Multiline.tsx
index 6109594d2..ceffa1498 100644
--- a/client/components/Parts/Fields/Multiline.tsx
+++ b/client/components/Parts/Fields/Multiline.tsx
@@ -21,27 +21,23 @@ interface MultilineFieldProps {
export default function MultilineField(props: MultilineFieldProps) {
const onFocus = props.onFocus || noop
return (
-
-
- {props.label}
-
-
props.onChange(ev.target.value as any)}
- onFocus={onFocus}
- autoFocus={props.autoFocus}
- required={props.required}
- />
+
+ {props.label}
+ props.onChange(ev.target.value as any)}
+ onFocus={onFocus}
+ autoFocus={props.autoFocus}
+ required={props.required}
+ />
)
}
\ No newline at end of file
diff --git a/client/components/Parts/Fields/YesNo.tsx b/client/components/Parts/Fields/YesNo.tsx
index e43e2a3c5..66a94b5b8 100644
--- a/client/components/Parts/Fields/YesNo.tsx
+++ b/client/components/Parts/Fields/YesNo.tsx
@@ -14,14 +14,11 @@ interface YesNoFieldProps {
export default function YesNoField(props: YesNoFieldProps) {
const onFocus = props.onFocus || noop
return (
-
-
- {props.label}
-
+
+
{props.label}
+
+ ,
+ 'Delete',
+ )
+
+export default DeleteIcon
\ No newline at end of file
diff --git a/client/components/Parts/Trees/File.tsx b/client/components/Parts/Trees/File.tsx
index 647c5c755..dd4366d13 100644
--- a/client/components/Parts/Trees/File.tsx
+++ b/client/components/Parts/Trees/File.tsx
@@ -11,8 +11,9 @@ import { alpha, styled, useTheme } from '@mui/material/styles'
import { keyframes } from '@mui/system'
import { TreeItem, TreeItemProps, TreeView, treeItemClasses } from '@mui/x-tree-view'
import * as React from 'react'
+import { useTranslation } from 'react-i18next'
import closedFolderIcon from '../../../assets/closed_folder_icon.svg'
-import deleteIcon from '../../../assets/delete_icon.svg'
+import DeleteIcon from '../Icons/DeleteIcon'
import openFileLocationIcon from '../../../assets/open_file_location_icon.svg'
import openFolderIcon from '../../../assets/open_folder_icon.svg'
import renameIcon from '../../../assets/rename_icon.svg'
@@ -20,7 +21,6 @@ import * as helpers from '../../../helpers'
import * as types from '../../../types'
import IconButton from '../../Parts/Buttons/Icon'
import ScrollBox from '../Boxes/Scroll'
-import { useTranslation } from 'react-i18next'
export interface FileTreeProps {
files: types.IFile[]
@@ -48,7 +48,7 @@ export default function FileTree(props: FileTreeProps) {
return (
-
+
- {}
+
theme.palette.OKFNRed500.main,
}}
- primary={`${t('delete-filefolder', { fileOrFolder })}`} secondary={t('context-menu-delete-description')}
+ primary={`${t('delete-filefolder', { fileOrFolder })}`}
+ secondary={t('context-menu-delete-description')}
/>
diff --git a/client/themes.ts b/client/themes.ts
index 597f5d117..a06d68372 100644
--- a/client/themes.ts
+++ b/client/themes.ts
@@ -35,6 +35,12 @@ declare module '@mui/material/Button' {
OKFNGray700: true
}
}
+declare module './components/Parts/Icons/DeleteIcon' {
+ interface SvgIconPropsColorOverrides {
+ OKFNRed500: true
+ OKFNGray700: true
+ }
+}
export const DEFAULT = createTheme({
typography: {
diff --git a/portal/content/docs/documentation/getting-started.md b/portal/content/docs/documentation/getting-started.md
index b9b49d1ec..55d05f59e 100644
--- a/portal/content/docs/documentation/getting-started.md
+++ b/portal/content/docs/documentation/getting-started.md
@@ -45,11 +45,11 @@ Go to the [RELEASES](https://github.com/okfn/opendataeditor/releases) and downlo
Go to the [RELEASES](https://github.com/okfn/opendataeditor/releases) and download the most recent **DMG** file.
-1. If you encounter security message, click on the question mark and then click the link in the first section.
+1. If you encounter a security message, click on the question mark and then click the link in the first section.
![DOWNLOAD SECURITY](./assets/getting-started/gs-macos-download.png)
-2. Change settings to allow app to execute.
+2. Change settings to allow the app to execute.
![DOWNLOAD SETTINGS](./assets/getting-started/gs-macos-download-step2.png)
diff --git a/server/endpoints/file/create.py b/server/endpoints/file/create.py
index d7628079a..64a5628a4 100644
--- a/server/endpoints/file/create.py
+++ b/server/endpoints/file/create.py
@@ -25,6 +25,11 @@ class Result(BaseModel, extra="forbid"):
size: int
+# TODO: this operation needs to be atomic (has to include file creation and table validation)
+# it will allow proper clean-ups in case of errors and better error messages
+# (see "/file/fetch" as an example)
+
+
@router.post("/file/create")
async def endpoint(
request: Request,
diff --git a/server/endpoints/file/fetch.py b/server/endpoints/file/fetch.py
index de24d9b14..55ac8155e 100644
--- a/server/endpoints/file/fetch.py
+++ b/server/endpoints/file/fetch.py
@@ -31,6 +31,10 @@ def server_file_read(request: Request, props: Props) -> Result:
return action(request.app.get_project(), props)
+# TODO: implement proper cleanup in case of failed uploading
+# currently, it only cleanups if the file is not a table
+
+
def action(project: Project, props: Props) -> Result:
from ... import endpoints
@@ -65,11 +69,11 @@ def action(project: Project, props: Props) -> Result:
).record
# Ensure tabular
- # Currently, we support only fetching tabular files because otherwise
- # it's not possible to differentiate between HTML documents (wrong links) and data files
if record.type != "table":
endpoints.file.delete.action(project, endpoints.file.delete.Props(path=path))
- raise Exception("The file is not tabular")
+ # TODO: currently, we just use a tranlation key here
+ # later it might need to be migrated to proper error codes
+ raise Exception("error-url-not-table")
return Result(path=path, size=len(bytes))
diff --git a/tsconfig.json b/tsconfig.json
index 297458398..7d08d4448 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -15,6 +15,7 @@
"DOM",
"dom.iterable"
],
+ "allowJs": true,
"declaration": true,
"esModuleInterop": true,
"resolveJsonModule": true,