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

[Cases] Enhance labels in the bulk edit tags flyout #145811

Merged
merged 13 commits into from
Nov 23, 2022

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Nov 21, 2022

Summary

This PR a) fixes the label when there are no tags, b) adds a label when there are no matches, c) removes a useEffect which is not necessary anymore, and d) shortens the help text for the tags field.

Fixes: #145214

Screenshots

Screenshot 2022-11-19 at 12 57 50 PM

Screenshot 2022-11-19 at 12 45 55 PM

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cnasikas cnasikas added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Nov 21, 2022
@cnasikas cnasikas self-assigned this Nov 21, 2022
@cnasikas cnasikas requested a review from a team as a code owner November 21, 2022 08:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

Copy link
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

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

This works for me and the issue seems fixed.

However, I was playing around with the tags while testing and noticed that in the flyout we display the text:

Add whatever as a tag - as a tag

But if we try to add a tag in the case creation or in the case detail views, the text is

Add whatever as a custom option - as a custom option

It's not a big deal but maybe we could make these consistent in this PR?

Case creationScreenshot 2022-11-21 at 11 31 36
Case DetailScreenshot 2022-11-21 at 11 31 36

Otherwise, looks good to me 👍

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

Placement of the text works for me.

Both texts show for me when I have no tags and open the 'Edit tags' flyout (and before I search anything).

Also, I believe we should avoid using 'Type to...' as an action. 🤔

image

@cnasikas
Copy link
Member Author

Thanks, @adcoelho and @mdefazio! @adcoelho I will update it in this PR.

Also, I believe we should avoid using 'Type to...' as an action. 🤔

@lcawl Any suggestions for the text? I think we should indicate to the users that to add a tag they have to search.

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

UI changes look good.

@lcawl lcawl added the ui-copy Review of UI copy with docs team is recommended label Nov 21, 2022
@@ -51,3 +51,11 @@ export const SELECTED_TAGS = (selectedTags: number) =>
defaultMessage: 'Selected: {selectedTags}',
values: { selectedTags },
});

export const NO_TAGS_AVAILABLE = i18n.translate('xpack.cases.actions.tags.noTagsAvailable', {
defaultMessage: 'No tags available. Type to add one.',
Copy link
Contributor

@lcawl lcawl Nov 21, 2022

Choose a reason for hiding this comment

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

@lcawl Any suggestions for the text? I think we should indicate to the users that to add a tag they have to search.

I think the piece of info I was missing until I tested this myself was "where" we're asking them to type. I suggest changing the string to something like this:

Suggested change
defaultMessage: 'No tags available. Type to add one.',
defaultMessage: 'No tags available. To add a tag, type it in the query bar.',

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, @lcawl! Sorry, I should explain better.

Copy link
Contributor

Choose a reason for hiding this comment

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

I received additional feedback from @gchaps recommending "enter" instead of "type":

Suggested change
defaultMessage: 'No tags available. Type to add one.',
defaultMessage: 'No tags available. To add a tag, enter it in the query bar.',

@peteharverson
Copy link
Contributor

Changes here LGTM, but taking a look on the case view:

image

Now that we have user assignee functionality, should we be using the term assigned for tags here? Would No tags are currently added to this case be better @lcawl?

Also have we lost some spacing vertically between the Reporter, Participants and Tags sections @mdefazio ?

@cnasikas
Copy link
Member Author

Also have we lost some spacing vertically between the Reporter, Participants and Tags sections @mdefazio ?

I think this has to do with some changes in the EuiFlex family components by the EUI team. Could you please open an issue?

@peteharverson
Copy link
Contributor

Also have we lost some spacing vertically between the Reporter, Participants and Tags sections @mdefazio ?

Raised a new issue #146008 for this layout issue in the sidebar.

@lcawl lcawl requested a review from a team as a code owner November 22, 2022 17:40
@lcawl lcawl requested a review from maximpn November 22, 2022 17:40
@lcawl
Copy link
Contributor

lcawl commented Nov 22, 2022

Now that we have user assignee functionality, should we be using the term assigned for tags here? Would No tags are currently added to this case be better @lcawl?

I agree that "assigned" is overloaded now, though I think we still want to follow the layout of the help text for the Assignees section since they're so close. For example:

Was:

Assignees: No users have been assigned.
Tags: No tags are currently assigned to this case.

Should be:

Assignees: No users are assigned.
Tags: No tags are added.

If you want me to add that change as a commit in this PR, @cnasikas, just let me know!

@cnasikas
Copy link
Member Author

Thanks Lisa! I will do it.

});

export const NO_SEARCH_MATCH = i18n.translate('xpack.cases.actions.tags.noTagsMatch', {
defaultMessage: 'No tags available. To add a tag, type it in the query bar.',
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 unless I've missed the discussion thread, this string should remain as it was in the initial commit (i.e. for the case where a search term doesn't match any tags):

Suggested change
defaultMessage: 'No tags available. To add a tag, type it in the query bar.',
defaultMessage: 'No tags match your search.',

@@ -51,3 +51,11 @@ export const SELECTED_TAGS = (selectedTags: number) =>
defaultMessage: 'Selected: {selectedTags}',
values: { selectedTags },
});

export const NO_TAGS_AVAILABLE = i18n.translate('xpack.cases.actions.tags.noTagsAvailable', {
defaultMessage: 'No tags available. Type to add one.',
Copy link
Contributor

Choose a reason for hiding this comment

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

I received additional feedback from @gchaps recommending "enter" instead of "type":

Suggested change
defaultMessage: 'No tags available. Type to add one.',
defaultMessage: 'No tags available. To add a tag, enter it in the query bar.',

@@ -28,8 +28,7 @@ export const schema: FormSchema<AboutStepRule> = {
helpText: i18n.translate(
'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldAuthorHelpText',
{
defaultMessage:
'Type one or more authors for this rule. Press enter after each author to add a new one.',
defaultMessage: 'Separate tags with a line break.',
Copy link
Contributor

Choose a reason for hiding this comment

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

@cnasikas Hey Christos, I believe changes in this file should be reverted, or am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

@banderror You are right. @lcawl I will revert the changes related to the security solution as it is out of the scope of this PR.

@cnasikas cnasikas enabled auto-merge (squash) November 23, 2022 11:22
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
cases 347.4KB 347.3KB -60.0B

Page load bundle

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

id before after diff
cases 127.0KB 127.1KB +139.0B
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 443 449 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 520 526 +6
total +21

History

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

cc @cnasikas

@cnasikas cnasikas merged commit 6d9811e into elastic:main Nov 23, 2022
@cnasikas cnasikas deleted the fix_tags_label branch November 23, 2022 12:56
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 23, 2022
## Summary

This PR a) fixes the label when there are no tags, b) adds a label when
there are no matches, c) removes a `useEffect` which is not necessary
anymore, and d) shortens the help text for the tags field.

Fixes: elastic#145214

## Screenshots

<img width="640" alt="Screenshot 2022-11-19 at 12 57 50 PM"
src="https://user-images.githubusercontent.com/7871006/203005858-e7270771-4aaf-40a6-9174-306bacfb55fd.png">

<img width="639" alt="Screenshot 2022-11-19 at 12 45 55 PM"
src="https://user-images.githubusercontent.com/7871006/203005874-6a42eff5-2c28-4962-8b53-58b2eb21b97e.png">

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: lcawl <lcawley@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 6d9811e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 23, 2022
…146142)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Cases] Enhance labels in the bulk edit tags flyout
(#145811)](#145811)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2022-11-23T12:56:44Z","message":"[Cases]
Enhance labels in the bulk edit tags flyout (#145811)\n\n##
Summary\r\n\r\nThis PR a) fixes the label when there are no tags, b)
adds a label when\r\nthere are no matches, c) removes a `useEffect`
which is not necessary\r\nanymore, and d) shortens the help text for the
tags field.\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/145214\r\n\r\n##
Screenshots\r\n\r\n<img width=\"640\" alt=\"Screenshot 2022-11-19 at 12
57 50
PM\"\r\nsrc=\"https://user-images.githubusercontent.com/7871006/203005858-e7270771-4aaf-40a6-9174-306bacfb55fd.png\">\r\n\r\n<img
width=\"639\" alt=\"Screenshot 2022-11-19 at 12 45 55
PM\"\r\nsrc=\"https://user-images.githubusercontent.com/7871006/203005874-6a42eff5-2c28-4962-8b53-58b2eb21b97e.png\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by:
lcawl <lcawley@elastic.co>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"6d9811ec7dcd732bc6a5984c35cf628e8ca588f8","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","Feature:Cases","ui-copy","backport:prev-minor","v8.7.0"],"number":145811,"url":"https://github.com/elastic/kibana/pull/145811","mergeCommit":{"message":"[Cases]
Enhance labels in the bulk edit tags flyout (#145811)\n\n##
Summary\r\n\r\nThis PR a) fixes the label when there are no tags, b)
adds a label when\r\nthere are no matches, c) removes a `useEffect`
which is not necessary\r\nanymore, and d) shortens the help text for the
tags field.\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/145214\r\n\r\n##
Screenshots\r\n\r\n<img width=\"640\" alt=\"Screenshot 2022-11-19 at 12
57 50
PM\"\r\nsrc=\"https://user-images.githubusercontent.com/7871006/203005858-e7270771-4aaf-40a6-9174-306bacfb55fd.png\">\r\n\r\n<img
width=\"639\" alt=\"Screenshot 2022-11-19 at 12 45 55
PM\"\r\nsrc=\"https://user-images.githubusercontent.com/7871006/203005874-6a42eff5-2c28-4962-8b53-58b2eb21b97e.png\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by:
lcawl <lcawley@elastic.co>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"6d9811ec7dcd732bc6a5984c35cf628e8ca588f8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145811","number":145811,"mergeCommit":{"message":"[Cases]
Enhance labels in the bulk edit tags flyout (#145811)\n\n##
Summary\r\n\r\nThis PR a) fixes the label when there are no tags, b)
adds a label when\r\nthere are no matches, c) removes a `useEffect`
which is not necessary\r\nanymore, and d) shortens the help text for the
tags field.\r\n\r\nFixes:
https://github.com/elastic/kibana/issues/145214\r\n\r\n##
Screenshots\r\n\r\n<img width=\"640\" alt=\"Screenshot 2022-11-19 at 12
57 50
PM\"\r\nsrc=\"https://user-images.githubusercontent.com/7871006/203005858-e7270771-4aaf-40a6-9174-306bacfb55fd.png\">\r\n\r\n<img
width=\"639\" alt=\"Screenshot 2022-11-19 at 12 45 55
PM\"\r\nsrc=\"https://user-images.githubusercontent.com/7871006/203005874-6a42eff5-2c28-4962-8b53-58b2eb21b97e.png\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [x] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\nCo-authored-by:
lcawl <lcawley@elastic.co>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"6d9811ec7dcd732bc6a5984c35cf628e8ca588f8"}}]}]
BACKPORT-->

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) bug Fixes for quality problems that affect the customer experience Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) ui-copy Review of UI copy with docs team is recommended v8.6.0 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution]No tags Available text can be shown under Tag edition of cases
9 participants