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

Hoff 113- added Hof skeleton project #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Empty file added .env
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM quay.io/ukhomeofficedigital/nodejs-base:v6

RUN mkdir /public

COPY package.json /app/package.json
RUN npm --loglevel warn install --production
COPY . /app
RUN npm --loglevel warn run postinstall --production
RUN chown -R nodejs:nodejs /public

USER nodejs

CMD ["/app/run.sh"]
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 UKHomeOffice

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# hof-skeleton
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
This is to get you started with HOF. Use this to create a new project.

## Install prerequisites

Step 1 : Install Node Version Manager

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# or
brew install nvm

Any option you choose, please follow the next instruction on your terminal.
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved

Check the version nvm --version

Step 2 : nvm install 18.19.0

Step 3: nvm use 18.19.0

Step 4: npm i -g yarn

Step 5: yarn

Step 6: yarn run start:dev

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would highly recommend reading about how to do documentation on github https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/quickstart-for-writing-on-github

Whenever you put in codeblocks, the common practice is to use backticks


- [Node.js](https://nodejs.org/en/) - Tested against LTS
- NPM (installed with Node.js) - Works with versions 2 and 3
- [Redis server](http://redis.io/download) running on the default port


### Replacing existing project and settings with a prefered project name

- In the apps folder rename the existing folder 'hof-project'.

> Example apps/hof-project --> apps/name-of-project .

- navigate to the index.js file on line-4 replace 'hof-project'.

> Example name: 'hof-project' --> name: 'name-of-project'.

- navigate to hof-settings.json on line-8 replace the app route.

> Example "routes": [
"./apps/hof-project" --> "./apps/name-of-project".
],
Empty file added apps/common/fields/index.js
Empty file.
11 changes: 11 additions & 0 deletions apps/common/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

module.exports = {
name: 'common',
steps: {
'/start': {
template: 'start',
next: 'hof/welcome'
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
}
}
};
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 14 additions & 0 deletions apps/common/translations/en/default.json
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"buttons": {
"start-home": "Start Now"
},
"journey": {
"header": "HOF Service Form Template",
"phase": "beta"
},
"pages": {
"start": {
"header": "HOF Project Form Template"
}
}
}
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions apps/common/translations/src/en/buttons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"start-home": "Start Now"
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
}
4 changes: 4 additions & 0 deletions apps/common/translations/src/en/journey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"header": "HOF Service Form Template",
"phase": "beta"
}
5 changes: 5 additions & 0 deletions apps/common/translations/src/en/pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"start": {
"header": "HOF Project Form Template"
}
}
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions apps/common/views/content/start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


## Our Project

* Illegal Migration Act (IMA).
* Electronic Travel Authorization (ETA).
* Public Allegations Form (PAF).
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions apps/common/views/start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{<partials-page}}
{{$page-content}}
{{#markdown}}start{{/markdown}}
{{#input-submit}}start-home{{/input-submit}}
{{/page-content}}
{{/partials-page}}
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions apps/hof-project/fields/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
'welcome-textbox': {
mixin: 'input-text',
validate: ['notUrl', { type: 'maxlength', arguments: 50 }]
},
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
};
16 changes: 16 additions & 0 deletions apps/hof-project/index.js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change

'/confirmation': {
      backLink: false
 }

to

'/confirmation': {
     clearSession: true
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have unresolved this as I can't see the change - has it been pushed?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should say clearSession: true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes push already i have no idea why the changes not coming on

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

module.exports = {
name: 'hof-project',
params: '/:action?/:id?/:edit?',
baseUrl: '/hof',
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
steps: {
'/welcome': {
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
fields: ['welcome-textbox'],
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
backLink: '/start',
next: '/confirm'
},
"/confirm": {}

TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
}
};
38 changes: 38 additions & 0 deletions apps/hof-project/translations/en/default.json
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"buttons": {
"start-home": "Start Now"
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
},
"journey": {
"header": "New HOF Service Form",
"phase": "beta"
},
"pages": {
"start": {
"header": "HOF Project Form Template"
},
"welcome": {
"header": "Welcome to Hof Project",
"paragraph": "This completes your secure access to this service."
},
"confirm": {
"header": "Check your answers"
}
},
"button": {
"start-home": "Start Now",
"upload-file": "Upload",
"save-and-exit": "Save and exit",
"delete": "Delete",
"cancel": "Cancel",
"edit": "Change",
"continue-only": "Continue",
"save-and-continue": "Continue",
"confirm-submission": "Submit"
},
"fields": {
"welcome-textbox": {
"label": "Hof project number (if known)"
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
}
},
"validation": {}
}
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 11 additions & 0 deletions apps/hof-project/translations/src/en/button.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"start-home": "Start Now",
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
"upload-file": "Upload",
"save-and-exit": "Save and exit",
"delete": "Delete",
"cancel": "Cancel",
"edit": "Change",
"continue-only": "Continue",
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
"save-and-continue": "Continue",
"confirm-submission": "Submit"
}
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions apps/hof-project/translations/src/en/fields.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"welcome-textbox": {
"label": "Hof project number (if known)"
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
}
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
}
4 changes: 4 additions & 0 deletions apps/hof-project/translations/src/en/journey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"header": "New HOF Service Form",
"phase": "beta"
}
9 changes: 9 additions & 0 deletions apps/hof-project/translations/src/en/pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"welcome": {
"header": "Welcome to Hof Project",
"paragraph": "This completes your secure access to this service."
},
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
"confirm": {
"header": "Check your answers"
}
}
1 change: 1 addition & 0 deletions apps/hof-project/translations/src/en/validation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Rhodine-orleans-lindsay marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
8 changes: 8 additions & 0 deletions apps/hof-project/views/welcome.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{<partials-page}}
{{$page-content}}

{{#fields}}
{{#renderField}}{{/renderField}}
{{/fields}}
{{/page-content}}
{{/partials-page}}
TemitopeAyokuHO marked this conversation as resolved.
Show resolved Hide resolved
Binary file added assets/.DS_Store
Binary file not shown.
Binary file added assets/images/ho-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/no-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions assets/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

require('hof/frontend/themes/gov-uk/client-js');
const govuk = require('govuk-frontend');
const $ = require('jquery');
const accessibleAutocomplete = require('accessible-autocomplete');


$('.typeahead').each(function applyTypeahead() {
accessibleAutocomplete.enhanceSelectElement({
defaultValue: '',
selectElement: this
});
});

govuk.initAll();
Loading