Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Enketo to version 7.3.1 #8

Merged
merged 6 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
FROM enketo/enketo-express:6.2.2
FROM node:20.12.2-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
build-essential \
git \
ca-certificates \
chromium

ENV ENKETO_SRC_DIR=/srv/src/enketo
WORKDIR ${ENKETO_SRC_DIR}

RUN git clone https://github.com/enketo/enketo ${ENKETO_SRC_DIR}

# GitHub Actions adds an authentication header to the Git configuration,
# which prevents us from installing Node modules in *public* GitHub
Expand All @@ -21,19 +33,21 @@ COPY config-at-build-time.json config/config.json
COPY disclaimer-css.patch /tmp/
RUN git apply /tmp/disclaimer-css.patch

# `npm install` by itself, with no widget, is necessary before any building
# because the base image calls `npm prune --production`.
# `npm install` custom widgets here according to
# https://enketo.github.io/enketo-express/tutorial-34-custom-widgets.html.
# Please note that widgets must also be listed in the run-time config.json to
# be enabled.
RUN npm install && \
npm install https://github.com/kobotoolbox/enketo-image-customization-widget.git && \
npm install https://github.com/kobotoolbox/enketo-literacy-test-widget.git && \
npx grunt && \
npm prune --production && \
rm config/config.json
RUN yarn install --frozen-lockfile \
&& yarn cache clean \
&& yarn workspace enketo-express add https://github.com/kobotoolbox/enketo-image-customization-widget#15a1096e2e924cba81caedd69aa17c5920823e26 -W \
&& yarn workspace enketo-express add https://github.com/kobotoolbox/enketo-literacy-test-widget#8ee65b7ff74f6c2502c86ecd0a1bb8ab3f9670a6 -W \
&& yarn workspace enketo-express run build \
&& rm config/config.json
jnm marked this conversation as resolved.
Show resolved Hide resolved

# Since we're building anyway, install our favicon in a simple way instead of
# using a Docker volume
COPY images/* public/images/

WORKDIR ${ENKETO_SRC_DIR}/packages/enketo-express

EXPOSE 8005

CMD ["yarn", "workspace", "enketo-express"]
30 changes: 15 additions & 15 deletions disclaimer-css.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Adds CSS to make appended disclaimer visible

Adds new component `_disclaimer`. Imports component to themes.
---
app/views/styles/component/_disclaimer.scss | 11 +++++++++++
app/views/styles/theme-formhub/theme-formhub.scss | 1 +
app/views/styles/theme-grid/theme-grid.scss | 1 +
app/views/styles/theme-kobo/theme-kobo.scss | 1 +
packages/enketo-express/app/views/styles/component/_disclaimer.scss | 11 +++++++++++
packages/enketo-express/app/views/styles/theme-formhub/theme-formhub.scss | 1 +
packages/enketo-express/app/views/styles/theme-grid/theme-grid.scss | 1 +
packages/enketo-express/app/views/styles/theme-kobo/theme-kobo.scss | 1 +
4 files changed, 14 insertions(+)
create mode 100644 app/views/styles/component/_disclaimer.scss

diff --git a/app/views/styles/component/_disclaimer.scss b/app/views/styles/component/_disclaimer.scss
diff --git a/packages/enketo-express/app/views/styles/component/_disclaimer.scss b/packages/enketo-express/app/views/styles/component/_disclaimer.scss
new file mode 100644
index 000000000..e921ed59a
--- /dev/null
+++ b/app/views/styles/component/_disclaimer.scss
+++ b/packages/enketo-express/app/views/styles/component/_disclaimer.scss
@@ -0,0 +1,11 @@
+.or-appearance-kobo-disclaimer {
+ display: block !important;
Expand All @@ -29,28 +29,28 @@ index 000000000..e921ed59a
+ background-color: #e4f4fe !important;
+ font-weight: strong !important;
+}
diff --git a/app/views/styles/theme-formhub/theme-formhub.scss b/app/views/styles/theme-formhub/theme-formhub.scss
diff --git a/packages/enketo-express/app/views/styles/theme-formhub/theme-formhub.scss b/packages/enketo-express/app/views/styles/theme-formhub/theme-formhub.scss
index b4066ddf8..efabc3cf9 100644
--- a/app/views/styles/theme-formhub/theme-formhub.scss
+++ b/app/views/styles/theme-formhub/theme-formhub.scss
--- a/packages/enketo-express/app/views/styles/theme-formhub/theme-formhub.scss
+++ b/packages/enketo-express/app/views/styles/theme-formhub/theme-formhub.scss
@@ -36,3 +36,4 @@
@import 'form_formhub';
@import '../component/form_header';
@import '../component/form_footer';
+@import '../component/disclaimer';
diff --git a/app/views/styles/theme-grid/theme-grid.scss b/app/views/styles/theme-grid/theme-grid.scss
diff --git a/packages/enketo-express/app/views/styles/theme-grid/theme-grid.scss b/packages/enketo-express/app/views/styles/theme-grid/theme-grid.scss
index 82d83d01f..881943b47 100644
--- a/app/views/styles/theme-grid/theme-grid.scss
+++ b/app/views/styles/theme-grid/theme-grid.scss
--- a/packages/enketo-express/app/views/styles/theme-grid/theme-grid.scss
+++ b/packages/enketo-express/app/views/styles/theme-grid/theme-grid.scss
@@ -37,3 +37,4 @@
@import 'form-grid';
@import '../component/form_header';
@import '../component/form_footer';
+@import '../component/disclaimer';
diff --git a/app/views/styles/theme-kobo/theme-kobo.scss b/app/views/styles/theme-kobo/theme-kobo.scss
diff --git a/packages/enketo-express/app/views/styles/theme-kobo/theme-kobo.scss b/packages/enketo-express/app/views/styles/theme-kobo/theme-kobo.scss
index 66a6b7ba4..b2b626f76 100644
--- a/app/views/styles/theme-kobo/theme-kobo.scss
+++ b/app/views/styles/theme-kobo/theme-kobo.scss
--- a/packages/enketo-express/app/views/styles/theme-kobo/theme-kobo.scss
+++ b/packages/enketo-express/app/views/styles/theme-kobo/theme-kobo.scss
@@ -36,3 +36,4 @@
@import '../theme-formhub/form_formhub';
@import '../component/form_header';
Expand Down