fix #7075
This commit is contained in:
parent
d6beefe6e0
commit
50b9f2167c
@ -4,7 +4,7 @@
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "preact build --no-sw --no-esm",
|
||||
"build": "preact build --no-sw --no-esm --no-inline-css",
|
||||
"serve": "sirv build --port ${PORT:=8080} --cors --single",
|
||||
"dev": "preact watch --port ${PORT:=8080} --no-sw --no-esm",
|
||||
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
|
||||
@ -71,4 +71,4 @@
|
||||
"<rootDir>/tests/__mocks__/setupTests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
45
packages/anastasis-webui/preact.config.js
Normal file
45
packages/anastasis-webui/preact.config.js
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
This file is part of GNU Taler
|
||||
(C) 2021 Taler Systems S.A.
|
||||
|
||||
GNU Taler is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 3, or (at your option) any later version.
|
||||
|
||||
GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Javier Marchano (sebasjm)
|
||||
*/
|
||||
|
||||
import { DefinePlugin } from 'webpack';
|
||||
|
||||
import pack from './package.json';
|
||||
import * as cp from 'child_process';
|
||||
|
||||
const commitHash = cp.execSync('git rev-parse --short HEAD').toString();
|
||||
|
||||
export default {
|
||||
webpack(config, env, helpers) {
|
||||
// add __VERSION__ to be use in the html
|
||||
config.plugins.push(
|
||||
new DefinePlugin({
|
||||
'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : `dev-${commitHash}`),
|
||||
}),
|
||||
);
|
||||
const crittersWrapper = helpers.getPluginsByName(config, 'Critters')
|
||||
if (crittersWrapper && crittersWrapper.length > 0) {
|
||||
const [{ index }] = crittersWrapper
|
||||
config.plugins.splice(index, 1)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ export function SecretEditorScreen(): VNode {
|
||||
const [secretFile, _setSecretFile] = useState<FileTypeContent | undefined>(
|
||||
undefined,
|
||||
);
|
||||
function setSecretFile(v) {
|
||||
function setSecretFile(v: FileTypeContent | undefined): void {
|
||||
setSecretValue(""); // reset secret value when uploading a file
|
||||
_setSecretFile(v);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export const WithoutFeedback = createExample(
|
||||
challenges: [
|
||||
{
|
||||
cost: "USD:1",
|
||||
instructions: "does P equals NP?",
|
||||
instructions: "Email to me@domain.com",
|
||||
type: "question",
|
||||
uuid: "uuid-1",
|
||||
},
|
||||
@ -67,7 +67,7 @@ export const PaymentFeedback = createExample(
|
||||
challenges: [
|
||||
{
|
||||
cost: "USD:1",
|
||||
instructions: "does P equals NP?",
|
||||
instructions: "Email to me@domain.com",
|
||||
type: "question",
|
||||
uuid: "uuid-1",
|
||||
},
|
||||
|
@ -9,7 +9,7 @@ import { SolveOverviewFeedbackDisplay } from "../SolveScreen";
|
||||
import { AuthMethodSolveProps } from "./index";
|
||||
|
||||
export function AuthMethodEmailSolve({ id }: AuthMethodSolveProps): VNode {
|
||||
const [answer, setAnswer] = useState("");
|
||||
const [answer, setAnswer] = useState("A-");
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
|
||||
const reducer = useAnastasisContext();
|
||||
|
@ -9,7 +9,7 @@ import { SolveOverviewFeedbackDisplay } from "../SolveScreen";
|
||||
import { AuthMethodSolveProps } from "./index";
|
||||
|
||||
export function AuthMethodPostSolve({ id }: AuthMethodSolveProps): VNode {
|
||||
const [answer, setAnswer] = useState("");
|
||||
const [answer, setAnswer] = useState("A-");
|
||||
|
||||
const reducer = useAnastasisContext();
|
||||
if (!reducer) {
|
||||
|
@ -45,7 +45,7 @@ export const WithoutFeedback = createExample(
|
||||
challenges: [
|
||||
{
|
||||
cost: "USD:1",
|
||||
instructions: "does P equals NP?",
|
||||
instructions: "SMS to +54 11 2233 4455",
|
||||
type: "question",
|
||||
uuid: "uuid-1",
|
||||
},
|
||||
|
@ -9,7 +9,7 @@ import { SolveOverviewFeedbackDisplay } from "../SolveScreen";
|
||||
import { AuthMethodSolveProps } from "./index";
|
||||
|
||||
export function AuthMethodSmsSolve({ id }: AuthMethodSolveProps): VNode {
|
||||
const [answer, setAnswer] = useState("");
|
||||
const [answer, setAnswer] = useState("A-");
|
||||
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const reducer = useAnastasisContext();
|
||||
|
@ -38,11 +38,6 @@
|
||||
name="theme-color"
|
||||
content="<%= htmlWebpackPlugin.options.manifest.theme_color %>"
|
||||
/>
|
||||
<% } %> <% for (const index in htmlWebpackPlugin.files.css) { %> <% const
|
||||
file = htmlWebpackPlugin.files.css[index] %>
|
||||
<style data-href="<%= file %>">
|
||||
<%= compilation.assets[file.substr(htmlWebpackPlugin.files.publicPath.length)].source() %>
|
||||
</style>
|
||||
<% } %>
|
||||
</head>
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user