Skip to content

[App Search] Detail Page for Automated Curations#113550

Merged
byronhulcher merged 24 commits intoelastic:masterfrom
byronhulcher:automated-curation-detail
Oct 4, 2021
Merged

[App Search] Detail Page for Automated Curations#113550
byronhulcher merged 24 commits intoelastic:masterfrom
byronhulcher:automated-curation-detail

Conversation

@byronhulcher
Copy link
Copy Markdown
Contributor

@byronhulcher byronhulcher commented Sep 30, 2021

Summary

The Curation view has now split into the ManualCuration and AutomatedCuration views. ManualCuration is unchanged from the old Curation while AutomatedCuration is new, with the differences being:

  • Automated Badge
  • A "convert to manual" button
  • Buttons and other actions to modify the curation are hidden
  • Updated copy for when user cannot modify the curation

Screenshots

Screen Shot 2021-09-30 at 12 23 04 PM

Checklist

@byronhulcher byronhulcher added auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v7.16.0 Feature:Plugins labels Sep 30, 2021
@byronhulcher byronhulcher marked this pull request as ready for review September 30, 2021 16:37
@byronhulcher byronhulcher requested a review from a team September 30, 2021 16:37
@byronhulcher byronhulcher force-pushed the automated-curation-detail branch from e0711cb to 1d29af1 Compare September 30, 2021 21:12
@byronhulcher
Copy link
Copy Markdown
Contributor Author

retest

"xpack.enterpriseSearch.appSearch.engine.curations.manageQueryButtonLabel": "クエリを管理",
"xpack.enterpriseSearch.appSearch.engine.curations.manageQueryDescription": "このキュレーションのクエリを編集、追加、削除します。",
"xpack.enterpriseSearch.appSearch.engine.curations.manageQueryTitle": "クエリを管理",
"xpack.enterpriseSearch.appSearch.engine.curations.organicDocuments.emptyDescription": "表示するオーガニック結果はありません。上記のアクティブなクエリを追加または変更します。",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm pretty sure you don't have to prune these old labels, and that they will be pruned automatically by the i18n process. This is something @constancecchen mentioned before (if I recall correctly), though I'm not sure I'd be able to find the PR where she talks about that or any documentation to back that up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I got CI failures from these unpruned ones, I'll reach out to you next time I see that happen.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re: i18n failures - if you run node scripts/i18n_check --fix it'll handle removing stuff for you automatically without having to open the file!

More reading: https://github.com/elastic/kibana-team/blob/master/localization.md (their diagram is neat and worth expanding, + the info around how and when they manage scheduling for i18n)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Re: i18n failures - if you run node scripts/i18n_check --fix it'll handle removing stuff for you automatically without having to open the file!

👍 I used that to remove these, just highlighting that they're not pruned automatically.

Copy link
Copy Markdown
Member

@JasonStoltz JasonStoltz left a comment

Choose a reason for hiding this comment

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

This code all looks great. I just left a couple of comments. Full disclosure, it takes forever for me to pull down a new branch and rebuild to test, so I did not test this locally.

import { PromotedDocuments, OrganicDocuments } from './documents';

export const AutomatedCuration: React.FC = () => {
const { curationId } = useParams() as { curationId: string };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suspect you can do something like this instead to avoid casting.

const { curationId } = useParams<{ curationId: string }>();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I did this in 9930246

Comment on lines +29 to +30
const { convertToManual } = useActions(CurationLogic({ curationId }));
const { activeQuery, dataLoading, queries } = useValues(CurationLogic({ curationId }));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Purely out of curiosity, do you know if there is any functional difference between what you have and the following? The later avoids instantiating the logic twice, but I don't know if it matters or not.

Suggested change
const { convertToManual } = useActions(CurationLogic({ curationId }));
const { activeQuery, dataLoading, queries } = useValues(CurationLogic({ curationId }));
const logic = CurationLogic({ curationId });
const { convertToManual } = useActions(logic);
const { activeQuery, dataLoading, queries } = useValues(logic);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No reason! I'll go with yours

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've done this in 9930246. I think its effectively the same, but I think instantiating it once is a better practice, in casse we use a lot of props in other logic files.

});

describe('draggging', () => {
describe('dragging', () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤠

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

😇

@byronhulcher byronhulcher enabled auto-merge (squash) October 4, 2021 19:52
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1503 1505 +2

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 +2.4KB

History

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 5, 2021
Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>
brianseeders added a commit that referenced this pull request Oct 5, 2021
@brianseeders
Copy link
Copy Markdown
Contributor

Apologies @byronhulcher, this needed to be reverted. It was causing type checks to fail, see here: https://buildkite.com/elastic/kibana-hourly/builds/906#ccd9944c-5587-4b24-8502-a73bd37d4145

It likely conflicted with something else that was merged in since the last time you merged upstream

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 Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes reverted v7.16.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants