mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-06 11:18:19 +02:00
- Adds button in the preferences backup settings to restore from a backup file. - Adds a dialog component `restore-from-backup` which will open a filepicker to select a HTML backup file to restore from, show the backup's date and prompt to input a password if needed. - Adds a stub `getBackupInfo` event to eventually return metadata and config JSON from `sampleArchive` in Bug 1901132. Does not yet implement: - Expanding the input to fit multiline files names. - Restoring the selected backup file. Figma: https://www.figma.com/design/vNbX4c0ws0L1qr0mxpKvsW/Fx-Backup?node-id=147-8701&t=zvoykS3OusX9YVCv-4 Differential Revision: https://phabricator.services.mozilla.com/D211248
49 lines
1.6 KiB
JavaScript
49 lines
1.6 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
// eslint-disable-next-line import/no-unresolved
|
|
import { html } from "lit.all.mjs";
|
|
// eslint-disable-next-line import/no-unassigned-import
|
|
import "chrome://global/content/elements/moz-card.mjs";
|
|
// eslint-disable-next-line import/no-unassigned-import
|
|
import "./restore-from-backup.mjs";
|
|
|
|
window.MozXULElement.insertFTLIfNeeded("locales-preview/backupSettings.ftl");
|
|
window.MozXULElement.insertFTLIfNeeded("branding/brand.ftl");
|
|
|
|
export default {
|
|
title: "Domain-specific UI Widgets/Backup/Restore from Backup",
|
|
component: "restore-from-backup",
|
|
argTypes: {},
|
|
};
|
|
|
|
const Template = ({
|
|
backupFilePath,
|
|
backupFileToRestore,
|
|
backupFileInfo,
|
|
}) => html`
|
|
<moz-card style="width: fit-content;">
|
|
<restore-from-backup
|
|
.backupFilePath=${backupFilePath}
|
|
.backupFileToRestore=${backupFileToRestore}
|
|
.backupFileInfo=${backupFileInfo}
|
|
></restore-from-backup>
|
|
</moz-card>
|
|
`;
|
|
|
|
export const BackupFound = Template.bind({});
|
|
BackupFound.args = {
|
|
backupFilePath: "/Some/User/Documents",
|
|
backupFileToRestore: "/Some/User/Documents/Firefox Backup/backup.html",
|
|
backupFileInfo: { date: new Date(), isEncrypted: null },
|
|
};
|
|
|
|
export const EncryptedBackupFound = Template.bind({});
|
|
EncryptedBackupFound.args = {
|
|
backupFilePath: "/Some/User/Documents",
|
|
backupFileToRestore: "/Some/User/Documents/Firefox Backup/backup.html",
|
|
backupFileInfo: { date: new Date(), isEncrypted: true },
|
|
};
|
|
|
|
export const NoBackupFound = Template.bind({});
|