Skip to content

Commit

Permalink
Merge branch 'develop' into country-sections
Browse files Browse the repository at this point in the history
  • Loading branch information
bfabio authored May 22, 2024
2 parents 98964c5 + 0c1030b commit c457ad8
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 59 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node -v
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM docker.io/node:18 as build-stage

FROM node:20-alpine3.19 as build-stage
WORKDIR /app

RUN apt-get update \
&& apt-get -y --no-install-recommends install golang-go=2:1.19~1 golang-src=2:1.19~1
COPY package*.json ./
RUN npm install

COPY . /app
COPY . .

RUN apk update && apk add go go-doc
RUN mkdir -p $(go env GOROOT)/misc/wasm
RUN cp /usr/share/doc/go/misc/wasm/wasm_exec.js $(go env GOROOT)/misc/wasm/wasm_exec.js

RUN npm ci
RUN npm run build

FROM docker.io/nginx:1
FROM nginx:alpine
WORKDIR /app
COPY --from=build-stage /app/dist/ /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
49 changes: 0 additions & 49 deletions SETUP-GIUDE.md

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ services:
env_file:
- .env
ports:
- "8100:80"
- "3000:80"
stdin_open: true
tty: true
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"react-dom": "^17.0.2",
"react-draft-wysiwyg": "^1.15.0",
"react-hook-form": "^7.45.0",
"react-hook-form-persist": "^3.0.0",
"react-i18next": "^13.0.0",
"react-jss": "^10.10.0",
"react-phone-number-input": "^3.2.23",
Expand Down
11 changes: 10 additions & 1 deletion src/app/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import EditorContacts from "./EditorContacts";
import EditorContractors from "./EditorContractors";
import linter from "../linter";

import useFormPersist from "react-hook-form-persist";

const resolver: Resolver<PublicCode> = async (values) => {
const res = await validator(JSON.stringify(values), "main");

Expand Down Expand Up @@ -71,7 +73,14 @@ export default function Editor() {
resolver,
});
const { t } = useTranslation();
const { getValues, handleSubmit } = methods;
const { getValues, handleSubmit, watch, setValue } = methods;

useFormPersist("form-values", {
watch,
setValue,
storage: window?.localStorage, // default window.sessionStorage
exclude: [],
});

const languages = useAppSelector((state) => state.language.languages);
const configCountrySections = countrySection.parse(DEFAULT_COUNTRY_SECTIONS);
Expand Down
7 changes: 5 additions & 2 deletions src/app/store/publiccodeYmlLanguages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ export const languageSlice = createSlice({
},
});

export const getPubliccodeYmlLanguages = (state) => state.language.languages;
export const getPubliccodeYmlLanguages = (state: {
language: { languages: unknown };
}) => state.language.languages;

export const { setPubliccodeYmlLanguages, resetPubliccodeYmlLanguages } = languageSlice.actions;
export const { setPubliccodeYmlLanguages, resetPubliccodeYmlLanguages } =
languageSlice.actions;

export default languageSlice.reducer;

0 comments on commit c457ad8

Please sign in to comment.