-
Notifications
You must be signed in to change notification settings - Fork 871
Analyzers UI #14599
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
Merged
Merged
Analyzers UI #14599
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
51947bd
React-specific rules.
4fed1a4
Analyzers view.
56098ae
Modal component for React.
ab43a1f
Analyzer delete functional, +notifications.
25d8214
Stable render of modal children, +AddAnalyzer form stub.
096edab
Fixed broken modal re-open.
948c778
Delimiter form ready.
54f70fd
All forms ready.
34a0965
Removed 'Tree' mode.
1c4a1a7
Analyzer create functional.
ff01ffd
Fixed stopwords/stopwordsPath mixup.
51f1d9e
'Create Analyzer' form schema validation.
20fd739
Added missing fields to Text and N-Gram analyzer forms.
7480efb
Added support for copying existing analyzer to form state.
12657f5
Implemented view analyzer details.
1b59221
Merge branch 'devel' into feature/analyzers-web-ui
579ceb1
UX improvements.
76a054d
Fixed analyzer selection.
6f08080
Added UI for AQL and GeoJSON analyzers.
2522e13
Added UI for GeoPoint analyzer.
59e9fef
Improved validation, +dispatcher to manage state, +form cache.
4993c08
Changed button styles to match theme.
dfb74ef
Removed 'pointer' cursor on text field labels.
d3b031a
Added help links to locale and delimiter inputs.
3aef7a6
Added help text to delimiter field.
4f8e791
Fix bug that caused crash in case of pre-selected analyzer being dele…
8dfe282
Merge branch 'devel' into feature/analyzers-web-ui
1eb0122
Fixed parsing and UI for latitude/longitude elements.
4638c23
Reusable form and grid components based on Pure.css.
ccb8391
View mode now provides both JSON and (disabled) form views.
769dd2e
Using relative field paths to support embeddable forms.
f89e3af
Normalized accent input, +made all inputs location agnostic.
81f9fab
Pipeline Analyzer form functional.
31ba630
Switched to simple text display for code view.
70ec839
Use text cursor for code view mode.
1226635
Merge branch 'devel' into feature/analyzers-web-ui
bf701cd
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
KVS85 08e4442
Added UIs for Stopwords, Collation and Segmentation Analyzers.
aabcff5
Merge remote-tracking branch 'origin/feature/analyzers-web-ui' into f…
7b50eb0
Fixed DB base URL evaluation.
e82d84e
Switched to Pure.css-based grid components.
147020d
Allow rw access when server is running in non-authenticated mode.
eddc653
Fixed radio button rendering.
c1d82b2
Minor UI improvements.
e63f202
Fixed modal height issues, +fixed JSON form double scrollbar.
66e302b
Maximized modal height for view mode.
a531327
Minor UI improvements.
b1454db
Fixed null values for blank numeric inputs.
d496528
UI improvements.
5906f75
Slightly improved responsive grid.
a5eb6b4
Reusing FormState as action button prop.
ad24a3c
Stricter type restrictions.
ad3cdfb
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
KVS85 1256e50
Rebuild UI
KVS85 4dbfe7e
Update CHANGELOG
KVS85 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Stable render of modal children, +AddAnalyzer form stub.
- Loading branch information
There are no files selected for viewing
49 changes: 28 additions & 21 deletions
49
js/apps/system/_admin/aardvark/APP/react/src/components/modal/Modal.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
js/apps/system/_admin/aardvark/APP/react/src/utils/helpers.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { ChangeEvent } from "react"; | ||
|
|
||
| export const getChangeHandler = (setter: (value: string) => void) => { | ||
| return (event: ChangeEvent<HTMLInputElement | HTMLSelectElement>) => { | ||
| setter(event.currentTarget.value); | ||
| }; | ||
| }; | ||
|
|
||
| export const hasOwnProperty = <X extends {}, Y extends PropertyKey> (obj: X, prop: Y): obj is X & Record<Y, unknown> => { | ||
| return obj.hasOwnProperty(prop); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
js/apps/system/_admin/aardvark/APP/react/src/views/analyzers/AddAnalyzer.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import React, { useState } from 'react'; | ||
| import Modal, { ModalBody, ModalFooter, ModalHeader } from "../../components/modal/Modal"; | ||
| import { typeNameMap } from "./constants"; | ||
| import { map, omit } from 'underscore'; | ||
| import { getChangeHandler } from "../../utils/helpers"; | ||
|
|
||
| const restrictedTypeNameMap = omit(typeNameMap, 'identity'); | ||
|
|
||
| const AddAnalyzer = () => { | ||
| const [show, setShow] = useState(false); | ||
| const [analyzerName, setAnalyzerName] = useState(''); | ||
| const [analyzerType, setAnalyzerType] = useState('delimiter'); | ||
|
|
||
| const handleAdd = () => { | ||
| setShow(false); | ||
| }; | ||
|
|
||
| return <> | ||
| <button className={'pure-button'} onClick={() => setShow(true)} style={{ | ||
| background: 'transparent', | ||
| color: 'white', | ||
| paddingLeft: 0, | ||
| paddingTop: 0 | ||
| }}> | ||
| <i className="fa fa-plus-circle"/> Add Analyzer | ||
| </button> | ||
| <Modal show={show} setShow={setShow}> | ||
| <ModalHeader title={'Create Analyzer'}/> | ||
| <ModalBody> | ||
| <div className={'pure-g'} style={{ minWidth: '50vw' }}> | ||
| <div className={'pure-u-2-5 pure-u-md-2-5 pure-u-lg-2-5 pure-u-xl-2-5'}> | ||
| <label htmlFor={'analyzer-name'}>Analyzer Name:</label> | ||
| <input id="analyzer-name" type="text" placeholder="Analyzer Name" style={{ width: 'auto' }} | ||
| value={analyzerName} onChange={getChangeHandler(setAnalyzerName)} key={'analyzer-name'}/> | ||
| </div> | ||
|
|
||
| {/* Spacer Div*/} | ||
| <div className={'pure-u-1-5 pure-u-md-1-5 pure-u-lg-1-5 pure-u-xl-1-5'}/> | ||
|
|
||
| <div className={'pure-u-2-5 pure-u-md-2-5 pure-u-lg-2-5 pure-u-xl-2-5'}> | ||
| <label htmlFor={'analyzer-type'}>Analyzer Type:</label> | ||
| <select id="analyzer-type" style={{ width: 'auto' }} value={analyzerType} key={'analyzer-type'} | ||
| onChange={getChangeHandler(setAnalyzerType)}> | ||
| { | ||
| map(restrictedTypeNameMap, (value, key) => <option key={key} value={key}>{value}</option>) | ||
| } | ||
| </select> | ||
| </div> | ||
| </div> | ||
| </ModalBody> | ||
| <ModalFooter> | ||
| <button className="button-close" onClick={() => setShow(false)}>Close</button> | ||
| <button className="button-success" style={{ float: 'right' }} onClick={handleAdd}>Create</button> | ||
| </ModalFooter> | ||
| </Modal> | ||
| </>; | ||
| }; | ||
|
|
||
| export default AddAnalyzer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
js/apps/system/_admin/aardvark/APP/react/src/views/analyzers/constants.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| export const typeNameMap = { | ||
| identity: 'Identity', | ||
| delimiter: 'Delimiter', | ||
| stem: 'Stem', | ||
| norm: 'Norm', | ||
| ngram: 'N-Gram', | ||
| text: 'Text' | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.