jenkins-bot has submitted this change and it was merged.
Change subject: Always point to collections menu item when creating a collection
......................................................................
Always point to collections menu item when creating a collection
Bug: T95976
Change-Id: Ibdf662a206f55856d906c38fabd62cf23f831d29
---
M resources/ext.gather.init/init.js
M resources/ext.gather.watchstar/CollectionsContentOverlay.js
M resources/ext.gather.watchstar/CollectionsWatchstar.js
3 files changed, 14 insertions(+), 12 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/ext.gather.init/init.js
b/resources/ext.gather.init/init.js
index 71cd1ec..8a53016 100644
--- a/resources/ext.gather.init/init.js
+++ b/resources/ext.gather.init/init.js
@@ -97,18 +97,16 @@
if ( shouldShow ) {
showPointer( watchstar );
}
- watchstar.on( 'completed', function ( firstTimeUser ) {
- var p, tag;
- if ( firstTimeUser ) {
+ watchstar.on( 'completed', function ( firstTimeUser,
isNewCollection ) {
+ if ( isNewCollection ) {
// FIXME: Rename pointer overlay?
- p = new PageActionOverlay( {
+ new PageActionOverlay( {
target: $( '#mw-mf-main-menu-button' ),
summary: mw.msg( 'gather-menu-guider' ),
cancelMsg: mw.msg(
'gather-add-to-collection-cancel' )
- } );
- p.show();
+ } ).show();
// FIXME: Hacky.. Should use MainMenu but Bug:
T93257.
- tag = new Tag( {
+ new Tag( {
label: 'new'
} ).appendTo( '#mw-mf-page-left
.collection-menu-item' );
}
diff --git a/resources/ext.gather.watchstar/CollectionsContentOverlay.js
b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
index 541a14f..7f05eff 100644
--- a/resources/ext.gather.watchstar/CollectionsContentOverlay.js
+++ b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
@@ -273,7 +273,7 @@
this.hide();
if ( currentPageIsMember ) {
- this.emit( 'collection-watch', collection );
+ this.emit( 'collection-watch', collection,
isNew );
// show toast
toast.show( mw.msg( 'gather-add-toast',
collection.title ), 'toast' );
} else {
diff --git a/resources/ext.gather.watchstar/CollectionsWatchstar.js
b/resources/ext.gather.watchstar/CollectionsWatchstar.js
index b9414d6..0988ee0 100644
--- a/resources/ext.gather.watchstar/CollectionsWatchstar.js
+++ b/resources/ext.gather.watchstar/CollectionsWatchstar.js
@@ -111,13 +111,17 @@
pageImageUrl: mw.config.get(
'wgGatherPageImageThumbnail' ),
collections: options.collections
} );
- overlay.on( 'collection-watch', function (
collection ) {
+ overlay.on( 'collection-watch', function (
collection, isNewCollection ) {
/**
* @event completed
- * @param {Boolean} whether user was
prompted
+ * @param {Boolean} firstTimeUser
whether user was prompted
+ * @param {Boolean} newCollection
whether the collection watched is new.
*/
- self.emit( 'completed',
options.wasUserPrompted ||
-
options.isNewlyAuthenticatedUser );
+ self.emit(
+ 'completed',
+ options.wasUserPrompted ||
options.isNewlyAuthenticatedUser,
+ isNewCollection
+ );
if ( collection.isWatchlist ) {
self.newStatus( true );
}
--
To view, visit https://gerrit.wikimedia.org/r/205625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibdf662a206f55856d906c38fabd62cf23f831d29
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jhernandez <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits