mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
Merge pull request #2546 from githubjeka/success-messages
Enh: Remove success flash messages
This commit is contained in:
commit
fda218fa72
@ -99,7 +99,7 @@ humhub.module('stream', function (module, require, $) {
|
||||
|
||||
var that = this;
|
||||
var stream = this.stream();
|
||||
|
||||
|
||||
promise.then(function ($confirm) {
|
||||
if ($confirm) {
|
||||
that.remove(); // Make sure to remove the wallentry node.
|
||||
@ -262,7 +262,6 @@ humhub.module('stream', function (module, require, $) {
|
||||
that.remove().then(function () {
|
||||
stream.loadEntry(that.getKey(), {'prepend': true});
|
||||
});
|
||||
module.log.success('success.pin');
|
||||
} else if (data.info) {
|
||||
module.log.info(data.info, true);
|
||||
} else {
|
||||
@ -298,9 +297,8 @@ humhub.module('stream', function (module, require, $) {
|
||||
StreamEntry.prototype.unpin = function (evt) {
|
||||
var that = this;
|
||||
this.loader();
|
||||
client.post(evt.url).then(function (data) {
|
||||
client.post(evt.url).then(function () {
|
||||
that.stream().init();
|
||||
module.log.success('success.unpin');
|
||||
}).catch(function (e) {
|
||||
module.log.error(e, true);
|
||||
that.loader(false);
|
||||
@ -897,7 +895,7 @@ humhub.module('stream', function (module, require, $) {
|
||||
|
||||
/**
|
||||
* Simple stream component can be used for static streams without load logic (only reload single content).
|
||||
*
|
||||
*
|
||||
* @param {type} container
|
||||
* @param {type} cfg
|
||||
* @returns {humhub.streamL#5.SimpleStream}
|
||||
@ -924,7 +922,7 @@ humhub.module('stream', function (module, require, $) {
|
||||
return client.get(contentModule.config.reloadUrl, {data: {id: contentId}}).then(function (response) {
|
||||
if (response.output) {
|
||||
entry.replace(response.output);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
@ -995,11 +993,11 @@ humhub.module('stream', function (module, require, $) {
|
||||
|
||||
/*
|
||||
This can be used to trace the currently visible entries
|
||||
|
||||
|
||||
var lastKey;
|
||||
// Defines our base y position for changing the current entry
|
||||
var yLimit = scrollTop + (windowHeight / 2);
|
||||
|
||||
|
||||
// Get id of current scroll item
|
||||
//TODO: chache the entry nodes !
|
||||
var matchingNodes = stream.$entryCache.map(function () {
|
||||
@ -1008,11 +1006,11 @@ humhub.module('stream', function (module, require, $) {
|
||||
return $this;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Get the id of the current element
|
||||
var $current = matchingNodes[matchingNodes.length - 1];
|
||||
var currentKey = $current && $current.length ? $current.data('content-key') : "";
|
||||
|
||||
|
||||
if (lastKey !== currentKey) {
|
||||
lastKey = currentKey;
|
||||
// Set/remove active class
|
||||
@ -1082,4 +1080,4 @@ humhub.module('stream', function (module, require, $) {
|
||||
getStream: getStream,
|
||||
getEntry: getEntry
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -113,7 +113,6 @@ class StreamCest
|
||||
$I->click('.preferences .dropdown-toggle', $newEntrySelector);
|
||||
$I->waitForText('Pin', 10);
|
||||
$I->click('Pin', $newEntrySelector);
|
||||
$I->seeSuccess('The content has been pinned.');
|
||||
|
||||
$I->see('This is my first stream test post!', '.s2_streamContent div:nth-child(1)');
|
||||
$I->see('Pinned', $newEntrySelector);
|
||||
@ -122,7 +121,6 @@ class StreamCest
|
||||
$I->click('.preferences .dropdown-toggle', $newEntrySelector);
|
||||
$I->waitForText('Unpin', 10);
|
||||
$I->click('Unpin', $newEntrySelector);
|
||||
$I->seeSuccess('The content has been unpinned.');
|
||||
$I->see('This is my second stream test post!', '.s2_streamContent div:nth-child(1)');
|
||||
$I->dontSee('Pinned', $newEntrySelector);
|
||||
}
|
||||
@ -145,7 +143,7 @@ class StreamCest
|
||||
$I->click('.preferences .dropdown-toggle', $newEntrySelector);
|
||||
$I->waitForText('Edit', 10);
|
||||
$I->click('Edit', $newEntrySelector);
|
||||
|
||||
|
||||
$I->waitForElementVisible($newEntrySelector . ' .content_edit', 20);
|
||||
$I->amGoingTo('cancel my edit');
|
||||
$I->click('.preferences .dropdown-toggle', $newEntrySelector);
|
||||
@ -154,43 +152,43 @@ class StreamCest
|
||||
$I->waitForElementNotVisible($newEntrySelector . ' .content_edit', 20);
|
||||
$I->waitForElementVisible($newEntrySelector . ' .content', 20);
|
||||
$I->see('This is my first stream test post!', $newEntrySelector);
|
||||
|
||||
|
||||
$I->amGoingTo('edit my new post');
|
||||
$I->click('.preferences .dropdown-toggle', $newEntrySelector);
|
||||
$I->waitForText('Edit', 10);
|
||||
$I->click('Edit', $newEntrySelector);
|
||||
|
||||
|
||||
$I->waitForElementVisible($newEntrySelector . ' .content_edit', 20);
|
||||
$I->fillField($newEntrySelector . ' [contenteditable]', 'This is my edited post!');
|
||||
$I->click('Save', $newEntrySelector);
|
||||
|
||||
|
||||
$I->seeSuccess('Saved');
|
||||
$I->seeElement($newEntrySelector);
|
||||
$I->see('This is my edited post!', $newEntrySelector);
|
||||
}
|
||||
|
||||
|
||||
public function testEmptyStream(AcceptanceTester $I)
|
||||
{
|
||||
$I->amUser();
|
||||
$I->amOnSpace3();
|
||||
$I->wantToTest('the empty stream message and filter');
|
||||
|
||||
|
||||
$I->waitForText('This space is still empty!');
|
||||
$I->dontSeeElement('#filter');
|
||||
|
||||
|
||||
$I->amGoingTo('create a new post and delete it afterwards');
|
||||
|
||||
|
||||
$I->createPost('This is my first stream test post!');
|
||||
|
||||
$I->wait(1);
|
||||
|
||||
$I->wait(1);
|
||||
|
||||
$I->amGoingTo('Delete my new post again.');
|
||||
$I->dontSee('This space is still empty!');
|
||||
$I->seeElement('#filter');
|
||||
$I->click('.preferences .dropdown-toggle', '[data-stream-entry]:nth-of-type(1)');
|
||||
$I->wait(1);
|
||||
$I->click('Delete');
|
||||
|
||||
|
||||
$I->waitForElementVisible('#globalModalConfirm', 5);
|
||||
$I->see('Confirm post deletion');
|
||||
$I->click('Delete', '#globalModalConfirm');
|
||||
@ -199,7 +197,7 @@ class StreamCest
|
||||
$I->see('This space is still empty!');
|
||||
$I->dontSeeElement('#filter');
|
||||
}
|
||||
|
||||
|
||||
public function testFilterInvolved(AcceptanceTester $I)
|
||||
{
|
||||
$I->amUser();
|
||||
@ -209,25 +207,25 @@ class StreamCest
|
||||
$I->waitForElementVisible('#filter_entry_userinvolved');
|
||||
$I->click('#filter_entry_userinvolved');
|
||||
$I->waitForText('No matches with your selected filters!');
|
||||
|
||||
|
||||
$I->createPost('Involved Post.');
|
||||
$I->dontSee('No matches with your selected filters!');
|
||||
|
||||
|
||||
$I->amGoingTo('Reset filter');
|
||||
$I->click('.stream-filter', '#filter');
|
||||
$I->waitForElementVisible('#filter_entry_userinvolved');
|
||||
$I->click('#filter_entry_userinvolved');
|
||||
|
||||
|
||||
$I->waitForElementVisible('[data-content-key="10"]');
|
||||
|
||||
|
||||
$I->click('Comment', '[data-content-key="10"]');
|
||||
$I->waitForElementVisible('#newCommentForm_humhubmodulespostmodelsPost_10');
|
||||
$I->fillField('#newCommentForm_humhubmodulespostmodelsPost_10', 'My Comment');
|
||||
$I->click('Send', '#comment_create_form_humhubmodulespostmodelsPost_10');
|
||||
$I->waitForText('My Comment', 30, '#comment_humhubmodulespostmodelsPost_10 .comment');
|
||||
|
||||
|
||||
$I->click('Like', '[data-content-key="11"]');
|
||||
|
||||
|
||||
$I->click('.stream-filter', '#filter');
|
||||
$I->waitForElementVisible('#filter_entry_userinvolved');
|
||||
$I->click('#filter_entry_userinvolved');
|
||||
@ -267,15 +265,15 @@ class StreamCest
|
||||
$I->click('Comment', $post4Selector);
|
||||
$I->fillField($post4Selector . ' [contenteditable]', 'My Comment!');
|
||||
$I->click('Send', $post4Selector . ' .comment-buttons');
|
||||
|
||||
|
||||
$I->scrollTop();
|
||||
|
||||
|
||||
$I->click('.stream-sorting', '#filter');
|
||||
$I->waitForElementVisible('#sorting_u');
|
||||
$I->click('#sorting_u');
|
||||
$I->wait(2);
|
||||
$I->waitForElementVisible($post4Selector);
|
||||
|
||||
|
||||
$I->see('POST4', '.s2_streamContent > [data-stream-entry]:nth-of-type(1)');
|
||||
$I->see('POST5', '.s2_streamContent > [data-stream-entry]:nth-of-type(2)');
|
||||
$I->see('POST3', '.s2_streamContent > [data-stream-entry]:nth-of-type(3)');
|
||||
|
@ -178,8 +178,6 @@ class CoreJsConfig extends Widget
|
||||
'text' => [
|
||||
'success.archive' => Yii::t('ContentModule.widgets_views_stream', 'The content has been archived.'),
|
||||
'success.unarchive' => Yii::t('ContentModule.widgets_views_stream', 'The content has been unarchived.'),
|
||||
'success.pin' => Yii::t('ContentModule.widgets_views_stream', 'The content has been pinned.'),
|
||||
'success.unpin' => Yii::t('ContentModule.widgets_views_stream', 'The content has been unpinned.'),
|
||||
'success.delete' => Yii::t('ContentModule.widgets_views_stream', 'The content has been deleted.'),
|
||||
'info.editCancel' => Yii::t('ContentModule.widgets_views_stream', 'Your last edit state has been saved!'),
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user