mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 11:56:36 +00:00
feat: add shared space support (#2486)
This commit is contained in:
parent
2e78e96b75
commit
c3adde5460
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -275,6 +275,8 @@ jobs:
|
|||||||
- build-type-determination
|
- build-type-determination
|
||||||
- select-targets
|
- select-targets
|
||||||
env:
|
env:
|
||||||
|
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
||||||
|
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||||
# Location of artifacts generated by build.
|
# Location of artifacts generated by build.
|
||||||
BUILD_ARTIFACTS_PATH: electron-app/dist/build-artifacts
|
BUILD_ARTIFACTS_PATH: electron-app/dist/build-artifacts
|
||||||
# to skip passing signing credentials to electron-builder
|
# to skip passing signing credentials to electron-builder
|
||||||
|
@ -228,6 +228,14 @@ const properties: ArduinoPreferenceSchemaProperties = {
|
|||||||
),
|
),
|
||||||
default: 'https://api2.arduino.cc/create',
|
default: 'https://api2.arduino.cc/create',
|
||||||
},
|
},
|
||||||
|
'arduino.cloud.sharedSpaceID': {
|
||||||
|
type: 'string',
|
||||||
|
description: nls.localize(
|
||||||
|
'arduino/preferences/cloud.sharedSpaceId',
|
||||||
|
'The ID of the Arduino Cloud shared space to load the sketchbook from. If empty, your private space is selected.'
|
||||||
|
),
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
'arduino.auth.clientID': {
|
'arduino.auth.clientID': {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: nls.localize(
|
description: nls.localize(
|
||||||
@ -329,6 +337,7 @@ export interface ArduinoConfiguration {
|
|||||||
'arduino.cloud.push.warn': boolean;
|
'arduino.cloud.push.warn': boolean;
|
||||||
'arduino.cloud.pushpublic.warn': boolean;
|
'arduino.cloud.pushpublic.warn': boolean;
|
||||||
'arduino.cloud.sketchSyncEndpoint': string;
|
'arduino.cloud.sketchSyncEndpoint': string;
|
||||||
|
'arduino.cloud.sharedSpaceID': string;
|
||||||
'arduino.auth.clientID': string;
|
'arduino.auth.clientID': string;
|
||||||
'arduino.auth.domain': string;
|
'arduino.auth.domain': string;
|
||||||
'arduino.auth.audience': string;
|
'arduino.auth.audience': string;
|
||||||
|
@ -509,11 +509,19 @@ export class CreateApi {
|
|||||||
|
|
||||||
private async headers(): Promise<Record<string, string>> {
|
private async headers(): Promise<Record<string, string>> {
|
||||||
const token = await this.token();
|
const token = await this.token();
|
||||||
return {
|
const headers: Record<string, string> = {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
accept: 'application/json',
|
accept: 'application/json',
|
||||||
authorization: `Bearer ${token}`,
|
authorization: `Bearer ${token}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sharedSpaceID =
|
||||||
|
this.arduinoPreferences['arduino.cloud.sharedSpaceID'];
|
||||||
|
if (sharedSpaceID) {
|
||||||
|
headers['x-organization'] = sharedSpaceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
private domain(apiVersion = 'v2'): string {
|
private domain(apiVersion = 'v2'): string {
|
||||||
|
@ -127,6 +127,9 @@ export class SketchbookTreeModel extends FileTreeModel {
|
|||||||
if (preferenceName === 'arduino.sketchbook.showAllFiles') {
|
if (preferenceName === 'arduino.sketchbook.showAllFiles') {
|
||||||
this.updateRoot();
|
this.updateRoot();
|
||||||
}
|
}
|
||||||
|
if (preferenceName === 'arduino.cloud.sharedSpaceID') {
|
||||||
|
this.updateRoot();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -113,13 +113,13 @@ describe('boards-service-impl', () => {
|
|||||||
expect(result.length).greaterThan(1);
|
expect(result.length).greaterThan(1);
|
||||||
const lastIndex = result.length - 1;
|
const lastIndex = result.length - 1;
|
||||||
const last = result[lastIndex];
|
const last = result[lastIndex];
|
||||||
expect(last.id).to.be.equal('arduino:mbed');
|
expect(last.id).to.be.equal('Microsoft:win10');
|
||||||
expect(last.deprecated).to.be.true;
|
expect(last.deprecated).to.be.true;
|
||||||
const windowsIoTCoreIndex = result.findIndex(
|
const arduinoMbedCoreIndex = result.findIndex(
|
||||||
(platform) => platform.id === 'Microsoft:win10'
|
(platform) => platform.id === 'arduino:mbed'
|
||||||
);
|
);
|
||||||
expect(windowsIoTCoreIndex).to.be.greaterThanOrEqual(0);
|
expect(arduinoMbedCoreIndex).to.be.greaterThanOrEqual(0);
|
||||||
expect(windowsIoTCoreIndex).to.be.lessThan(lastIndex);
|
expect(arduinoMbedCoreIndex).to.be.lessThan(lastIndex);
|
||||||
const first = result[0];
|
const first = result[0];
|
||||||
expect(typeof first.deprecated).to.be.equal('boolean');
|
expect(typeof first.deprecated).to.be.equal('boolean');
|
||||||
expect(first.deprecated).to.be.false;
|
expect(first.deprecated).to.be.false;
|
||||||
|
@ -368,6 +368,7 @@
|
|||||||
"cloud.pull.warn": "True if users should be warned before pulling a cloud sketch. Defaults to true.",
|
"cloud.pull.warn": "True if users should be warned before pulling a cloud sketch. Defaults to true.",
|
||||||
"cloud.push.warn": "True if users should be warned before pushing a cloud sketch. Defaults to true.",
|
"cloud.push.warn": "True if users should be warned before pushing a cloud sketch. Defaults to true.",
|
||||||
"cloud.pushpublic.warn": "True if users should be warned before pushing a public sketch to the cloud. Defaults to true.",
|
"cloud.pushpublic.warn": "True if users should be warned before pushing a public sketch to the cloud. Defaults to true.",
|
||||||
|
"cloud.sharedSpaceId": "The ID of the Arduino Cloud shared space to load the sketchbook from. If empty, your private space is selected.",
|
||||||
"cloud.sketchSyncEndpoint": "The endpoint used to push and pull sketches from a backend. By default it points to Arduino Cloud API.",
|
"cloud.sketchSyncEndpoint": "The endpoint used to push and pull sketches from a backend. By default it points to Arduino Cloud API.",
|
||||||
"compile": "compile",
|
"compile": "compile",
|
||||||
"compile.experimental": "True if the IDE should handle multiple compiler errors. False by default",
|
"compile.experimental": "True if the IDE should handle multiple compiler errors. False by default",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user