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

Visual editor for .quilt/catalog/config.yaml #4261

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4a02092
modify array placeholder
fiskus Dec 3, 2024
fdca225
quilt summarize editor
fiskus Dec 3, 2024
a11ecf1
Merge branch 'master' of github.com:quiltdata/quilt into quilt_summar…
fiskus Dec 3, 2024
ffb9a36
sync types with JSON Schema
fiskus Dec 4, 2024
39d784e
wip: use custom form as quilt_summarize editor
fiskus Dec 4, 2024
631e20b
wip: use custom editor, it works though very unperformant
fiskus Dec 5, 2024
f9d0ffc
basic optimisations
fiskus Dec 5, 2024
61b9a93
use pseudo-ids to make room for changing the order
fiskus Dec 5, 2024
7a5f93b
use pseudo-ids to make room for changing the order
fiskus Dec 5, 2024
eccbd5d
polish styles
fiskus Dec 5, 2024
49c3f4a
remove column or row
fiskus Dec 5, 2024
1ae67dc
add file picker
fiskus Dec 9, 2024
890e242
switch to quilt_summarize editor earlier
fiskus Dec 9, 2024
b077db8
debounce internal value and call onChange
fiskus Dec 9, 2024
cb4a986
multiple minor improvements
fiskus Dec 9, 2024
be4ffd3
Merge branch 'master' of github.com:quiltdata/quilt into quilt_summar…
fiskus Dec 9, 2024
a28b425
revert unnecessary change
fiskus Dec 9, 2024
c49c774
revert unrelated changes
fiskus Dec 9, 2024
28f57d4
downgrade nanoid to sync with postcss
fiskus Dec 9, 2024
3f1e1b1
reuse props object
fiskus Dec 9, 2024
4172334
if delete last row
fiskus Dec 9, 2024
cac80b8
add some tests
fiskus Dec 10, 2024
ecb932b
return promises in tests
fiskus Dec 10, 2024
2892de8
add link to documentation
fiskus Dec 10, 2024
cfe0bc7
order imports
fiskus Dec 10, 2024
96a2e0b
validate with JSON schema
fiskus Dec 10, 2024
c397bf5
move to dir
fiskus Dec 10, 2024
0ab9a94
move state manipulation to individual file
fiskus Dec 10, 2024
eebb3f1
use crypto instead of nanoid
fiskus Dec 10, 2024
b1f4302
add tests for State
fiskus Dec 10, 2024
1b38c2d
save vim buffer
fiskus Dec 10, 2024
a64ff3d
set initial path for popup listing
fiskus Dec 10, 2024
221c709
changelog entry
fiskus Dec 10, 2024
37c5ef5
fix adding files from nested directories
fiskus Dec 11, 2024
50ea984
some tests to pass codecov treshold
fiskus Dec 11, 2024
089ead1
some tests to pass codecov treshold
fiskus Dec 11, 2024
71487e8
reuse JsonValidationErrors
fiskus Dec 11, 2024
2c61c39
wrap throw with brackets
fiskus Dec 11, 2024
3548c54
add simple smoke tests for FileEditor
fiskus Dec 11, 2024
9832505
cosmetic change
fiskus Dec 12, 2024
7d34edd
more tests
fiskus Dec 12, 2024
81ba9f4
fix [].length react condition
fiskus Dec 12, 2024
caad40f
dont go up outside package
fiskus Dec 12, 2024
e1dcc6f
make listing constant height
fiskus Dec 12, 2024
04d64b9
add tests for QuiltSummarize
fiskus Dec 12, 2024
b31709a
Merge branch 'master' into quilt_summarize_editor
fiskus Dec 16, 2024
1d8f2c3
BPE: wip, almost working bucket preferences editor
fiskus Dec 16, 2024
21b2461
Update catalog/CHANGELOG.md
fiskus Dec 16, 2024
74fb03f
Update catalog/app/components/FileEditor/QuiltConfigEditor/QuiltSumma…
fiskus Dec 16, 2024
5a4de6d
Update catalog/app/components/FileEditor/QuiltConfigEditor/QuiltSumma…
fiskus Dec 16, 2024
ef70d7e
memoize random widths
fiskus Dec 16, 2024
f684afd
remove TODO note
fiskus Dec 16, 2024
ea943c6
show JSON.parse errors
fiskus Dec 16, 2024
e85ce4d
use wildcard import
fiskus Dec 16, 2024
8645b72
merge with remote
fiskus Dec 16, 2024
471f7ec
Merge branch 'quilt_summarize_editor' of github.com:quiltdata/quilt i…
fiskus Dec 16, 2024
bfa06eb
implement assocPath
fiskus Dec 17, 2024
9c9efbf
wip: package_description
fiskus Dec 17, 2024
0d2d1ec
add labels
fiskus Dec 17, 2024
2c46104
some whitespaces
fiskus Dec 18, 2024
bfffccd
add PackageDescriptoin item
fiskus Dec 19, 2024
bf15037
list component
fiskus Dec 19, 2024
45e65c3
use wrappers for every input
fiskus Dec 20, 2024
cf3848d
fix test
fiskus Dec 20, 2024
ddd610e
first test
fiskus Dec 20, 2024
77228bf
resolve conflict
fiskus Dec 20, 2024
34fc153
remove unused object
fiskus Dec 20, 2024
f65dc86
minor optimizations
fiskus Dec 20, 2024
f9bf7f3
fix mistyping
fiskus Dec 20, 2024
33aa72c
remove config from html
fiskus Dec 23, 2024
58b2daa
add basic test for BucketPreferences
fiskus Dec 23, 2024
3813010
rename the test
fiskus Dec 23, 2024
d84106d
KeyedValue
fiskus Dec 23, 2024
ccbbf38
Merge branch 'master' of github.com:quiltdata/quilt into bucket-prefe…
fiskus Dec 24, 2024
bb66a68
changelog entry
fiskus Dec 24, 2024
d81289d
jsonpath
fiskus Dec 24, 2024
43ed23d
Merge branch 'master' of github.com:quiltdata/quilt into bucket-prefe…
fiskus Dec 24, 2024
6a426c6
validate jsonpaths and group expanded toggles
fiskus Dec 24, 2024
d2226a0
simplify class names in test
fiskus Dec 24, 2024
dfcbb01
Add screenshot to the docs
fiskus Dec 24, 2024
ab2cbb5
Merge branch 'master' into bucket-preferences-editor
fiskus Dec 24, 2024
4485fba
fix buckets autocomplete options value
fiskus Dec 24, 2024
9a33ed8
Merge branch 'bucket-preferences-editor' of github.com:quiltdata/quil…
fiskus Dec 24, 2024
046edad
Merge branch 'master' into bucket-preferences-editor
fiskus Dec 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions catalog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ where verb is one of

## Changes

- [Added] Visual editor for `.quilt/catalog/config.yaml` ([#4261](https://github.com/quiltdata/quilt/pull/4261))
- [Added] Admin: Tabulator Settings (open query) ([#4255](https://github.com/quiltdata/quilt/pull/4255))
- [Added] Visual editor for `quilt_summarize.json` ([#4254](https://github.com/quiltdata/quilt/pull/4254))
- [Added] Support "html" type in `quilt_summarize.json` ([#4252](https://github.com/quiltdata/quilt/pull/4252))
Expand Down
13 changes: 12 additions & 1 deletion catalog/app/components/FileEditor/FileEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
export { detect, isSupportedFileType } from './loader'

const QuiltSummarize = React.lazy(() => import('./QuiltConfigEditor/QuiltSummarize'))
const BucketPreferences = React.lazy(
() => import('./QuiltConfigEditor/BucketPreferences'),

Check warning on line 22 in catalog/app/components/FileEditor/FileEditor.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/components/FileEditor/FileEditor.tsx#L22

Added line #L22 was not covered by tests
)

interface EditorProps extends EditorState {
className: string
Expand All @@ -35,7 +38,11 @@
onChange,
editing,
}: EditorProps) {
if (editing.brace !== '__quiltConfig' && editing.brace !== '__quiltSummarize') {
if (
editing.brace !== '__quiltConfig' &&
editing.brace !== '__quiltSummarize' &&
editing.brace !== '__bucketPreferences'
) {
loadMode(editing.brace || 'plain_text') // TODO: loaders#typeText.brace
}

Expand All @@ -51,6 +58,8 @@
switch (editing.brace) {
case '__quiltConfig':
return <QuiltConfigEditor {...initialProps} handle={handle} />
case '__bucketPreferences':
return <BucketPreferences {...initialProps} />

Check warning on line 62 in catalog/app/components/FileEditor/FileEditor.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/components/FileEditor/FileEditor.tsx#L61-L62

Added lines #L61 - L62 were not covered by tests
case '__quiltSummarize':
return <QuiltSummarize {...initialProps} />
default:
Expand All @@ -75,6 +84,8 @@
switch (editing.brace) {
case '__quiltConfig':
return <QuiltConfigEditor {...props} handle={handle} />
case '__bucketPreferences':
return <BucketPreferences {...props} />

Check warning on line 88 in catalog/app/components/FileEditor/FileEditor.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/components/FileEditor/FileEditor.tsx#L87-L88

Added lines #L87 - L88 were not covered by tests
case '__quiltSummarize':
return <QuiltSummarize {...props} />
default:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import * as React from 'react'
import renderer from 'react-test-renderer'
import { createMuiTheme } from '@material-ui/core'

import BucketPreferences from './BucketPreferences'

const theme = createMuiTheme()
const noop = () => {}

jest.mock(
'constants/config',
jest.fn(() => ({})),
)

jest.mock(
'utils/BucketConfig',
jest.fn(() => ({
useRelevantBucketConfigs: () => [],
})),
)

jest.mock(
'@material-ui/core',
jest.fn(() => ({
...jest.requireActual('@material-ui/core'),
Checkbox: jest.fn(({ checked }: { checked: boolean }) => (
<div id="checkbox">{checked}</div>
)),
TextField: jest.fn(({ value }: { value: React.ReactNode }) => (
<div id="text-field">{value}</div>
)),
Select: jest.fn(({ options, value }: { options?: string[]; value: string }) => (
<div id="select">
{value} from [{options?.join(', ')}]
</div>
)),
makeStyles: jest.fn((cb: any) => () => {
const classes = typeof cb === 'function' ? cb(theme) : cb
return Object.keys(classes).reduce(
(acc, key) => ({
[key]: key,
...acc,
}),
{},
)
}),
})),
)

jest.mock(
'@material-ui/lab',
jest.fn(() => ({
...jest.requireActual('@material-ui/core'),
Autocomplete: jest.fn(({ options, value }: { options?: string[]; value: string }) => (
<div id="autocomplete">
{value} from [{options?.join(', ')}]
</div>
)),
})),
)

describe('components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPreferences', () => {
it('render form with default values', () => {
const tree = renderer
.create(<BucketPreferences className="root" error={null} onChange={noop} />)
.toJSON()
expect(tree).toMatchSnapshot()
})
})
Loading
Loading