Skip to content

Commit

Permalink
Merge branch 'release/v3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Nov 13, 2019
2 parents 86a193a + 0470c65 commit 6072f52
Show file tree
Hide file tree
Showing 61 changed files with 390 additions and 378 deletions.
9 changes: 3 additions & 6 deletions app/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ class AppFooter extends React.Component {
}
}

export default connect(
null,
{
osOpenUrl
}
)(AppFooter);
export default connect(null, {
osOpenUrl
})(AppFooter);
5 changes: 1 addition & 4 deletions app/modules/account/containers/forgot-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,4 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
{ ...actions, osOpenUrl }
)(AccountForgotPage);
export default connect(mapStateToProps, { ...actions, osOpenUrl })(AccountForgotPage);
7 changes: 3 additions & 4 deletions app/modules/account/containers/information-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
{ ...actions, osOpenUrl }
)(AccountInformationPage);
export default connect(mapStateToProps, { ...actions, osOpenUrl })(
AccountInformationPage
);
5 changes: 1 addition & 4 deletions app/modules/account/containers/login-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,4 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
{ ...actions, osOpenUrl }
)(AccountLoginPage);
export default connect(mapStateToProps, { ...actions, osOpenUrl })(AccountLoginPage);
5 changes: 1 addition & 4 deletions app/modules/account/containers/password-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,4 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
actions
)(AccountPasswordPage);
export default connect(mapStateToProps, actions)(AccountPasswordPage);
7 changes: 3 additions & 4 deletions app/modules/account/containers/registration-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
{ ...actions, osOpenUrl }
)(AccountRegistrationPage);
export default connect(mapStateToProps, { ...actions, osOpenUrl })(
AccountRegistrationPage
);
5 changes: 1 addition & 4 deletions app/modules/account/containers/token-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,4 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
{ ...actions, osOpenUrl }
)(AccountTokenPage);
export default connect(mapStateToProps, { ...actions, osOpenUrl })(AccountTokenPage);
5 changes: 1 addition & 4 deletions app/modules/core/containers/code-beautifier.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,4 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
{ requestContent }
)(CodeBeautifier);
export default connect(mapStateToProps, { requestContent })(CodeBeautifier);
5 changes: 1 addition & 4 deletions app/modules/core/containers/file-explorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,4 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
actions
)(FileExplorer);
export default connect(mapStateToProps, actions)(FileExplorer);
9 changes: 3 additions & 6 deletions app/modules/core/containers/open-in-browser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class OpenInBrowser extends React.Component {

// Redux

export default connect(
null,
{
osOpenUrl
}
)(OpenInBrowser);
export default connect(null, {
osOpenUrl
})(OpenInBrowser);
5 changes: 1 addition & 4 deletions app/modules/core/containers/repo-changelog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,4 @@ function mapStateToProps(state, ownProps) {
};
}

export default connect(
mapStateToProps,
{ requestContent }
)(RepositoryChangelog);
export default connect(mapStateToProps, { requestContent })(RepositoryChangelog);
5 changes: 1 addition & 4 deletions app/modules/core/containers/routed-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,4 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
{ connectRouter }
)(RoutedMenu);
export default connect(mapStateToProps, { connectRouter })(RoutedMenu);
9 changes: 3 additions & 6 deletions app/modules/core/containers/social-buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ class SocialButtons extends React.Component {

// Redux

export default connect(
null,
{
osOpenUrl
}
)(SocialButtons);
export default connect(null, {
osOpenUrl
})(SocialButtons);
11 changes: 4 additions & 7 deletions app/modules/device/containers/logical-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
{
loadLogicalDevices,
osOpenUrl
}
)(DeviceLogicalPage);
export default connect(mapStateToProps, {
loadLogicalDevices,
osOpenUrl
})(DeviceLogicalPage);
11 changes: 4 additions & 7 deletions app/modules/device/containers/mdns-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
{
...actions,
osOpenUrl
}
)(DeviceMDNSPage);
export default connect(mapStateToProps, {
...actions,
osOpenUrl
})(DeviceMDNSPage);
11 changes: 4 additions & 7 deletions app/modules/device/containers/serial-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
{
...actions,
osOpenUrl
}
)(DeviceSerialPage);
export default connect(mapStateToProps, {
...actions,
osOpenUrl
})(DeviceSerialPage);
11 changes: 4 additions & 7 deletions app/modules/home/containers/home-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,7 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
{
osOpenUrl,
showAtStartup
}
)(HomePage);
export default connect(mapStateToProps, {
osOpenUrl,
showAtStartup
})(HomePage);
5 changes: 1 addition & 4 deletions app/modules/home/containers/pio-versions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,4 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
{ osOpenUrl }
)(PioVersions);
export default connect(mapStateToProps, { osOpenUrl })(PioVersions);
11 changes: 4 additions & 7 deletions app/modules/home/containers/recent-news.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ function mapStateToProps(state) {
};
}

export default connect(
mapStateToProps,
{
loadLatestTweets,
osOpenUrl
}
)(RecentNews);
export default connect(mapStateToProps, {
loadLatestTweets,
osOpenUrl
})(RecentNews);
26 changes: 23 additions & 3 deletions app/modules/home/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,29 @@ function* watchLoadLatestTweets() {
query: 'misc.load_latest_tweets',
params: [`https://dl.platformio.org/tweets/${username}/data.json`]
});
} catch (err) {
items = err;
console.error(err);
} catch (err1) {
console.error(err1);
// FIXME: Remove this code after PIO Core 4.1.1 release (begin)
try {
const cacheValid = '1d';
items = JSON.parse(
yield call(apiFetchData, {
query: 'os.request_content',
params: [
`https://dl.platformio.org/tweets/${username}/data.json`,
undefined,
undefined,
cacheValid
]
})
);
// fallvback to backend cache
items = items.result ? items.result : items;
} catch (err2) {
console.error(err2);
items = err2;
}
// FIXME: Remove this code after PIO Core 4.1.1 release (end)
}
yield put(updateEntity('latestTweets', items));
});
Expand Down
11 changes: 4 additions & 7 deletions app/modules/inspect/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@
* limitations under the License.
*/

// Prefix for names of entities
export const PREFIX = 'inspect';

// Entity name to save list of environments
export const CONFIG_KEY = PREFIX + 'Configuration';

export const RESULT_KEY = PREFIX + 'Sizedata';
export const STORAGE_KEY = 'inspect';
export const CONFIG_KEY = 'configuration';
export const METRICS_KEY = 'metrics';

export const METRICS_KEY = PREFIX + 'Metrics';
export const RESULT_KEY = 'inspectSizedata';

export const SYMBOL_ICON_BY_TYPE = Object.freeze({
STT_FUNC: 'profile',
Expand Down
5 changes: 1 addition & 4 deletions app/modules/inspect/containers/code.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,4 @@ const dispatchToProps = {
openTextDocument
};

export default connect(
mapStateToProps,
dispatchToProps
)(CodePage);
export default connect(mapStateToProps, dispatchToProps)(CodePage);
12 changes: 11 additions & 1 deletion app/modules/inspect/containers/configuration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class InspectionFormComponent extends React.Component {
memory: true,
code: true
};
this.props.loadProjects();
this.props.loadProjects(true);
// Storage with saved configuration loads asynchronously, so data can come later
this.props.form.setFieldsValue(this.props.savedConfiguration || defaults);
}
Expand All @@ -69,6 +69,16 @@ class InspectionFormComponent extends React.Component {
) {
this.props.form.setFieldsValue(this.props.savedConfiguration);
}
if (this.props.projects && prevProps.projects !== this.props.projects) {
// ensure selected project still exists
const selectedProject = this.props.form.getFieldValue('projectDir');
if (
selectedProject &&
!this.props.projects.find(p => p.path === selectedProject)
) {
this.props.form.setFieldsValue({ projectDir: undefined });
}
}
}

componentWillUnmount() {
Expand Down
5 changes: 1 addition & 4 deletions app/modules/inspect/containers/mem-explorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,4 @@ const dispatchToProps = {
openTextDocument
};

export default connect(
mapStateToProps,
dispatchToProps
)(FileExplorerPage);
export default connect(mapStateToProps, dispatchToProps)(FileExplorerPage);
5 changes: 1 addition & 4 deletions app/modules/inspect/containers/mem-symbols.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,4 @@ const dispatchToProps = {
openTextDocument
};

export default connect(
mapStateToProps,
dispatchToProps
)(SymbolsPage);
export default connect(mapStateToProps, dispatchToProps)(SymbolsPage);
Loading

0 comments on commit 6072f52

Please sign in to comment.