Skip to content
Permalink
Browse files

Solving conflicts of merge remote-tracking branch 'origin/devel' into…

… LBSD-2258
  • Loading branch information...
eos87 committed Nov 27, 2018
2 parents 58af96f + 197a8ae commit 4e01b15924d21fcdae457d297fe45909e37a58a6
@@ -101,4 +101,5 @@ node_modules

package-lock.json
.vscode/
.python-version
.python-version
setup.cfg
@@ -30,6 +30,7 @@ export default function incomingSyndication(
syndication: {},
});

// simply attach a listener to our store
scope.store.connect((state) => {
scope.posts = state.posts;
scope.syndication = state.syndication;
@@ -61,13 +62,13 @@ export default function incomingSyndication(
// On incoming post, we reload all the posts.
// Not very fast, but easy to setup
scope.$on('posts', (e, data) => {
if (data.hasOwnProperty('deleted') && data.deleted === true
|| data.posts && data.posts[0].syndication_in) {
// let's wait for tasks to finish and then pull data from backend
setTimeout(() => {
IncomingSyndicationActions
.getPosts(scope.blogId, scope.syndId);
}
IncomingSyndicationActions
.getPosts(scope.blogId, scope.syndId);

scope.$apply();
}, 1000);
});

scope.$on('$destroy', scope.store.destroy);
@@ -287,7 +287,7 @@ import listTpl from 'scripts/liveblog-themes/views/list.ng1';
});
}, (error) => {
notify.pop();
notify.error(error.data.error);
notify.error(error.data._message);
});
});
},
@@ -11,8 +11,6 @@ module.exports = function(grunt) {
new webpack.DefinePlugin({
'process.env': {NODE_ENV: JSON.stringify('production')}
})
// new webpack.optimize.DedupePlugin()
// new webpack.optimize.UglifyJsPlugin()
)
}
};
@@ -862,7 +862,7 @@ Feature: Post operations
Given "blogs"
"""
[{"title": "test_blog3", "blog_preferences": {"theme": "forest", "language": "fr"}}]
"""
"""
When we post to "items" with success
"""
[{"text": "open test", "blog": "#blogs._id#"}]
@@ -940,7 +940,7 @@ Feature: Post operations
Then we get list with 3 items
"""
{"_items": [{"post_status":"open", "sticky": true, "order": 2}, {"post_status":"open", "order": 0}, {"post_status":"draft", "order": 1}]}
"""
"""
When we patch "posts/#posts._id#"
"""
{
@@ -950,4 +950,4 @@ Feature: Post operations
Then we get new resource
"""
{"post_status": "open", "sticky": false,"blog": "#blogs._id#", "order": 2}
"""
"""
@@ -321,9 +321,13 @@ def import_file(self, entity_name, path, file_name, index_params, do_patch=False
for index in index_params:
crt_index = list(index) if isinstance(index, list) else index
options = crt_index.pop() if isinstance(crt_index[-1], dict) and isinstance(index, list) else {}
collection = app.data.mongo.pymongo(resource=entity_name).db[entity_name]
index_name = collection.create_index(crt_index, **options)
logger.info(' - index: %s for collection %s created successfully.', index_name, entity_name)

try:
collection = app.data.mongo.pymongo(resource=entity_name).db[entity_name]
index_name = collection.create_index(crt_index, **options)
logger.info(' - index: %s for collection %s created successfully.', index_name, entity_name)
except KeyError:
logger.info(' - Not able to create index: %s. Collection %s not found', index, entity_name)


def fillEnvironmentVariables(item):
@@ -118,7 +118,7 @@ def extract_post_items_data(original_doc):
for group in original_doc['groups']:
if group['id'] == 'main':
for ref in group['refs']:
item = items_service.find_one(req=None, guid=ref['guid'])
item = items_service.find_one(req=None, _id=ref['residRef'])
syndicated_creator = user_service.find_one(req=None, _id=item['original_creator'])
syndicated_obj = None
if syndicated_creator:
@@ -528,6 +528,7 @@ def save_or_update_theme(self, theme, files=[], force_update=False, keep_files=T
else:
response = dict(status='unchanged', theme=theme)
else:
self.check_themes_limit()
self.create([theme])
response = dict(status='created', theme=theme)

@@ -566,14 +567,18 @@ def publish_related_blogs(self, theme):

return blogs

def on_create(self, docs):
def check_themes_limit(self, docs=[]):
subscription = SUBSCRIPTION_LEVEL

if subscription in SUBSCRIPTION_MAX_THEMES:
all = self.find({})

if (all.count() + len(docs) > SUBSCRIPTION_MAX_THEMES[subscription]):
raise SuperdeskApiError.forbiddenError(message='Cannot add another theme.')

def on_create(self, docs):
self.check_themes_limit(docs)

def on_updated(self, updates, original):
# Republish the related blogs if the settings have been changed.
if 'settings' in updates:
@@ -10,3 +10,5 @@ Thumbs.db
index.html
liveblog-default-theme.zip
py-test/env
yarn.lock
package-lock.json

Large diffs are not rendered by default.

@@ -1,4 +1,4 @@
{
"default.css": "default-2afdbfcb68.css",
"default.js": "default-fd850ac8ca.js"
"default.js": "default-32a04b122b.js"
}
@@ -7,22 +7,18 @@ class Permalink {
this.PARAM_NAME = 'liveblog._id', // the parameter name for permalink.
this.regexHash = new RegExp(this.escapeRegExp(this.PARAM_NAME) + '=([^&#]*)');

if (document.parent) {
// use document parent if avalible, see iframe cors limitation.
try {
this.href = document.location.href;
} catch (e) {
// if not use the referrer of the iframe.
this.href = document.referrer;
}
} else {
this.href = document.location.href; // use this option if it is access directly not via iframe.
// first of all, we make sure to have an url
this.href = document.location.href;

// then let's check if we're inside of an iframe
if (window !== window.parent && "referrer" in document) {
this.href = document.referrer;
}

var matches = this.href.match(this.regexHash);

if (matches) {
var arr = decodeURIComponent(matches[1]).split('->');
var arr = decodeURIComponent(matches[1]).split('__');
this._id = arr[0];
if (LB.settings.postOrder !== arr[1]) {
LB.settings.postOrder = arr[1];
@@ -34,7 +30,7 @@ class Permalink {
getUrl(id) {
var permalink = false,
DELIMITER = LB.settings.permalinkDelimiter || '?', // delimiter can be `?` or `#`.
newHash = this.PARAM_NAME + '=' + id + '->' + LB.settings.postOrder;
newHash = this.PARAM_NAME + '=' + id + '__' + LB.settings.postOrder;

if (this.href.indexOf(DELIMITER) === -1) {
permalink = this.href + DELIMITER + newHash;
@@ -91,8 +91,8 @@ vm.getPosts = function(opts) {
var self = this;

var dbQuery = self.getQuery({
sort: opts.sort || self.settings.postOrder,
highlightsOnly: self.settings.onlyHighlighted || false,
sort: opts.sort || settings.postOrder,
highlightsOnly: settings.onlyHighlighted || false,
notDeleted: opts.notDeleted,
fromDate: opts.fromDate ? opts.fromDate : false,
sticky: opts.sticky
@@ -169,7 +169,7 @@ vm.updateViewModel = function(api_response) {
latestUpdate = self.getLatestUpdate(api_response);
}

if (api_response.requestOpts.sort && api_response.requestOpts.sort !== self.settings.postOrder) {
if (api_response.requestOpts.sort && api_response.requestOpts.sort !== settings.postOrder) {
self.vm = getEmptyVm();
view.hideLoadMore(self.isTimelineEnd(api_response));
Object.assign(self.vm, api_response);
@@ -178,7 +178,7 @@ vm.updateViewModel = function(api_response) {
}

if (api_response.requestOpts.sort) {
self.settings.postOrder = api_response.requestOpts.sort;
settings.postOrder = api_response.requestOpts.sort;
}

return api_response;
@@ -1,6 +1,6 @@
{
"name": "liveblog-default-theme",
"version": "3.3.95",
"version": "3.3.96",
"description": "Liveblog 3 SEO theme",
"author": "Paul Solbach <psolbach@dpa-newslab.com>, Massimo Scamarcia <massimo.scamarcia@sourcefabric.org>",
"license": "AGPL-3.0",
@@ -1,7 +1,7 @@
{
"label": "Liveblog 3 Default SEO Theme",
"name": "default",
"version": "3.3.95",
"version": "3.3.96",
"asyncTheme": true,
"seoTheme": true,
"author": "Sourcefabric <contact@sourcefabric.org>",
@@ -17,9 +17,9 @@
},
"license": "AGPL-3.0",
"devStyles": ["dist/default-2afdbfcb68.css"],
"devScripts": ["dist/default-fd850ac8ca.js"],
"devScripts": ["dist/default-32a04b122b.js"],
"styles": ["dist/default-2afdbfcb68.css"],
"scripts": ["dist/default-fd850ac8ca.js"],
"scripts": ["dist/default-32a04b122b.js"],
"options": [
{
"name": "language",
@@ -0,0 +1,14 @@
npm-debug.log
.settings
.project
.idea
node_modules
*.swp
.tmp
Thumbs.db
!*.pot
index.html
liveblog-simple-theme.zip
py-test/env
yarn.lock
package-lock.json
@@ -322,7 +322,8 @@ def env(variable, fallback_value=None):
SUBSCRIPTION_LEVEL = env('SUBSCRIPTION_LEVEL', SUBSCRIPTION_LEVEL_NETWORK)
SUBSCRIPTION_MAX_ACTIVE_BLOGS = {SUBSCRIPTION_LEVEL_SOLO: 1, SUBSCRIPTION_LEVEL_TEAM: 3}
SUBSCRIPTION_MAX_BLOG_MEMBERS = {SUBSCRIPTION_LEVEL_SOLO: 2, SUBSCRIPTION_LEVEL_TEAM: 4}
SUBSCRIPTION_MAX_THEMES = {SUBSCRIPTION_LEVEL_SOLO: 1, SUBSCRIPTION_LEVEL_TEAM: 5}
# TODO: fix before release
SUBSCRIPTION_MAX_THEMES = {SUBSCRIPTION_LEVEL_SOLO: 1, SUBSCRIPTION_LEVEL_TEAM: 6, SUBSCRIPTION_LEVEL_NETWORK: 6}
ACCESS_SUBSCRIPTIONS_MOBILE = ['solo-mobile', 'team', 'network']

# Settings to NO_TAKES for PACKAGES in ARCHIVE
@@ -1,4 +1,4 @@
[flake8]
max-line-length=120
exclude=env,bin,lib,include,src
ignore=F811,W605,W503,W504
ignore=F811,W605,W503,W504

0 comments on commit 4e01b15

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