Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"cross-fetch": "^3.1.5",
"dateformat": "^3.0.3",
"deepmerge": "^4.2.2",
"dompurify": "^2.4.7",
"drivelist": "^9.2.4",
"electron-updater": "^4.6.5",
"fast-deep-equal": "^3.1.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,6 @@ import { DebugConfigurationWidget } from './theia/debug/debug-configuration-widg
import { DebugConfigurationWidget as TheiaDebugConfigurationWidget } from '@theia/debug/lib/browser/view/debug-configuration-widget';
import { DebugToolBar } from '@theia/debug/lib/browser/view/debug-toolbar-widget';

import {
VersionWelcomeDialog,
VersionWelcomeDialogProps,
} from './dialogs/version-welcome-dialog';
import { TestViewContribution as TheiaTestViewContribution } from '@theia/test/lib/browser/view/test-view-contribution';
import { TestViewContribution } from './theia/test/test-view-contribution';

Expand Down Expand Up @@ -987,11 +983,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
title: 'IDEUpdater',
});

bind(VersionWelcomeDialog).toSelf().inSingletonScope();
bind(VersionWelcomeDialogProps).toConstantValue({
title: 'VersionWelcomeDialog',
});

bind(UserFieldsDialog).toSelf().inSingletonScope();
bind(UserFieldsDialogProps).toConstantValue({
title: 'UserFields',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from '../../common/protocol/ide-updater';
import { IDEUpdaterDialog } from '../dialogs/ide-updater/ide-updater-dialog';
import { Contribution } from './contribution';
import { VersionWelcomeDialog } from '../dialogs/version-welcome-dialog';
import { AppService } from '../app-service';
import { SemVer } from 'semver';

Expand All @@ -20,9 +19,6 @@ export class CheckForIDEUpdates extends Contribution {
@inject(IDEUpdaterDialog)
private readonly updaterDialog: IDEUpdaterDialog;

@inject(VersionWelcomeDialog)
private readonly versionWelcomeDialog: VersionWelcomeDialog;

@inject(LocalStorageService)
private readonly localStorage: LocalStorageService;

Expand Down Expand Up @@ -59,13 +55,8 @@ export class CheckForIDEUpdates extends Contribution {
return this.updater.checkForUpdates(true);
})
.then(async (updateInfo) => {
if (!updateInfo) {
const isNewVersion = await this.isNewStableVersion();
if (isNewVersion) {
this.versionWelcomeDialog.open();
}
return;
}
if (!updateInfo) return;

const versionToSkip = await this.localStorage.getData<string>(
SKIP_IDE_VERSION
);
Expand All @@ -86,6 +77,11 @@ export class CheckForIDEUpdates extends Contribution {
});
}

/**
* This value is set in localStorage but currently not used.
* We keep this logic running anyway for eventual future needs
* (eg. show a new version welcome dialog)
*/
private async setCurrentIDEVersion(): Promise<void> {
try {
const { appVersion } = await this.appService.info();
Expand All @@ -95,29 +91,4 @@ export class CheckForIDEUpdates extends Contribution {
// ignore invalid versions
}
}

/**
* Check if user is running a new IDE version for the first time.
* @returns true if the current IDE version is greater than the last used version
* and both are non-prerelease versions.
*/
private async isNewStableVersion(): Promise<boolean> {
try {
const { appVersion } = await this.appService.info();
const prevVersion = await this.localStorage.getData<string>(
LAST_USED_IDE_VERSION
);

const prevSemVer = new SemVer(prevVersion ?? '');
const currSemVer = new SemVer(appVersion ?? '');

if (prevSemVer.prerelease.length || currSemVer.prerelease.length) {
return false;
}

return currSemVer.compare(prevSemVer) === 1;
} catch (e) {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
} from '../../../common/protocol/ide-updater';
import { LocalStorageService } from '@theia/core/lib/browser';
import { WindowService } from '@theia/core/lib/browser/window/window-service';
import { sanitize } from 'dompurify';

@injectable()
export class IDEUpdaterDialogProps extends DialogProps {}
Expand Down Expand Up @@ -166,51 +165,6 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
goToDownloadPageButton.focus();
}

private appendDonateFooter() {
const footer = document.createElement('div');
footer.classList.add('ide-updater-dialog--footer');
const footerContent = document.createElement('div');
footerContent.classList.add('ide-updater-dialog--footer-content');
footer.appendChild(footerContent);

const footerLink = document.createElement('a');
footerLink.innerText = sanitize(
nls.localize('arduino/ide-updater/donateLinkText', 'donate to support us')
);
footerLink.classList.add('ide-updater-dialog--footer-link');
footerLink.onclick = () =>
this.openExternal('https://www.arduino.cc/en/donate');

const footerLinkIcon = document.createElement('span');
footerLinkIcon.title = nls.localize(
'arduino/ide-updater/donateLinkIconTitle',
'open donation page'
);
footerLinkIcon.classList.add('ide-updater-dialog--footer-link-icon');
footerLink.appendChild(footerLinkIcon);

const placeholderKey = '%%link%%';
const footerText = sanitize(
nls.localize(
'arduino/ide-updater/donateText',
'Open source is love, {0}',
placeholderKey
)
);
const placeholder = footerText.indexOf(placeholderKey);
if (placeholder !== -1) {
const parts = footerText.split(placeholderKey);
footerContent.appendChild(document.createTextNode(parts[0]));
footerContent.appendChild(footerLink);
footerContent.appendChild(document.createTextNode(parts[1]));
} else {
footerContent.appendChild(document.createTextNode(footerText));
footerContent.appendChild(footerLink);
}

this.controlPanel.insertAdjacentElement('afterend', footer);
}

private openDownloadPage(): void {
this.openExternal('https://www.arduino.cc/en/software');
this.close();
Expand All @@ -233,7 +187,6 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
downloadStarted: true,
});
this.clearButtons();
this.appendDonateFooter();
this.updater.downloadUpdate();
}

Expand Down
107 changes: 0 additions & 107 deletions arduino-ide-extension/src/browser/dialogs/version-welcome-dialog.tsx

This file was deleted.

32 changes: 0 additions & 32 deletions arduino-ide-extension/src/browser/style/ide-updater-dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,6 @@
min-width: 0;
}

.ide-updater-dialog--footer {
display: inline-block;
margin-top: -16px;
padding: 12px 0 24px 0;
border-top: 1px solid var(--theia-editorWidget-border);
}
.ide-updater-dialog--footer-content {
float: right;
}

.ide-updater-dialog--footer-link {
display: inline-block;
color: var(--theia-textLink-foreground);
font-weight: 500;
line-height: 13px;
}
.ide-updater-dialog--footer-link:hover {
color: var(--theia-textLink-foreground);
cursor: pointer;
}
.ide-updater-dialog--footer-link-icon {
display: inline-block;
-webkit-mask: url(../icons/link-open-icon.svg) center no-repeat;
background-color: var(--theia-textLink-foreground);
height: 12px;
width: 12px;
cursor: pointer;
transform: translateY(2px);
margin-left: 4px;
}

.ide-updater-dialog .changelog {
color: var(--theia-editor-foreground);
background-color: var(--theia-editor-background);
Expand Down Expand Up @@ -140,7 +109,6 @@
max-height: 100%;
overflow: hidden;
display: flex;
padding-bottom: 20px !important;
}

#ide-updater-dialog-container .skip-version-button {
Expand Down
1 change: 0 additions & 1 deletion arduino-ide-extension/src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
@import "./settings-dialog.css";
@import "./firmware-uploader-dialog.css";
@import "./ide-updater-dialog.css";
@import "./version-welcome-dialog.css";
@import "./certificate-uploader-dialog.css";
@import "./user-fields-dialog.css";
@import "./debug.css";
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,6 @@
"checkForUpdates": "Check for Arduino IDE Updates",
"closeAndInstallButton": "Close and Install",
"closeToInstallNotice": "Close the software and install the update on your machine.",
"donateLinkIconTitle": "open donation page",
"donateLinkText": "donate to support us",
"donateText": "Open source is love, {0}",
"downloadButton": "Download",
"downloadingNotice": "Downloading the latest version of the Arduino IDE.",
"errorCheckingForUpdates": "Error while checking for Arduino IDE updates.\n{0}",
Expand Down Expand Up @@ -523,14 +520,6 @@
"renameSketchFolderMessage": "The sketch '{0}' cannot be used. {1} To get rid of this message, rename the sketch. Do you want to rename the sketch now?",
"renameSketchFolderTitle": "Invalid sketch name"
},
"versionWelcome": {
"cancelButton": "Maybe later",
"donateButton": "Donate now",
"donateMessage": "Arduino is committed to keeping software free and open-source for everyone. Your donation helps us develop new features, improve libraries, and support millions of users worldwide.",
"donateMessage2": "Please consider supporting our work on the free open source Arduino IDE.",
"title": "Welcome to a new version of the Arduino IDE!",
"titleWithVersion": "Welcome to the new Arduino IDE {0}!"
},
"workspace": {
"alreadyExists": "'{0}' already exists."
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5912,7 +5912,7 @@ domexception@^4.0.0:
dependencies:
webidl-conversions "^7.0.0"

dompurify@^2.2.9, dompurify@^2.4.7:
dompurify@^2.2.9:
version "2.5.8"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.5.8.tgz#2809d89d7e528dc7a071dea440d7376df676f824"
integrity sha512-o1vSNgrmYMQObbSSvF/1brBYEQPHhV1+gsmrusO7/GXtp1T9rCS8cXFqVxK/9crT1jA6Ccv+5MTSjBNqr7Sovw==
Expand Down
Loading