Commit graph

26 commits

Author SHA1 Message Date
Roan Kattouw 33124f35a8 Move section methods into a trait
Change-Id: Ief2005918b92945ff93aea85d17e595c7c38adf2
2016-04-28 20:52:09 +00:00
Roan Kattouw c5361da55a Clean up section title handling in mention and edit-user-talk presentation models
They were using different code and different approaches.
I've left getSection() and the code for creating a Title
with a section duplicated for now, and I'll move them
into a trait in the next commit. I wanted to do that
separately because we aren't using traits in this
code base yet.

Change-Id: I56cf745d2cc8a6c43caec08024187de9598cecb8
2016-04-21 18:31:12 -07:00
Roan Kattouw b91360131c Use plaintextParams() for snippets and sections
We ended up double-parsing section titles, which resulted
in strange behavior when the section title was something like
{{tl|infobox}}.

Bug: T132872
Change-Id: I4434624f392cd0e1df39374d45d60f7d83be7161
2016-04-19 16:02:26 +00:00
Matthias Mullie a3d2196851 Notification titles should differentiate subpages of the talk page
Bug: T129686
Change-Id: If3a8eec489cbbea8c2ed7c03b75986ab7fd6c262
2016-03-23 15:19:43 +01:00
Roan Kattouw 1a4bdbc23a MentionPresentationModel: use Title::equals()
Change-Id: Ib0c5b0f5649edef79cf7ad272eb207711af8608d
2016-03-15 15:50:40 -07:00
Roan Kattouw e0581ecff3 Follow-up 9a1defa5: unbreak mention notifications
Actually pass the required User object to getTruncatedUsername().

Change-Id: I69ad0ea12d4b4785fbfeec801228cae518fd0a05
2016-03-11 22:57:20 +00:00
Roan Kattouw 933eecd2ec Follow-up 9a1defa: fix function name typo
Change-Id: I08466603a08496611ede9c0406d95c25a6a70e03
2016-03-10 19:53:34 -08:00
Moriel Schottlender 9a1defa57f Bidi isolate content items in notification header text
Bug: T127407
Change-Id: I25c426f3d0190bd33c4aa1c2ffb3c97fe1424567
2016-03-09 16:22:52 -08:00
Stephane Bisson ac556cf7c7 Notifications: truncate without adjust length
When $adjustLength is false, truncation will only happen
when the string is longer than the limit + the length of
the ellipsis to avoid the case where the ellipsis make
the string longer than the original.

Bug: T121822
Change-Id: I731a3c38b96ede6c6510f64771be0b9662dcba43
2016-03-03 09:08:10 -05:00
Roan Kattouw ff4a54d7f1 MentionPresentationModel: Remove pageLink from secondary links
It wasn't meant to be there, and flow-mention doesn't have it either.
We also don't have any other notification types with
three prioritized secondary links.

Bug: T125949
Change-Id: Icbffa185b1116b1a6beb9bb3585339fdf7e82cdd
2016-02-26 20:41:13 -05:00
Matthias Mullie 4715b55471 Add GENDER support to 'View changes'
Change-Id: I42b8b253b8b865c081ba1aec62848afadd21e0f4
2016-02-23 17:56:16 +01:00
Stephane Bisson 74879c39fb Truncate secondary link labels
Bug: T121822
Change-Id: I3e36a6cd4bc8da96879158e1d7b65fd3a1d582fb
2016-02-18 06:55:36 -05:00
jenkins-bot 59fc1b6f85 Merge "Add snippet to mention notification" 2016-02-01 09:10:05 +00:00
Stephane Bisson 475d724b45 Support GENDER in mention-on-user-talk messages
Also refactored getHeaderMessageKey for grep-ability

Bug: T56433
Change-Id: Ia844c3e0008c7ed24dcc093e3eab41decbcaeb2a
2016-01-29 11:19:12 -05:00
Stephane Bisson 779b7030d9 Truncate usernames, titles and excerpts in notifications
Bug: T121822
Change-Id: Ia0a52926133ab7e04d7d9c2a095ef8f9d0871a49
2016-01-29 07:04:23 -05:00
Stephane Bisson cd7edf0378 Rephrase mention notifications
Split mentions into 4 cases:
 - Mentioned on article talk page
 - Mentioned on agent's talk page
 - Mentioned on another user's talk page
 - Mentioned on any other page

Adjust secondary link
  icon: article or talk
  text: without namespace for article and article talk

Bug: T56433
Change-Id: Ibf965dad4f9cc468fdd4321b2450d6eaec0ac1d7
2016-01-29 07:04:23 -05:00
Stephane Bisson 386bc86233 Add snippet to mention notification
Bug: T121817
Change-Id: I9a77d8ecb1b91f6a196f17777cfabf97c0b59da7
2016-01-21 10:19:14 -05:00
Roan Kattouw 119af0e09a Make the mention notification actually link to the right section
getLocalURL() does not take the fragment into account.

Bug: T123847
Change-Id: I4f8b11c1693ebfcdae69f001057f5db15c11b94f
2016-01-19 09:35:26 -08:00
Roan Kattouw c345bef598 Add icon to "View changes" secondary links
Bug: T121736
Change-Id: I7dda877c26c99392c17702265380f4ea2a6e8049
2016-01-14 22:53:51 -08:00
Justin Du 7d2a15d3bc Clarify some notification icons
* edit-user-talk
* mention
* user-rights
* emailuser

Bug: T121735
Change-Id: I72e382b9ff9d19c6acc0df507fdff65732b66450
2016-01-13 14:00:37 -08:00
Stephane Bisson 421ba29a2f Add agent link to most notifications
Affected notifications are
  - edit-user-talk
  - email-user
  - mention
  - reverted
  - user-rights

Bug: T121737
Change-Id: I826cc6088b4f9c1aaef9e8adee0566d25982ed47
2016-01-11 14:34:39 -08:00
Roan Kattouw f52e653d5d Remove link from mention notification header
We're trying to get rid of links in notification
messages, and the link was redundant with the primary link
in both cases.

Change-Id: I69e888a355c263b5a8c5ca7a46430746895de44c
2015-12-17 15:01:01 -08:00
Matthias Mullie 3f65ed519f Use current (with keys) array format for primary & secondary links
They're currently auto-converted to the new format, but ideally,
we wouldn't need that B/C code. And since this is the extension
others will likely look at for examples when implementing, we
should do it right here.

Also: there is no B/C correction for missing keys in secondary
links (description, icon).

Change-Id: If1a8b9911e81bb4c565f21a4b9e31fdc73426d93
2015-12-16 17:52:04 +01:00
Stephane Bisson 14b842bd34 Add gender support for the viewing user for mention notification
Bug: T119321
Change-Id: I1cd7caa7bfe811bab89a0c6950c1aeaf1739aac6
2015-12-04 16:53:11 -05:00
Kunal Mehta ba957d399a Allow presentation models to indicate a notification can't be formatted
Adds EchoEventPresentationModel::canRender() for notification types to
indicate that something can't be rendered if for example, a page is
deleted.

In that case, the notification is marked as read in a deferred update.
All callers were also updated to check if the notification was formatted
properly.

Bug: T116888
Change-Id: Idb975feaec893ef86c41cc487102e3539c07e328
2015-10-28 18:28:08 -07:00
Kunal Mehta 56c4b95087 Clean up and refactor formatting system
The workflow to format a notification is
* Get EchoEvent, User, and Language
* Get EchoEventFormatter implementation for notification type
** EchoEventFormatter returns structured data about each part of the
notification (header, body, primary link, secondary link(s))
* Each output type will have a formatter class (e.g.
EchoSpecialNotificationsFormatter, EchoPlainTextEmailFormatter) which
takes a EchoEventPresentationModel and generates whatever it wants
(HTML, plain-text email, etc).

Included is an example conversion of the user-rights and mention
formatters. The previous infrastructure will remain in place for
backwards compatability until other extensions can be updated.

Bug: T107823
Change-Id: I4397872a7ec062148dfcb066ddd8ab83f40486ac
2015-10-19 10:00:23 -07:00