From de834b4bd7192e211e1ae8235fc0992c9105fd31 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 15 May 2023 19:23:31 +0300 Subject: [PATCH 1/2] Switch to LinkedIn news provider --- app/media/styles/modules/home.less | 16 +---------- app/modules/home/containers/recent-news.jsx | 32 ++++++++++++--------- app/modules/home/sagas.js | 2 +- app/workspace/aceinna/index.js | 2 +- 4 files changed, 21 insertions(+), 31 deletions(-) diff --git a/app/media/styles/modules/home.less b/app/media/styles/modules/home.less index c6ee887d..b0428a84 100644 --- a/app/media/styles/modules/home.less +++ b/app/media/styles/modules/home.less @@ -49,21 +49,7 @@ } .ant-card-meta-description { - h2 { - margin: 0; - padding: 0; - font-size: 13px; - color: fade(@heading-color, 75%); - } - - img { - height: @font-size-base; - display: inline; - } - - s { - text-decoration: none; - } + color: fade(@heading-color, 70%); } } diff --git a/app/modules/home/containers/recent-news.jsx b/app/modules/home/containers/recent-news.jsx index 38386fdf..367a4f3c 100644 --- a/app/modules/home/containers/recent-news.jsx +++ b/app/modules/home/containers/recent-news.jsx @@ -38,23 +38,22 @@ class RecentNews extends React.Component { constructor() { super(...arguments); - const twitterUrl = workspaceSettings.getUrl('twitter'); - this.props.loadLatestTweets(twitterUrl.substring(twitterUrl.lastIndexOf('/') + 1)); + const linkedInUrl = workspaceSettings.getUrl('linkedin'); + this.props.loadLatestTweets( + linkedInUrl.substring(linkedInUrl.lastIndexOf('/') + 1) + ); } onClickItem(e, item) { e.preventDefault(); - if (item.entries.urls.length) { - return this.props.osOpenUrl(item.entries.urls[0]); - } - return this.props.osOpenUrl(item.tweetUrl); + return this.props.osOpenUrl(item.permalink); } render() { return (
- this.props.osOpenUrl(workspaceSettings.getUrl('twitter'))}> + this.props.osOpenUrl(workspaceSettings.getUrl('linkedin'))}> Recent News @@ -101,8 +100,8 @@ class RecentNews extends React.Component { } const item = this.props.items[itemIndex]; let coverUrl = workspaceSettings.get('companyLogoSrc'); - if (item.entries.photos.length) { - coverUrl = item.entries.photos[0]; + if (item.content.thumbnail) { + coverUrl = item.content?.thumbnail?.url; } const title = ( ); const cover =
; @@ -123,7 +120,14 @@ class RecentNews extends React.Component { this.onClickItem(e, item)}> } + description={ + '), + }} + /> + } + style={{ color: 'red !important' }} /> ); diff --git a/app/modules/home/sagas.js b/app/modules/home/sagas.js index 0cae73f4..3f080e08 100644 --- a/app/modules/home/sagas.js +++ b/app/modules/home/sagas.js @@ -33,7 +33,7 @@ function* watchLoadLatestTweets() { try { items = yield call(backendFetchData, { query: 'misc.load_latest_tweets', - params: [`https://news.platformio.org/tweets/${username}/data.json`], + params: [`https://news.platformio.org/liupdates/${username}/data.json`], }); } catch (err) { items = err; diff --git a/app/workspace/aceinna/index.js b/app/workspace/aceinna/index.js index 23357f89..437400ad 100644 --- a/app/workspace/aceinna/index.js +++ b/app/workspace/aceinna/index.js @@ -17,7 +17,7 @@ const urls = { home: 'https://www.aceinna.com/', welcome: 'https://github.com/Aceinna/platform-aceinna_imu#description', - linkedin: 'https://www.linkedin.com/company/aceinna/', + linkedin: 'https://www.linkedin.com/company/aceinna', twitter: 'https://twitter.com/MEMSsensortech', github: 'https://github.com/aceinna', weibo: 'https://weibo.com/', From 55e28b4f7beaf27204d12646116320c4722afe6a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 15 May 2023 19:24:31 +0300 Subject: [PATCH 2/2] Bump version to 3.4.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e8969cf..307d5b49 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformio-home", - "version": "3.4.3", + "version": "3.4.4", "description": "PlatformIO Home", "repository": { "type": "git",