feat: add "Email Backups" to "Backups" section (#778)

* feat: add "Email Backups" to "Backups" section

* chore: remove comment

* chore: better wording

* chore: put working snjs version

* chore: better wording

* style: reuse existing css classes and add the missing one

* feat: add "No email backup" option

* refactor: move the function outside of the useEffect, remove unused utility function

* feat (WIP): move CloudLink to backups section

* chore: versions bump, type fixes

* fix: handle the case when the setting update fails

* style: remove dashed border from the confirmation code, UI improvements

* feat: implement removing integration, improve interaction on different events

* feat: implement non-interactive textarea for showing and copying the code

* fix: fix TS errors

* feat: implement "Perform backup" logic
- remove the code for copying the confirmation code for backup integration
- also remove unnecessary parameters passed to Provider

* feat: don't show "CloudLink" in preferences pane

* chore: show error in console on exception

* refactor: better naming, add `coverage` folder to gitignore

* fix: return correct setting name

* refactor: use async/await for the sake of consistency

* chore: remove duplicate line

* feat: get urls for cloud backup from snjs

* chore: update dependencies

* refactor: set both `token` and `frequency` settings when enabling cloud integration; get only `frequency` when checking the integration status

* refactor: once the setting is successfully saved, don't get its value from backend; instead, use its value that's still in frontend

* feat: move "Receive a notification email if a cloud backup fails." into cloud backups section

* fix: text correction

* fix: get correct cloud integration url from snjs based on prod/dev environment
This commit is contained in:
Vardan Hakobyan
2022-01-12 18:48:46 +04:00
committed by GitHub
parent 7996f4e5a2
commit a342a3a224
18 changed files with 789 additions and 101 deletions

View File

@@ -9,7 +9,7 @@ import {
import VisuallyHidden from '@reach/visually-hidden';
import { FunctionComponent } from 'preact';
import { IconType, Icon } from './Icon';
import { useState } from 'preact/hooks';
import { useEffect, useState } from 'preact/hooks';
export type DropdownItem = {
icon?: IconType;
@@ -64,6 +64,10 @@ export const Dropdown: FunctionComponent<DropdownProps> = ({
}) => {
const [value, setValue] = useState(defaultValue);
useEffect(() => {
setValue(defaultValue);
}, [defaultValue]);
const labelId = `${id}-label`;
const handleChange = (value: string) => {