Skip to content
Permalink
Browse files

Release v3.7.1 - Merge pull request #1275

 from liveblog/release/3.7.1
  • Loading branch information
eos87 committed Nov 29, 2019
2 parents fe76147 + 15598af commit 506ab0ad10b40ec88a59084f0495a4e25bf62389
Showing with 800 additions and 564 deletions.
  1. +3 −7 .github/workflows/continuous-integration.yml
  2. +1 −1 README.md
  3. +2 −2 client/app/index.html
  4. +3 −12 client/app/scripts/liveblog-bloglist/controllers/blog-list.js
  5. +22 −3 client/app/scripts/liveblog-bloglist/directives/user-select-list.js
  6. +3 −1 client/app/scripts/liveblog-edit/controllers/blog-edit.js
  7. +25 −9 client/app/scripts/liveblog-edit/controllers/blog-settings.js
  8. +4 −29 client/app/scripts/liveblog-edit/posts.service.js
  9. +10 −2 client/app/scripts/liveblog-edit/styles/settings.scss
  10. +25 −9 client/app/scripts/liveblog-edit/views/main.ng1
  11. +1 −1 client/app/scripts/liveblog-edit/views/post.ng1
  12. +5 −4 client/app/scripts/liveblog-edit/views/settings.ng1
  13. +16 −0 client/app/template/superdesk-override/apps/desks/views/user-select.html
  14. +3 −3 client/package.json
  15. +20 −18 client/webpack.config.js
  16. +1 −1 package.json
  17. +3 −1 server/liveblog/blogs/blog.py
  18. +53 −94 server/liveblog/client_modules/client_modules.py
  19. +3 −2 server/liveblog/client_modules/client_modules_test.py
  20. +75 −0 server/liveblog/posts/mixins.py
  21. +8 −1 server/liveblog/posts/posts.py
  22. +1 −1 server/liveblog/prepopulate/app_prepopulate_data.json
  23. +6 −3 server/liveblog/prepopulate/test.json
  24. +1 −1 server/liveblog/themes/themes_assets/amp/package.json
  25. +434 −357 server/liveblog/themes/themes_assets/amp/theme.json
  26. +1 −1 server/liveblog/themes/themes_assets/default/package.json
  27. +71 −1 server/liveblog/themes/themes_assets/default/theme.json
@@ -1,6 +1,6 @@
name: Liveblog CI

on: [push]
on: [push, pull_request]

jobs:
build:
@@ -42,17 +42,13 @@ jobs:
ports:
- 9200:9200

strategy:
matrix:
node-version: [8.x, 10.x]

steps:
- uses: actions/checkout@v1

- name: Setup Nodejs ${{ matrix.node-version }}
- name: Setup Nodejs 8.x
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: 8.x

- name: Setup Python 3.5
uses: actions/setup-python@v1
@@ -3,7 +3,7 @@
[Fork](https://github.com/liveblog/liveblog) •
[License](https://github.com/liveblog/liveblog/blob/master/LICENSE) •
[Documentation](http://sourcefabric.booktype.pro/live-blog-30-for-journalists/what-is-live-blog/) •
*Version 3.7.0*
*Version 3.7.1*

[![Liveblog CI](https://github.com/liveblog/liveblog/workflows/Liveblog%20CI/badge.svg)](https://github.com/liveblog/liveblog/actions)

@@ -52,10 +52,10 @@ <h3 class="modal__heading" translate>About</h3>
<div class="about-page-text">
<p>
<div style="font-weight: 700" translate>
Live Blog 3.7.0
Live Blog 3.7.1
</div>
<div translate>
Released on Oct 22, 2019
Released on Nov 29, 2019
</div>
</p>
<p translate>
@@ -13,7 +13,6 @@ BlogListController.$inject = [
'notify',
'config',
'urls',
'moment',
'modal',
'blogService',
];
@@ -31,7 +30,6 @@ export default function BlogListController(
notify,
config,
urls,
moment,
modal,
blogService
) {
@@ -122,17 +120,10 @@ export default function BlogListController(
};

$scope.askRemoveBlog = function() {
modal.confirm(gettext('Are you sure you want to delete the blog(s)?'))
modal.confirm(`The blog(s) will be in <b>Deleted Blogs</b> tab during ${config.daysRemoveDeletedBlogs}
day(s), after that period will be removed permanently.<br /><br />
Are you sure you want to delete the blog(s)?`)
.then(() => {
// var selectedBlogs = [];

// angular.forEach($scope.blogs._items, (blog) => {
// if (blog.selected) {
// bulkDelete(blog);
// }
// });

// $scope.blogs._items = $scope.blogs._items.filter((el) => selectedBlogs.indexOf(el) < 0);
$scope.bulkAction(DELETED_STATE);
});
};
@@ -6,6 +6,7 @@ export default function lbUserSelectList(api) {
members: '=',
user: '=',
onchoose: '&',
showinactive: '=',
},
templateUrl: 'scripts/apps/desks/views/user-select.html',
link: function(scope, elem, attrs) {
@@ -17,17 +18,34 @@ export default function lbUserSelectList(api) {
scope.search = null;
scope.users = {};

scope.done = false;
scope.searching = false;

const _refresh = function() {
scope.users = {};
return api('users').query({where: JSON.stringify({
scope.searching = true;
scope.done = false;

const filters = {
$or: [
{username: {$regex: scope.search, $options: '-i'}},
{first_name: {$regex: scope.search, $options: '-i'}},
{last_name: {$regex: scope.search, $options: '-i'}},
{email: {$regex: scope.search, $options: '-i'}},
],
})})
};

if (scope.showinactive !== true) {
filters.is_active = true;
filters.needs_activation = false;
}

return api('users')
.query({where: JSON.stringify(filters)})
.then((result) => {
scope.searching = false;

// let's exclude current user
for (var i = 0; i < result._items.length; i++) {
var obj = result._items[i];

@@ -47,9 +65,10 @@ export default function lbUserSelectList(api) {
return !found;
});
scope.selected = null;
scope.done = true;
});
};
const refresh = _.debounce(_refresh, 1000);
const refresh = _.debounce(_refresh, 500);

scope.$watch('search', () => {
if (scope.search) {
@@ -489,7 +489,7 @@ export default function BlogEditController(
},
showSaveAsDraft: function() {
if (angular.isDefined($scope.currentPost)) {
return $scope.currentPost.original_creator === session.identity._id;
return $scope.currentPost.original_creator._id === session.identity._id;
}

return true;
@@ -569,6 +569,7 @@ export default function BlogEditController(
.then((post) => {
notify.pop();
notify.info(gettext('Contribution submitted'));
cleanUpFlag();
cleanEditor();
$scope.selectedPostType = 'Default';
$scope.actionPending = false;
@@ -586,6 +587,7 @@ export default function BlogEditController(
.then((post) => {
notify.pop();
notify.info(gettext('Draft saved'));
cleanUpFlag();
cleanEditor();
$scope.selectedPostType = 'Default';
$scope.actionPending = false;
@@ -14,9 +14,11 @@ import _ from 'lodash';
import './../../ng-sir-trevor';
import './../../sir-trevor-blocks';
import './../unread.posts.service';
import {DELETED_STATE} from '../../liveblog-bloglist/controllers/constants';

import outputEmbedCodeTpl from 'scripts/liveblog-edit/views/output-embed-code-modal.ng1';


BlogSettingsController.$inject = [
'$scope',
'blog',
@@ -27,16 +29,13 @@ BlogSettingsController.$inject = [
'gettext',
'modal',
'$q',
'upload',
'datetimeHelper',
'config',
'blogSecurityService',
'moment',
'superdesk',
'urls',
'$rootScope',
'postsService',

];

function BlogSettingsController(
@@ -49,13 +48,11 @@ function BlogSettingsController(
gettext,
modal,
$q,
upload,
datetimeHelper,
config,
blogSecurityService,
moment,
superdesk,
urls,
$rootScope,
postsService
) {
@@ -404,20 +401,39 @@ function BlogSettingsController(
return deferred.promise;
},
askRemoveBlog: function() {
modal.confirm(gettext('Are you sure you want to delete the blog?'))
modal.confirm(`The blog will be in <b>Deleted Blogs</b> tab during ${config.daysRemoveDeletedBlogs}
day(s), after that period will be removed permanently.<br /><br />
Are you sure you want to delete this blog?`)
.then(() => {
vm.removeBlog();
});
},
removeBlog: function() {
api.blogs.remove(angular.copy(vm.blog)).then((message) => {
const blog = vm.blog;
const changedBlog = {
blog_status: DELETED_STATE.code,
};

let newBlog = angular.copy(blog);

angular.extend(newBlog, changedBlog);
delete newBlog._latest_version;
delete newBlog._current_version;
delete newBlog._version;
delete newBlog.marked_for_not_publication;
delete newBlog._type;
delete newBlog.selected;
delete newBlog.firstcreated;
newBlog.original_creator = blog.original_creator._id;

blogService.update(blog, newBlog).then((resp) => {
notify.pop();
notify.info(gettext('Blog removed'));
notify.info(gettext('The blog will be deleted'));
$location.path('/liveblog');
}, () => {
notify.pop();
notify.error(gettext('Something went wrong'));
$location.path('/liveblog/edit/' + vm.blog._id);
$location.path('/liveblog/edit/' + blog._id);
});
},
close: function() {
@@ -19,8 +19,6 @@ postsService.$inject = [
];

export default function postsService(api, $q, userList, session) {
var listOfUsers = [];

function filterPosts(filters, postsCriteria) {
// filters.status
if (angular.isDefined(filters.status)) {
@@ -122,27 +120,14 @@ export default function postsService(api, $q, userList, session) {
* information later (profile_url, name, etc)
*
* @param {Object} obj Post or item belonging to post
* @param {String} postCreator (optional) - Id of user to look for
*/
function _completeUser(obj, postCreator) {
function _completeUser(obj) {
if (obj.commenter) {
obj.user = {display_name: obj.commenter};
} else if (obj.syndicated_creator) {
obj.user = obj.syndicated_creator;
} else {
// we pull a set of users from the backend and store it
// in a variable. Max results will be 199, if user is not found
// then if will hit backend to try to retrieve user from db
var userId = postCreator || obj.original_creator;
var postUser = listOfUsers.find((x) => x._id === userId);

if (!postCreator) {
userList.getUser(postCreator || obj.original_creator).then((user) => {
obj.user = user;
});
} else {
obj.user = postUser;
}
} else if (typeof obj.original_creator === 'object') {
obj.user = obj.original_creator;
}

return obj;
@@ -179,7 +164,7 @@ export default function postsService(api, $q, userList, session) {
});

// let's now complete user for main post
_completeUser(post.mainItem.item, post.original_creator);
post.mainItem.item.user = post.original_creator;

resolve(post);
});
@@ -221,16 +206,6 @@ export default function postsService(api, $q, userList, session) {
}

function retrievePosts(blogId, postsCriteria) {
// preload users to avoid pulling them one by one
// to later use them to attach creator data to each post
if (listOfUsers.length === 0) {
api('users')
.getAll()
.then((data) => {
listOfUsers = data;
});
}

return api('blogs/<regex("[a-f0-9]{24}"):blog_id>/posts', {_id: blogId})
.query(postsCriteria)
.then(retrieveSyndications)
@@ -221,9 +221,17 @@ $PADDING: 20px;
min-height: 240px;
}

.edit-contributors {
.edit-contributors.edit-contributors {
.search-result {
top: 69px!important;
top: 69px;
width: 440px;
left: 20px;
}

.search-result.no-records,
.search-result.searching {
height: 38px;
overflow: hidden;
}
}
.pending-blog-member {

0 comments on commit 506ab0a

Please sign in to comment.
You can’t perform that action at this time.