From dbb1a86ca377e551063cc04c5189fad4aa9148c0 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 15 Dec 2018 20:39:01 +0200 Subject: - Admin Panel / Layout / Custom Product Name now changes webpage title. Thanks to xet7 ! Related #1196 --- client/components/settings/settingBody.js | 2 ++ client/lib/utils.js | 20 ++++++++++++++++++++ config/router.js | 27 ++++++++++++++++----------- models/settings.js | 15 ++++++++++++++- models/trelloCreator.js | 4 ++-- models/wekanCreator.js | 2 +- 6 files changed, 55 insertions(+), 15 deletions(-) diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index ddb4cd0f..3f6f36f4 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -155,6 +155,8 @@ BlazeComponent.extendComponent({ this.setLoading(false); } + DocHead.setTitle(productName); + saveMailServerInfo(); }, diff --git a/client/lib/utils.js b/client/lib/utils.js index 525cfb83..d46d8076 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -145,6 +145,26 @@ Utils = { }); }, + manageCustomUI(){ + Meteor.call('getCustomUI', (err, data) => { + if (err && err.error[0] === 'var-not-exist'){ + Session.set('customUI', false); // siteId || address server not defined + } + if (!err){ + Utils.setCustomUI(data); + } + }); + }, + + setCustomUI(data){ + const currentBoard = Boards.findOne(Session.get('currentBoard')); + if (currentBoard) { + DocHead.setTitle(`${currentBoard.title } - ${ data.productName}`); + } else { + DocHead.setTitle(`${data.productName}`); + } + }, + setMatomo(data){ window._paq = window._paq || []; window._paq.push(['setDoNotTrack', data.doNotTrack]); diff --git a/config/router.js b/config/router.js index 91d08897..80e89e4c 100644 --- a/config/router.js +++ b/config/router.js @@ -14,6 +14,7 @@ FlowRouter.route('/', { Filter.reset(); EscapeActions.executeAll(); + Utils.manageCustomUI(); Utils.manageMatomo(); BlazeLayout.render('defaultLayout', { @@ -40,6 +41,7 @@ FlowRouter.route('/b/:id/:slug', { EscapeActions.executeUpTo('popup-close'); } + Utils.manageCustomUI(); Utils.manageMatomo(); BlazeLayout.render('defaultLayout', { @@ -57,6 +59,7 @@ FlowRouter.route('/b/:boardId/:slug/:cardId', { Session.set('currentBoard', params.boardId); Session.set('currentCard', params.cardId); + Utils.manageCustomUI(); Utils.manageMatomo(); BlazeLayout.render('defaultLayout', { @@ -122,6 +125,7 @@ FlowRouter.route('/setting', { }, ], action() { + Utils.manageCustomUI(); BlazeLayout.render('defaultLayout', { headerBar: 'settingHeaderBar', content: 'setting', @@ -199,20 +203,21 @@ _.each(redirections, (newPath, oldPath) => { // using the `kadira:dochead` package. Currently we only use it to display the // board title if we are in a board page (see #364) but we may want to support // some tags in the future. -const appTitle = 'Wekan'; +//const appTitle = Utils.manageCustomUI(); // XXX The `Meteor.startup` should not be necessary -- we don't need to wait for // the complete DOM to be ready to call `DocHead.setTitle`. But the problem is // that the global variable `Boards` is undefined when this file loads so we // wait a bit until hopefully all files are loaded. This will be fixed in a // clean way once Meteor will support ES6 modules -- hopefully in Meteor 1.3. -Meteor.isClient && Meteor.startup(() => { - Tracker.autorun(() => { - const currentBoard = Boards.findOne(Session.get('currentBoard')); - const titleStack = [appTitle]; - if (currentBoard) { - titleStack.push(currentBoard.title); - } - DocHead.setTitle(titleStack.reverse().join(' - ')); - }); -}); +//Meteor.isClient && Meteor.startup(() => { +// Tracker.autorun(() => { + +// const currentBoard = Boards.findOne(Session.get('currentBoard')); +// const titleStack = [appTitle]; +// if (currentBoard) { +// titleStack.push(currentBoard.title); +// } +// DocHead.setTitle(titleStack.reverse().join(' - ')); +// }); +//}); diff --git a/models/settings.js b/models/settings.js index 52212809..5db57cd8 100644 --- a/models/settings.js +++ b/models/settings.js @@ -74,7 +74,7 @@ if (Meteor.isServer) { if(!setting){ const now = new Date(); const domain = process.env.ROOT_URL.match(/\/\/(?:www\.)?(.*)?(?:\/)?/)[1]; - const from = `Wekan `; + const from = `Boards Support `; const defaultSetting = {disableRegistration: false, mailServer: { username: '', password: '', host: '', port: '', enableTLS: false, from, }, createdAt: now, modifiedAt: now}; @@ -210,6 +210,19 @@ if (Meteor.isServer) { }; }, + getCustomUI(){ + const setting = Settings.findOne({}); + if (!setting.productName) { + return { + productName: 'Wekan', + }; + } else { + return { + productName: `${setting.productName}`, + }; + } + }, + getMatomoConf(){ return { address: getEnvVar('MATOMO_ADDRESS'), diff --git a/models/trelloCreator.js b/models/trelloCreator.js index b5a255cc..3ac511a5 100644 --- a/models/trelloCreator.js +++ b/models/trelloCreator.js @@ -268,7 +268,7 @@ export class TrelloCreator { } // insert card const cardId = Cards.direct.insert(cardToCreate); - // keep track of Trello id => WeKan id + // keep track of Trello id => Wekan id this.cards[card.id] = cardId; // log activity // Activities.direct.insert({ @@ -431,7 +431,7 @@ export class TrelloCreator { sort: checklist.pos, }; const checklistId = Checklists.direct.insert(checklistToCreate); - // keep track of Trello id => WeKan id + // keep track of Trello id => Wekan id this.checklists[checklist.id] = checklistId; // Now add the items to the checklistItems let counter = 0; diff --git a/models/wekanCreator.js b/models/wekanCreator.js index fa950970..2d3ec5de 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -300,7 +300,7 @@ export class WekanCreator { } // insert card const cardId = Cards.direct.insert(cardToCreate); - // keep track of Wekan id => WeKan id + // keep track of Wekan id => Wekan id this.cards[card._id] = cardId; // // log activity // Activities.direct.insert({ -- cgit v1.2.3-1-g7c22 From 4bd74b58170cd93a1de0b9ab9b203c67ff514e14 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 15 Dec 2018 20:46:47 +0200 Subject: - Admin Panel / Layout / Custom Product Name [now changes webpage title](https://github.com/wekan/wekan/commit/dbb1a86ca377e551063cc04c5189fad4aa9148c0). Related #1196 Thanks to xet7 ! --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb129ea2..9357cc4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# Upcoming Wekan release + +This release adds the following new features: + +- Admin Panel / Layout / Custom Product Name [now changes webpage title](https://github.com/wekan/wekan/commit/dbb1a86ca377e551063cc04c5189fad4aa9148c0). + Related #1196 + +Thanks to GitHub user xet7 for contributions. + # v1.88 2018-12-14 Wekan release This release fixes the following bugs: -- cgit v1.2.3-1-g7c22 From 209a76c5cea4e641a9d60fe9597c3bc820a7e766 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 15 Dec 2018 20:52:11 +0200 Subject: v1.89 --- CHANGELOG.md | 2 +- package.json | 2 +- sandstorm-pkgdef.capnp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9357cc4d..f47e8dcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Upcoming Wekan release +# v1.89 2018-12-15 Wekan release This release adds the following new features: diff --git a/package.json b/package.json index 63d7d060..8fceb6e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wekan", - "version": "v1.88.0", + "version": "v1.89.0", "description": "Open-Source kanban", "private": true, "scripts": { diff --git a/sandstorm-pkgdef.capnp b/sandstorm-pkgdef.capnp index 3da80867..f5d24601 100644 --- a/sandstorm-pkgdef.capnp +++ b/sandstorm-pkgdef.capnp @@ -22,10 +22,10 @@ const pkgdef :Spk.PackageDefinition = ( appTitle = (defaultText = "Wekan"), # The name of the app as it is displayed to the user. - appVersion = 190, + appVersion = 191, # Increment this for every release. - appMarketingVersion = (defaultText = "1.88.0~2018-12-14"), + appMarketingVersion = (defaultText = "1.89.0~2018-12-15"), # Human-readable presentation of the app version. minUpgradableAppVersion = 0, -- cgit v1.2.3-1-g7c22