errorlib: context support in sentry

* Introduces support for HTTP, and user context in sentry, by
  exploiting information provided in req object when available.
  (closes #1960) (PR #2147)

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: kwalitee fix

* Runs `autopep8` on `websearch_services_regression_tests.py`.
  (PR #2352)

Signed-off-by: Federico Poli <federico.poli@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: new Journal Hint Service

* Adds the Journal Hint Service, that displays
  'Were you looking for a journal reference? Try: <link>'
  when the user search for a raw journal reference.
  (PR #2352)

* Adds unit and regression tests for the new search service.

* Adds two unit tests to `search_from_reference`, just to be sure that
  it accepts unicode.

Signed-off-by: Federico Poli <federico.poli@cern.ch>
Reviewed-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: smarter journal hint

* Improves the JournalHintService implementation by directly
  a brief representation of a record when one is found.
  (PR #2352)

* Additionally, suggests to use find rawref "foo" when "foo"
  is searched for, rather than journal:"bar".

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibSort: improved washers

* Improves speed and realiability of BibSort washers by properly
  exploiting textutils.decode_to_unicode() and
  textutils.translate_to_ascii() functions.
  (PR #2283)

* Improves speed of textutils.translate_to_ascii().
  (addresses #1754)

* Introduces new washer
  _sort_nosymbols_case_insensitive_strip_accents().

* Makes unidecode dependency mandatory.

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibDocFile: bibdocfile.BibDoc memory fix

* Fixes a memory leak in BibDocFile module where BibDoc instances were
  referring to BibDocFiles and viceversa, by using weakref.ref().
  (closes #2082) (PR #2136)

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reported-by: Thorsten Schwander <thorsten.schwander@gmail.com>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
errorlib: fix Sentry context syntax issue

* Fixes Python syntax issue that slipped in the Sentry context support
  commit d73bd94b2fbe8666af31dfec25c334c466e6f6df.
  (addresses #1960) (PR #2147)

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
BibCirculation: fix for CERN returnees

Acked-by: Tibor Simko <tibor.simko@cern.ch>
BibEdit: holding pen fix

* When merging a record with a template, if the record is a hp record
  make all its subfields volatile.

Reviewed-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: debugging all user actions

* On the client side, keeps all actions in a list.

* On the server side, when an exception occurs, the action list is
  displayed on top of the exception.

Co-authored-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: check for record in BibSched queue fix

* Considers all OAIID_TAG, not just the first one.

* Fixes problem when metadata contains regular expression special
  characters.

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: modal submission preview window

* Makes the submission preview window modal.

* Avoid double submission by disabling submit button on click.

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: InvalidCache exception on clone

* Catches InvalidCache exception on clone.

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: int object is not iterable fix

* Fixes "int object is not iterable" exception.

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Reviewed-by: Samuele Kaplun <samuele.kaplun@cern.ch>
WebStyle: req object with no headers

* When scripting, improve handling of mocked req objects
  by supporting cases when no headers are provided.

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibCatalog: requestor on ticket submit

* Passes requestor on ticket submit.

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibCatalog: better error reporting

* Reportis the error output from the RT CLI output when it fails.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: new RT ticket through UI dialog

* Creates a UI dialog on new ticket click. It contains a minimal form
  for quick submission of a new RT ticket.

* For chosen queues can produce template subject and content for the
  ticket, through the use of ticket templates plugin.

* Retrieves all needed information through an Ajax request.

Reviewed-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: duplicate code removal

* Removes duplicate code left-overs.

Signed-off-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Reviewed-by: Samuele Kaplun <samuele.kaplun@cern.ch>
BibEdit: author names into history revisions

* Retrieves the author name for every revision of the record and
  displays it inside the history revision entry.

Reviewed-by: Javier Martin Montull <javier.martin.montull@cern.ch>
Tested-by: Samuele Kaplun <samuele.kaplun@cern.ch>