Skip to content

Commit

Permalink
Merge branch 'development' into improve-build
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Dec 4, 2023
2 parents ef241f6 + 37e5aa6 commit 9bcdf9b
Show file tree
Hide file tree
Showing 131 changed files with 434,409 additions and 759 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{md,yaml,yml}]
[*.{md,yml,yaml}]
indent_style = space
indent_size = 2

Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@typescript-eslint"
],
"rules": {
// only to be used when declaring props as {}. Example is in UIModalComponent, ie; extends React.Component<{}>
// only to be used when declaring props as {}.
// is used in conjunction with overrides
// https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns
"@typescript-eslint/ban-types": [
Expand Down
162 changes: 76 additions & 86 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,89 +6,79 @@

version: "3.8"
services:
# Database service. It's PostgreSQL, see the Dockerfile in ./containers/database.
database:
build: ./containers/database/
environment:
# Custom PGDATA per recommendations from official Docker page
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=pleaseChange # default postgres password that should be changed for security.
volumes:
- ./postgres-data:/var/lib/postgresql/data/pgdata
# ports:
# - "5432:5432"
# Uncomment the above lines to enable access to the PostgreSQL server
# from the host machine.
# Web service runs Node
dev-server:
# Comment out the this service for production
build:
context: ./
dockerfile: ./containers/web/Dockerfile
# Using a volume allows autorebuild to work.
volumes:
- ./:/usr/src/app
ports:
- "8085:8085"
depends_on:
- web
command:
[
"bash",
"./src/scripts/devStartVite.sh",
"${install_args:-}"
]
web:
# Configuration variables for the app.
environment:
- OED_PRODUCTION=no
- OED_SERVER_PORT=3000
- OED_DB_USER=oed
- OED_DB_DATABASE=oed
- OED_DB_TEST_DATABASE=oed_testing
- OED_DB_PASSWORD=opened
- OED_DB_HOST=database # Docker will set this hostname
- OED_DB_PORT=5432
- OED_TOKEN_SECRET=?
- OED_LOG_FILE=log.txt
- OED_MAIL_METHOD=none # Method of sending mail. Supports "secure-smtp", "none". Case insensitive.
- OED_MAIL_SMTP=smtp.example.com # Edit this
- OED_MAIL_SMTP_PORT=465 # Edit this
- OED_MAIL_IDENT=someone@example.com # The user email that is used for sending emails (SMTP)
- OED_MAIL_CREDENTIAL=credential # Set the email password for sending email here
- OED_MAIL_FROM=mydomain@example.com # The email address that the email will come from
- OED_MAIL_TO=someone@example.com # Set the destination address here for where to send emails
- OED_MAIL_ORG=My Organization Name # Org name for mail that is included in the subject
# Changing this value does not impact what OED displays.
# What it will change is the date/time stamp on logs, notes and change dates that place the current date/time.
# It can also impact the interpretation of readings sent to OED such as Unix timestamps.
- TZ=Etc/UTC # Set the timezone of the Docker container where OED runs the web services.
# If in a subdirectory, set it here
# - OED_SUBDIR=/subdir/
# Set the correct build environment.
build:
context: ./
dockerfile: ./containers/web/Dockerfile
# Link to the database so the app can persist data
links:
- database
# Load the source code into the container.
volumes:
- ./:/usr/src/app
# List ports the container should expose
# For production you might want to add "80:3000" in place of the "3000:3000" line below
ports:
- "3000:3000"
depends_on:
# Don't bring this up without the DB
- database
# database:
# We need the database and it has to be ready for work (see healthcheck above).
# condition: service_healthy
# If environment variable install_args is not set then it becomes blank without warning user.
command:
[
"bash",
"./src/scripts/installOED.sh",
"${install_args:-}"
]
# Database service. It's PostgreSQL, see the
# Dockerfile in ./database
database:
build: ./containers/database/
environment:
# Custom PGDATA per recommendations from official Docker page
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=pleaseChange # default postgres password that should be changed for security.
volumes:
- ./postgres-data:/var/lib/postgresql/data/pgdata
# ports:
# - "5432:5432"
# Uncomment the above lines to enable access to the PostgreSQL server
# from the host machine.
# Web service runs Node
web:
# Configuration variables for the app.
environment:
- OED_PRODUCTION=no
- OED_SERVER_PORT=3000
- OED_DB_USER=oed
- OED_DB_DATABASE=oed
- OED_DB_TEST_DATABASE=oed_testing
- OED_DB_PASSWORD=opened
- OED_DB_HOST=database # Docker will set this hostname
- OED_DB_PORT=5432
- OED_TOKEN_SECRET=?
- OED_LOG_FILE=log.txt
- OED_MAIL_METHOD=none # Method of sending mail. Supports "secure-smtp", "none". Case insensitive.
- OED_MAIL_SMTP=smtp.example.com # Edit this
- OED_MAIL_SMTP_PORT=465 # Edit this
- OED_MAIL_IDENT=someone@example.com # The user email that is used for sending emails (SMTP)
- OED_MAIL_CREDENTIAL=credential # Set the email password for sending email here
- OED_MAIL_FROM=mydomain@example.com # The email address that the email will come from
- OED_MAIL_TO=someone@example.com # Set the destination address here for where to send emails
- OED_MAIL_ORG=My Organization Name # Org name for mail that is included in the subject
# Changing this value does not impact what OED displays.
# What it will change is the date/time stamp on logs, notes and change dates that place the current date/time.
# It can also impact the interpretation of readings sent to OED such as Unix timestamps.
- TZ=Etc/UTC # Set the timezone of the Docker container where OED runs the web services.
# If in a subdirectory, set it here
# - OED_SUBDIR=/subdir/
# Set the correct build environment.
build:
context: ./
dockerfile: ./containers/web/Dockerfile
# Link to the database so the app can persist data
links:
- database
# Load the source code into the container.
# Using a volume allows autorebuild to work.
volumes:
- ./:/usr/src/app
# Map the default port.
ports:
- "3000:3000" # Should be commented out if you uncomment 80:3000 below.
- "9229:9229" # Debug port, should be commented out for production
# For production you might want something like:
# - "80:3000"
# and comment out the debug port and 3000:3000 line above
# Don't bring this up without the DB
depends_on:
- database
# database:
# We need the database and it has to be ready for work (see healthcheck above).
# condition: service_healthy
# Lets docker-compose up work right
# If environment variable install_args is not set then it becomes blank without warning user.
command:
[
"bash",
"./src/scripts/installOED.sh",
"${install_args:-}"
]
# Use this if you are using a docker-compose that is earlier than version 2 and comment out the one above.
# command: ["bash", "./src/scripts/installOED.sh"]
51 changes: 31 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,29 @@
"react": "$react"
}
},
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
},
"resolutions": {
"babel-core": "7.0.0-bridge.0"
},
"peerDependencies": {
"babel-plugin-lodash": "~3.3.4"
},
"dependencies": {
"@formatjs/intl": "~1.17.0",
"axios": "~0.24.0",
"escape-html": "~1.0.3",
"@wojtekmaj/react-daterange-picker": "~5.2.0",
"axios": "~1.6.2",
"bcryptjs": "~2.4.3",
"body-parser": "~1.20.2",
"bootstrap": "~5.2.3",
"cookie-parser": "~1.4.4",
"csv": "~5.3.2",
"csv-parse": "~4.16.3",
"csv-stringify": "~5.6.5",
"debug": "~4.3.2",
"dotenv": "~16.0.3",
"escape-html": "~1.0.3",
"express": "~4.17.3",
"express-rate-limit": "~5.5.1",
"history": "~4.7.2",
Expand All @@ -99,29 +109,24 @@
"ngraph.graph": "~20.0.0",
"ngraph.path": "~1.4.0",
"nodemailer": "~6.6.1",
"pg": "~8.10.0",
"pg": "~8.11.3",
"pg-promise": "~11.5.0",
"plotly.js": "~2.18.1",
"prop-types": "~15.8.1",
"query-string": "~7.0.1",
"query-string": "~8.1.0",
"rc-slider": "~8.6.6",
"react": "~18.2.0",
"react-bootstrap": "~2.2.3",
"react-dom": "~18.2.0",
"react-dropzone": "~12.0.4",
"react-intl": "~6.4.4",
"react-plotly.js": "~2.6.0",
"react-redux": "~8.1.2",
"react-router": "~5.2.1",
"react-router-dom": "~5.3.0",
"react-select": "~5.7.4",
"react-toastify": "~9.1.3",
"react-tooltip": "~4.2.20",
"reactstrap": "~9.1.10",
"redux": "~4.2.1",
"redux-thunk": "~2.4.0",
"request": "~2.88.2",
"request-promise-native": "~1.0.7",
"serve-favicon": "~2.5.0",
"xml2js": "~0.5.0"
},
Expand All @@ -133,27 +138,33 @@
"@types/node": "~20.5.6",
"@types/plotly.js": "~2.12.5",
"@types/rc-slider": "~8.2.3",
"@types/react": "~18.2.28",
"@types/react": "~18.2.19",
"@types/react-dom": "~18.2.7",
"@types/react-plotly.js": "~2.6.0",
"@types/react-redux": "~7.1.25",
"@types/react-router": "~5.1.20",
"@types/react-router-dom": "~5.3.0",
"@typescript-eslint/eslint-plugin": "~6.4.1",
"@typescript-eslint/parser": "~6.4.1",
"@typescript-eslint/parser": "~6.11.0",
"@vitejs/plugin-react": "~4.0.0",
"acorn": "~8.7.0",
"chai": "~3.5.0",
"chai-as-promised": "~7.1.1",
"chai-http": "~4.3.0",
"css-loader": "~6.8.1",
"eslint": "~8.48.0",
"eslint-plugin-jsdoc": "~46.5.0",
"eslint-plugin-react": "~7.32.2",
"mocha": "~9.2.2",
"lodash-webpack-plugin": "~0.11.6",
"mocha": "~10.2.0",
"nodemon": "~2.0.22",
"sinon": "~12.0.0",
"sinon": "~17.0.1",
"source-map-loader": "~4.0.1",
"stream-browserify": "~3.0.0",
"style-loader": "~3.3.1",
"terser-webpack-plugin": "~5.3.9",
"ts-loader": "~9.2.0",
"typescript": "~5.1.6",
"vite": "~4.3.8",
"vite-plugin-commonjs": "~0.7.1"
"vite-plugin-commonjs": "~0.7.1",
"webpack": "~5.76.0",
"webpack-cli": "~5.1.4"
}
}
7 changes: 6 additions & 1 deletion src/client/app/actions/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export function updateDefaultMeterDisableChecks(defaultMeterDisableChecks: boole
return { type: ActionType.UpdateDefaultMeterDisableChecks, defaultMeterDisableChecks };
}

export function updateDefaultHelpUrl(defaultHelpUrl: string): t.UpdateDefaultHelpUrlAction {
return { type: ActionType.UpdateDefaultHelpUrl, defaultHelpUrl }
}

function requestPreferences(): t.RequestPreferencesAction {
return { type: ActionType.RequestPreferences };
}
Expand Down Expand Up @@ -195,7 +199,8 @@ export function submitPreferences() {
defaultMeterMaximumDate: state.admin.defaultMeterMaximumDate,
defaultMeterReadingGap: state.admin.defaultMeterReadingGap,
defaultMeterMaximumErrors: state.admin.defaultMeterMaximumErrors,
defaultMeterDisableChecks: state.admin.defaultMeterDisableChecks
defaultMeterDisableChecks: state.admin.defaultMeterDisableChecks,
defaultHelpUrl: state.admin.defaultHelpUrl
});
// Only return the defaultMeterReadingFrequency because the value from the DB
// generally differs from what the user input so update state with DB value.
Expand Down
Loading

0 comments on commit 9bcdf9b

Please sign in to comment.