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

feat: add global search for events, experiments and archives. #1034

Merged
merged 21 commits into from
Oct 27, 2020

Conversation

mz921
Copy link
Contributor

@mz921 mz921 commented Oct 12, 2020

What problem does this PR solve?

This PR adds a search trigger button, and a global search modal for searching events, experiments, and archives more conveniently.

What is changed and how does it work?

  • update /ui/lib/search to add search logic, which use automata to achieve keyword matching
  • add a query parameter named event_id in EventsTable for linking to appropriate event when a user clicks search item
  • add a component named SearchTrigger, which is a search trigger button on Header
  • add a component named Search, which contains the main part of the search functionality

Checklist

Tests

  • Unit test
  • E2E test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Breaking backward compatibility

Related changes

  • Need to update the documentation

Does this PR introduce a user-facing change?

NONE

@fewdan
Copy link
Member

fewdan commented Oct 12, 2020

@wanyoulc Please sign off DCO first.

wanyoulc added 2 commits October 13, 2020 11:16
Signed-off-by: wanyoulc <15694528183@163.com>
Signed-off-by: wanyoulc <15694528183@163.com>
@codecov-io
Copy link

codecov-io commented Oct 13, 2020

Codecov Report

Merging #1034 into master will decrease coverage by 7.89%.
The diff coverage is 26.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1034      +/-   ##
==========================================
- Coverage   55.78%   47.89%   -7.90%     
==========================================
  Files          68       72       +4     
  Lines        4383     4320      -63     
==========================================
- Hits         2445     2069     -376     
- Misses       1768     2042     +274     
- Partials      170      209      +39     
Impacted Files Coverage Δ
api/v1alpha1/common_types.go 0.00% <0.00%> (ø)
api/v1alpha1/common_validation.go 100.00% <ø> (ø)
api/v1alpha1/common_webhook.go 100.00% <ø> (ø)
api/v1alpha1/dnschaos_type.go 0.00% <0.00%> (ø)
api/v1alpha1/dnschaos_webhook.go 0.00% <0.00%> (ø)
api/v1alpha1/httpchaos_types.go 0.00% <0.00%> (ø)
api/v1alpha1/iochaos_types.go 0.00% <ø> (-40.00%) ⬇️
api/v1alpha1/kernelchaos_types.go 0.00% <ø> (-20.00%) ⬇️
api/v1alpha1/kernelchaos_webhook.go 100.00% <ø> (+14.81%) ⬆️
api/v1alpha1/kinds.go 27.27% <ø> (+0.60%) ⬆️
... and 107 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c55adb...161af51. Read the comment docs.

Signed-off-by: wanyoulc <15694528183@163.com>
wanyoulc and others added 2 commits October 13, 2020 15:26
const [loading, setLoading] = useState(false)
const [e, setEvent] = useState<Event | undefined>(undefined)

const fetchEvent = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fewdan Seems that we need to create an interface to get individual events.

ui/src/components/TopContainer/Header.tsx Outdated Show resolved Hide resolved
ui/src/components/TopContainer/Header.tsx Outdated Show resolved Hide resolved
@g1eny0ung
Copy link
Member

@wanyoulc And also, the new searching styles don't fit the dark mode. PTAL.

wanyoulc added 2 commits October 16, 2020 15:52
…nd better maintainability

          add keyboard evnet for triggering search
	  fix some bugs and details

Signed-off-by: wanyoulc <15694528183@163.com>
…aos-mesh into update-global-search

Signed-off-by: wanyoulc <15694528183@163.com>
g1eny0ung and others added 9 commits October 19, 2020 10:28
Signed-off-by: wanyoulc <15694528183@163.com>
Signed-off-by: wanyoulc <15694528183@163.com>
Signed-off-by: wanyoulc <15694528183@163.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: wanyoulc <15694528183@163.com>
add try catch in out of searching process
fix some details

Signed-off-by: wanyoulc <15694528183@163.com>
Signed-off-by: wanyoulc <15694528183@163.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
g1eny0ung
g1eny0ung previously approved these changes Oct 21, 2020
Copy link
Member

@g1eny0ung g1eny0ung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

fewdan
fewdan previously approved these changes Oct 26, 2020
Copy link
Member

@fewdan fewdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@g1eny0ung
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 1029

@fewdan
Copy link
Member

fewdan commented Oct 26, 2020

Please resolve the conflict files. @wanyoulc

@mz921 mz921 dismissed stale reviews from fewdan and g1eny0ung via 161af51 October 27, 2020 02:31
@ti-srebot
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@zhouqiang-cl zhouqiang-cl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhouqiang-cl zhouqiang-cl merged commit db7ce35 into chaos-mesh:master Oct 27, 2020
mz921 added a commit to mz921/chaos-mesh that referenced this pull request Nov 2, 2020
…mesh#1034)

* feat: add global search for events, experiments and archives.

Signed-off-by: wanyoulc <15694528183@163.com>
Signed-off-by: wanyoulc <15694528183@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants