Add Cannot_Update_Require_Manual dialog type

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2022-04-06 11:39:33 -07:00 committed by GitHub
parent 2bdaa794d1
commit 8fbf57ef3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 1 deletions

View File

@ -1055,6 +1055,20 @@
}
}
},
"cannotUpdateRequireManualDetail": {
"message": "Signal couldn't update. Visit $url$ to install it manually. Then, $support$ about this problem",
"description": "Shown if a general error happened while trying to install update package and manual update is required",
"placeholders": {
"url": {
"content": "$2",
"example": "https://signal.org/download"
},
"support": {
"content": "$3",
"example": "contact support"
}
}
},
"readOnlyVolume": {
"message": "Signal Desktop is likely in a macOS quarantine, and will not be able to auto-update. Please try moving $app$ to $folder$ with Finder.",
"description": "Shown on MacOS if running on a read-only volume and we cannot update",

View File

@ -128,6 +128,26 @@ story.add('Knobs Playground', () => {
</FakeLeftPaneContainer>
));
story.add(`Cannot Update & Require Manual (${name} container)`, () => (
<FakeLeftPaneContainer containerWidthBreakpoint={containerWidthBreakpoint}>
<DialogUpdate
{...defaultPropsForBreakpoint}
dialogType={DialogType.Cannot_Update_Require_Manual}
currentVersion="5.24.0"
/>
</FakeLeftPaneContainer>
));
story.add(`Cannot Update & Require Manual Beta (${name} container)`, () => (
<FakeLeftPaneContainer containerWidthBreakpoint={containerWidthBreakpoint}>
<DialogUpdate
{...defaultPropsForBreakpoint}
dialogType={DialogType.Cannot_Update_Require_Manual}
currentVersion="5.24.0-beta.1"
/>
</FakeLeftPaneContainer>
));
story.add(`macOS RO Error (${name} container)`, () => (
<FakeLeftPaneContainer containerWidthBreakpoint={containerWidthBreakpoint}>
<DialogUpdate

View File

@ -108,6 +108,48 @@ export const DialogUpdate = ({
);
}
if (dialogType === DialogType.Cannot_Update_Require_Manual) {
const url = isBeta(currentVersion)
? BETA_DOWNLOAD_URL
: PRODUCTION_DOWNLOAD_URL;
return (
<LeftPaneDialog
containerWidthBreakpoint={containerWidthBreakpoint}
type="warning"
title={i18n('cannotUpdate')}
>
<span>
<Intl
components={{
url: (
<a
key="signal-download"
href={url}
rel="noreferrer"
target="_blank"
>
{url}
</a>
),
support: (
<a
key="signal-support"
href="https://support.signal.org/hc/en-us/requests/new?desktop"
rel="noreferrer"
target="_blank"
>
{i18n('autoUpdateContactSupport')}
</a>
),
}}
i18n={i18n}
id="cannotUpdateRequireManualDetail"
/>
</span>
</LeftPaneDialog>
);
}
if (dialogType === DialogType.MacOS_Read_Only) {
return (
<LeftPaneDialog

View File

@ -7,6 +7,7 @@ export enum DialogType {
None = 'None',
Update = 'Update',
Cannot_Update = 'Cannot_Update',
Cannot_Update_Require_Manual = 'Cannot_Update_Require_Manual',
MacOS_Read_Only = 'MacOS_Read_Only',
DownloadReady = 'DownloadReady',
FullDownloadReady = 'FullDownloadReady',

View File

@ -363,7 +363,8 @@ export abstract class Updater {
if (parsedYaml.requireManualUpdate) {
this.logger.warn('checkForUpdates: manual update required');
this.markCannotUpdate(
new Error('yaml file has requireManualUpdate flag')
new Error('yaml file has requireManualUpdate flag'),
DialogType.Cannot_Update_Require_Manual
);
return;
}