Articles
+ +Here are some articles that offer more information about the Data Upload Design Kit:
+ + +diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b1e8338 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/prototypes/basic" + schedule: + interval: "weekly" +- package-ecosystem: npm + directory: "/lib/importer" + schedule: + interval: "weekly" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..6c773ce --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: Lint JS +on: + push: + branches: [main] + pull_request: + branches: [main] +jobs: + lint-importer: + defaults: + run: + working-directory: ./lib/importer + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install dependencies + run: npm i + - name: Run linter + run: npm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..910f7e7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: Tests +on: + push: + branches: [main] + pull_request: + branches: [main] +jobs: + test: + defaults: + run: + working-directory: ./prototypes/basic + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install lib dependencies -- todo, check why + working-directory: ./lib/importer + run: npm i + - name: Install dependencies + run: npm i + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results + path: ./prototypes/basic/test-results + retention-days: 30 + importer: + defaults: + run: + working-directory: ./lib/importer + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install lib dependencies + run: npm i + - name: Run tests + run: npm run test diff --git a/Makefile b/Makefile index cabf31e..4494ca6 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,21 @@ +update-deps: + @echo "***************************" + @echo "** Updating importer lib **" + @echo "***************************" + @cd lib/importer && npm install + @echo "***********************************" + @echo "** Default development prototype **" + @echo "***********************************" + @cd prototypes/basic && npm install + .PHONY: prototype -prototype: ifndef NAME - $(error Need a value for NAME, e.g., make prototype NAME=value) -endif +prototype: + $(error Need a value for NAME, e.g., make prototype NAME=value) +else +prototype: @cd lib/importer && npm install @mkdir -p prototypes/${NAME} @cd prototypes/${NAME} && npx govuk-prototype-kit@latest create && npm install ../../lib/importer @@ -17,3 +28,5 @@ endif cd prototypes/${NAME}\n\ npm run dev\n\ " +endif + diff --git a/doc/.gitignore b/doc/.gitignore index 7c35728..a0b232b 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,16 +1,28 @@ selectable_table.css +sheet_selector.css +x-govuk-masthead.css +docs.css +get-started-screenshots.png class_list.js keys.js selectable_polyfills.js selectable_table.js -docs.css -init.js +sheet_selector.js +logo.png +mainpage-screenshots.png govuk-frontend.min.js +init.js auto-store-data.js kit.js application.js application.css +articles.html +component-sheet-selector.html component-table-view.html +how-it-works.html index.html pattern-tabular-data.html +start.html +what-it-is.html assets.mk +assets.txt diff --git a/doc/Makefile b/doc/Makefile index 6897b56..de6be15 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -10,13 +10,15 @@ $(error "No hq on the PATH? https://github.com/ludovicianul/hq/releases/tag/hq-1 endif SOURCES := $(wildcard ../lib/importer/assets/docs/*.html) +IMAGES := $(wildcard ../lib/importer/assets/docs/*.png) OBJECTS := $(subst ../lib/importer/assets/docs/,./,${SOURCES}) # Create a list of all of the assets the pages need, by looking at the scripts # and stylesheets they intended to download. assets.txt: ${SOURCES} (echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r '[data-plugin-only]' -f INPUT -a src 'script[src]'; \ - echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r '[data-plugin-only]' -f INPUT -a href 'link[rel=stylesheet]') | \ + echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r '[data-plugin-only]' -f INPUT -a href 'link[rel=stylesheet]'; \ + echo ${IMAGES} | xargs -n1 | sed 's_\.\./lib/importer/assets/docs/_./_') | \ sort -u | grep . > $@ # Now build a Makefile dependency include, specifying the correct download @@ -41,7 +43,7 @@ include assets.mk # We can generate the .gitignore from all of the things we know we are going to # end up with in the root dir. .gitignore: assets.txt - (cat $^; printf '%s\n' ${OBJECTS}; echo assets.mk) | xargs -n1 basename > $@ + (cat $^; printf '%s\n' ${OBJECTS}; echo assets.mk; echo assets.txt) | xargs -n1 basename > $@ all: .gitignore # Download the page and remove any elements marked only for plugin use. @@ -52,7 +54,7 @@ all: .gitignore # Download the asset. This is the easiest way to get the real thing, as some of # them (e.g. application.css) are generated by the Prototype Kit and can't just # be copied from the disk. -%.css %.js: +%.css %.js %.png: curl --fail-with-body -o $@ -sL http://localhost:3000${SRC} || cat $@ .PHONY: clean diff --git a/fixtures/realistic.ods b/fixtures/realistic.ods new file mode 100644 index 0000000..8df58eb Binary files /dev/null and b/fixtures/realistic.ods differ diff --git a/fixtures/small-file.csv b/fixtures/small-file.csv new file mode 100644 index 0000000..a3672ab --- /dev/null +++ b/fixtures/small-file.csv @@ -0,0 +1,2 @@ +A,B +1,2 diff --git a/lib/importer/assets/css/range_selector.css b/lib/importer/assets/css/range_selector.css new file mode 100644 index 0000000..74dbb1c --- /dev/null +++ b/lib/importer/assets/css/range_selector.css @@ -0,0 +1,3 @@ +.rd-range-selector { + overflow-x: auto; +} diff --git a/lib/importer/assets/css/selectable_table.css b/lib/importer/assets/css/selectable_table.css index 7d0995d..39ab961 100644 --- a/lib/importer/assets/css/selectable_table.css +++ b/lib/importer/assets/css/selectable_table.css @@ -8,6 +8,8 @@ table.selectable { table.selectable caption { text-align: inherit; + white-space: nowrap; + overflow: hidden; } table.selectable col:not(:first-child) { diff --git a/lib/importer/assets/docs/articles.html b/lib/importer/assets/docs/articles.html new file mode 100644 index 0000000..623d3a5 --- /dev/null +++ b/lib/importer/assets/docs/articles.html @@ -0,0 +1,151 @@ + + + +
+ +Here are some articles that offer more information about the Data Upload Design Kit:
+ + +