Closed Bug 1183759 Opened 10 years ago Closed 5 years ago

keyword suggestions should not show keywords which have been already selected

Categories

(bugzilla.mozilla.org :: User Interface, defect, P5)

Production
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: dietrich, Assigned: manya18ag, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [october-2019-bmo-triage])

Attachments

(1 file)

46 bytes, text/x-github-pull-request
Details | Review
Eg, if I select "regression", then type "reg" it shows both "regression" and "regressionwindow-wanted".

We'll accept a patch, please check with the mentor for this bug.

Mentor: dkl
Keywords: good-first-bug
Priority: -- → P5

Hi! I'm a first-time contributor and I'd like to work on this bug. May I know the steps required to fix it?

Flags: needinfo?(dkl)

I would like to take up this task. can u please elaborate the bug & provide the necessary guidance. Thanks!!

Hi, I have some queries regarding this bug:

  1. On the bug creation page, I could not observe any changes by editing code in bug_modal.js but changes in field.js seemed to be reflecting. Does this mean that both files need to be edited for different uses?
  2. Is it okay to take the value from the input text field for the current keywords or are they specifically stored in some variable?

Thanks!

(In reply to manya18ag from comment #4)

Hi, I have some queries regarding this bug:

  1. On the bug creation page, I could not observe any changes by editing code in bug_modal.js but changes in field.js seemed to be reflecting. Does this mean that both files need to be edited for different uses?

Yes, the new bug creation page is a different workflow from edit bug.

  1. Is it okay to take the value from the input text field for the current keywords or are they specifically stored in some variable?

If you mean to take the values in the input field and use that to update the list used by the autocomplete, I'd recommend checking what the submit handler does (if it looks for the list of keywords in an existing variable, or constructs the value to send.)

Also watch out for what to do when a person removes a keyword from the input and decides to add it back.

Flags: needinfo?(dkl)

(In reply to manya18ag from comment #4)

Hi, I have some queries regarding this bug:

  1. On the bug creation page, I could not observe any changes by editing code in bug_modal.js but changes in field.js seemed to be reflecting. Does this mean that both files need to be edited for different uses?

As Emma mentioned and due to the fragmentation we currently have with the enter bug page and the edit bug page, yes the code is different for the enter bug page.

The three non bug editing places you need to focus on are:
https://github.com/mozilla-bteam/bmo/blob/master/template/en/default/bug/field.html.tmpl#L262-L275
https://github.com/mozilla-bteam/bmo/blob/master/js/field.js#L710-L756
https://github.com/mozilla-bteam/bmo/blob/master/template/en/default/search/field.html.tmpl#L49-L73

  1. Is it okay to take the value from the input text field for the current keywords or are they specifically stored in some variable?

We will need to add a 'data' attribute to the form field for keywords and store the current delimited values there for the JS to access. Maybe colons, commas. Not sure. Some delimiter that would not be in the keyword values.

The form field would be something like

<input type="text" id="keywords" data-values="foo:bar">

Then you could access the current values using something like

current_keywords = $('#keywords').data('values').split(':');

Tnanks!

Hi,

  1. Is it okay to take the value from the input text field for the current keywords or are they specifically stored in some variable?

We will need to add a 'data' attribute to the form field for keywords and store the current delimited values there for the JS to access. Maybe colons, commas. Not sure. Some delimiter that would not be in the keyword values.

The form field would be something like

<input type="text" id="keywords" data-values="foo:bar">

Then you could access the current values using something like

current_keywords = $('#keywords').data('values').split(':');

For this part, I accessed the input field values directly in the javascript files. I can make changes to the code if that might not be a proper method of dealing with it. You can view my code here: https://github.com/mozilla-bteam/bmo/pull/1540

Thanks!

Flags: needinfo?(dkl)
Attached file GitHub Pull Request

Merged to master. Will be in the next deployment.

Assignee: nobody → manya18ag
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(dkl)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: