-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature multiple sources #256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good solution for multi sources!
@@ -46,7 +46,9 @@ const AvailableAppItem = ({ | |||
isDisabled, | |||
}) => ( | |||
<div className="core-app-management-item list-group-item"> | |||
<h4 className="list-group-item-heading">{app.displayName || app.name}</h4> | |||
<h4 className="list-group-item-heading">{app.displayName || app.name} | |||
<span className="list-group-item-heading-sourcetag">{app.source}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe s/sourcetag/source-tag ?
<table className="core-settings-sources"><tbody> | ||
{ | ||
Object.keys(sourcesJS) | ||
.filter(name => name !== 'official') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation is automatic, can't force it other way.
import * as SettingsActions from '../actions/settingsActions'; | ||
|
||
const InitialState = Record({ | ||
shouldCheckForUpdatesAtStartup: true, | ||
isUpdateCheckCompleteDialogVisible: false, | ||
isLoading: false, | ||
sources: Map({}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question, why use Map for sources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because a simple key, value container is needed there and this one works.
main/apps.js
Outdated
.catch(error => { | ||
throw new Error(`Unable to download apps list: ${error.message}. If you ` + | ||
'are using a proxy server, you may need to configure it as described on ' + | ||
'https://github.com/NordicSemiconductor/pc-nrfconnect-core'); | ||
}) | ||
.then(appsJson => { | ||
const source = appsJson._source; // eslint-disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to remove '_'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The underscore comes from Json which is intentional as a meta tag, I'll comment about it.
main/settings.js
Outdated
if (sourcesData !== null) { | ||
return; | ||
} | ||
let sources = parseJSONFile(config.getSourcesJsonPath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about s/parseJSONFile/parseJsonFile since all the other places are written as 'Json'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds a new section to the the SettingsView where users can add multiple apps.json URLs for external app sources. nRFConnect creates a new directory
.nrfconnect-apps/external
which will be the root of storing these apps.There's an extra requirement for any additional apps.json, to specify
_source
string member as the source name which will create a new directory underexternal
.New command line argument
source
has been introduced to be able to specify the source which works together withopen-official-app
. This change is also added to desktop shortcuts.Jest tests and snapshots are updated.