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

[Workplace Search] Add API Keys view to replace Access tokens #120147

Merged

Conversation

scottybollinger
Copy link
Contributor

@scottybollinger scottybollinger commented Dec 1, 2021

closes https://github.com/elastic/workplace-search-team/issues/2185
closes https://github.com/elastic/workplace-search-team/issues/2186
closes https://github.com/elastic/workplace-search-team/issues/2188

Summary

As of 8.0, Workplace Search is replacing user-level Access Tokens with account-level API keys. This PR removes the Access Tokens from the UI and adds a new feature for API keys.

Please note that this PR only works with the backend on branch davishmcclurg/frito-pie-api-token.

Removal of Access Tokens

Custom source created confirmation

Before After
cs-created-before cs-created-after

Custom source overview page

Before After
overview-before overview-after
API.keys.mp4

Checklist

@scottybollinger scottybollinger added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 labels Dec 1, 2021
@scottybollinger scottybollinger force-pushed the scottybollinger/api-keys branch from 04a410c to 4f8f12b Compare December 1, 2021 18:34
CI said this was needed due to core changes
Was mistaken that we use the ID, when we actually use the name. Logic was already correct in the frontend code.
@scottybollinger
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@scottybollinger scottybollinger marked this pull request as ready for review December 3, 2021 00:32
@scottybollinger scottybollinger requested a review from a team December 3, 2021 00:32
@scottybollinger scottybollinger requested a review from a team as a code owner December 3, 2021 00:32
@scottybollinger scottybollinger requested a review from a team December 3, 2021 00:32
Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Doclinks updates lgtm

@scottybollinger scottybollinger changed the title [Workplace Search] Add Api Keys view to replace Access tokens [Workplace Search] Add API Keys view to replace Access tokens Dec 3, 2021
This was missed because I copied App Search and it was an included there. Once I had an API, I realized I needed to have the confirm modal, as deleting the API key is destructive
The delete confirm modal would still be visible on error. This always hides the modal
This method does more than show the modal.
Copy link
Contributor

@yakhinvadim yakhinvadim left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

I found only 1 minor issue during testing, that I don't think we need to fix.

On a separate note, I think the best way to organize similar PRs in the future is to do what we did for the migration to Kibana PRs: have a single copy-paste commit and then do the modifications after it.

Comment on lines 85 to 89
pagination={{
...convertMetaToPagination(meta),
hidePerPageOptions: true,
}}
onChange={handlePageChange(onPaginate)}
Copy link
Contributor

Choose a reason for hiding this comment

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

How many items do we expect on 1 page? I thought it's 10, but when I created 20+ items, I still had only 1 page:

Screen Shot 2021-12-03 at 11 49 46 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! This doesn't work for App Search either. Will do some digging and see if it's an easy fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like its an issue with the API, or at least how the UI sends a request to the API:

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine TBH. The pagination will only hurt. With all keys on one page, you can Ctrl+F to search for a key. If we introduce pagination, users would have to open page by page to find the key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Thanks, Vadim! Will wait to merge until backend lands.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great work on this!

@scottybollinger
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1336 1344 +8

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.3MB 1.3MB +9.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 275.5KB 275.6KB +55.0B
enterpriseSearch 15.5KB 15.7KB +133.0B
total +188.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@scottybollinger scottybollinger merged commit 062be17 into elastic:main Dec 7, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
8.0 Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 120147

scottybollinger added a commit to scottybollinger/kibana that referenced this pull request Dec 7, 2021
…c#120147)

# Conflicts:
#	docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
scottybollinger added a commit that referenced this pull request Dec 7, 2021
… (#120565)

# Conflicts:
#	docs/development/core/public/kibana-plugin-core-public.doclinksstart.md
jloleysens added a commit to jloleysens/kibana that referenced this pull request Dec 7, 2021
…-chromium-before-compiling-pdf

* 'main' of github.com:elastic/kibana: (121 commits)
  FTR should use the new kibana_system user (elastic#120436)
  [Lens] Temporarily exclude Mosaic/Waffle from the suggestions list (elastic#120488)
  [Reporting] Fix slow CSV with large max size bytes (elastic#120365)
  [CTI] Threat Intel Card on Overview page needs to accommodate Fleet TI integrations -  (elastic#120459)
  [Dashboard] Added KibanaThemeProvider.  (elastic#120122)
  add more rule_registry unit tests (elastic#120323)
  [Lens] update xpack.lens.pie.smallValuesWarningMessage text (elastic#120478)
  [Fleet] Simplified package policy create API, enriching default values (elastic#119739)
  mock `elastic-apm-node` in `@kbn/test` jest preset (elastic#120324)
  [RAC] Rename occurrences of alert_type to rule_type in Infra (elastic#120455)
  [Security Solutions] Removes tech debt of exporting all from linter rule for timeline plugin (elastic#120437)
  [Workplace Search] Add API Keys view to replace Access tokens (elastic#120147)
  [Security Solutions] Removes tech debt of exporting all from linter rule for cases plugin in the server section (elastic#120411)
  Add support for threat.feed.name (elastic#120250)
  [Rule Registry] Rewrite APM registry rules for Observability (elastic#117740)
  [docs] Fix artifact layout formatting (elastic#119386)
  [Workplace Search] Add a technical preview of connecting GitHub via GitHub apps (elastic#119764)
  add osquery notes for 7.16 (elastic#120407)
  chore(NA): splits types from code on @kbn/docs-utils (elastic#120533)
  [Reporting] Decouple screenshotting plugin from the reporting (elastic#120110)
  ...

# Conflicts:
#	x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.test.ts
#	x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts
#	x-pack/plugins/reporting/server/lib/screenshots/observable.test.ts
#	x-pack/plugins/reporting/server/lib/screenshots/observable.ts
#	x-pack/plugins/reporting/server/test_helpers/create_mock_browserdriverfactory.ts
@scottybollinger scottybollinger deleted the scottybollinger/api-keys branch March 15, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants