anastasis-webui: some text changes

This commit is contained in:
Florian Dold 2021-11-08 20:19:56 +01:00
parent 8481aadfd9
commit e369f26ec5
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
3 changed files with 29 additions and 24 deletions

View File

@ -50,6 +50,11 @@ export interface SuccessDetails {
export interface CoreSecret { export interface CoreSecret {
mime: string; mime: string;
value: string; value: string;
/**
* Filename, only set if the secret comes from
* a file. Should be set unless the mime type is "text/plain";
*/
filename?: string;
} }
export interface ReducerStateBackup { export interface ReducerStateBackup {

View File

@ -86,7 +86,7 @@ export function AuthenticationEditorScreen(): VNode {
active active
onCancel={cancel} onCancel={cancel}
description="No providers founds" description="No providers founds"
label="Add a provider manually" label="Add a provider manually (not implemented!)"
onConfirm={() => { onConfirm={() => {
null; null;
}} }}
@ -179,7 +179,7 @@ export function AuthenticationEditorScreen(): VNode {
active={!noProvidersAck} active={!noProvidersAck}
onCancel={() => setNoProvidersAck(true)} onCancel={() => setNoProvidersAck(true)}
description="No providers founds" description="No providers founds"
label="Add a provider manually" label="Add a provider manually (not implemented!)"
onConfirm={() => { onConfirm={() => {
null; null;
}} }}
@ -197,15 +197,15 @@ export function AuthenticationEditorScreen(): VNode {
</div> </div>
<div class="column"> <div class="column">
<p class="block"> <p class="block">
When recovering your wallet, you will be asked to verify your When recovering your secret data, you will be asked to verify your
identity via the methods you configure here. The list of identity via the methods you configure here. The list of
authentication method is defined by the backup provider list. authentication method is defined by the backup provider list.
</p> </p>
<p class="block"> {/* <p class="block">
<button class="button is-info"> <button class="button is-info">
Manage the backup provider's list Manage backup providers
</button> </button>
</p> </p> */}
{authAvailableSet.size > 0 && ( {authAvailableSet.size > 0 && (
<p class="block"> <p class="block">
We couldn't find provider for some of the authentication methods. We couldn't find provider for some of the authentication methods.

View File

@ -3,27 +3,29 @@ import { encodeCrock, stringToBytes } from "@gnu-taler/taler-util";
import { h, VNode } from "preact"; import { h, VNode } from "preact";
import { useState } from "preact/hooks"; import { useState } from "preact/hooks";
import { useAnastasisContext } from "../../context/anastasis"; import { useAnastasisContext } from "../../context/anastasis";
import { import { AnastasisClientFrame } from "./index";
AnastasisClientFrame
} from "./index";
import { TextInput } from "../../components/fields/TextInput"; import { TextInput } from "../../components/fields/TextInput";
import { FileInput } from "../../components/fields/FileInput"; import { FileInput } from "../../components/fields/FileInput";
export function SecretEditorScreen(): VNode { export function SecretEditorScreen(): VNode {
const reducer = useAnastasisContext() const reducer = useAnastasisContext();
const [secretValue, setSecretValue] = useState(""); const [secretValue, setSecretValue] = useState("");
const currentSecretName = reducer?.currentReducerState const currentSecretName =
&& ("secret_name" in reducer.currentReducerState) reducer?.currentReducerState &&
&& reducer.currentReducerState.secret_name; "secret_name" in reducer.currentReducerState &&
reducer.currentReducerState.secret_name;
const [secretName, setSecretName] = useState(currentSecretName || ""); const [secretName, setSecretName] = useState(currentSecretName || "");
if (!reducer) { if (!reducer) {
return <div>no reducer in context</div> return <div>no reducer in context</div>;
} }
if (!reducer.currentReducerState || reducer.currentReducerState.backup_state === undefined) { if (
return <div>invalid state</div> !reducer.currentReducerState ||
reducer.currentReducerState.backup_state === undefined
) {
return <div>invalid state</div>;
} }
const secretNext = async (): Promise<void> => { const secretNext = async (): Promise<void> => {
@ -50,7 +52,8 @@ export function SecretEditorScreen(): VNode {
> >
<div> <div>
<TextInput <TextInput
label="Secret's name:" label="Secret name:"
tooltip="The secret name allows you to identify your secret when restoring it. It is a label that you can choose freely."
grabFocus grabFocus
bind={[secretName, setSecretName]} bind={[secretName, setSecretName]}
/> />
@ -60,14 +63,11 @@ export function SecretEditorScreen(): VNode {
label="Enter the secret as text:" label="Enter the secret as text:"
bind={[secretValue, setSecretValue]} bind={[secretValue, setSecretValue]}
/> />
<div style={{display:'flex',}}> {/* <div style={{ display: "flex" }}>
or&nbsp; or&nbsp;
<FileInput <FileInput label="click here" bind={[secretValue, setSecretValue]} />
label="click here"
bind={[secretValue, setSecretValue]}
/>
&nbsp;to import a file &nbsp;to import a file
</div> </div> */}
</div> </div>
</AnastasisClientFrame> </AnastasisClientFrame>
); );