Skip to content

Commit

Permalink
Merge pull request #1578 from GSA/main
Browse files Browse the repository at this point in the history
05/30/2024 Production Deploy
  • Loading branch information
ccostino authored May 30, 2024
2 parents 84ece7d + 5508796 commit 3887ad1
Show file tree
Hide file tree
Showing 209 changed files with 51,144 additions and 632 deletions.
714 changes: 714 additions & 0 deletions .ds.baseline

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -11,3 +11,14 @@ repos:
- id: debug-statements
- id: check-merge-conflict
- id: check-toml
- id: check-ast
- id: fix-byte-order-marker
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: mixed-line-ending
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.ds.baseline']
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ too-complex:
.PHONY: py-test
py-test: export NEW_RELIC_ENVIRONMENT=test
py-test: ## Run python unit tests
poetry run coverage run --omit=*/notifications_utils/* -m pytest --maxfail=10 --ignore=tests/end_to_end tests/
poetry run coverage run -m pytest --maxfail=10 --ignore=tests/end_to_end tests/
poetry run coverage report --fail-under=96
poetry run coverage html -d .coverage_cache

Expand Down Expand Up @@ -101,13 +101,6 @@ py-lock: ## Syncs dependencies and updates lock file without performing recursiv
poetry lock --no-update
poetry install --sync

.PHONY: update-utils
update-utils: ## Forces Poetry to pull the latest changes from the notifications-utils repo; requires that you commit the changes to poetry.lock!
poetry update notifications-utils
@echo
@echo !!! PLEASE MAKE SURE TO COMMIT AND PUSH THE UPDATED poetry.lock FILE !!!
@echo

.PHONY: freeze-requirements
freeze-requirements: ## create static requirements.txt
poetry export --without-hashes --format=requirements.txt > requirements.txt
Expand Down
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ UI's backend and is required for most things to function. Set that up first!
Our other repositories are:

- [notifications-admin](https://github.com/GSA/notifications-admin)
- [notifications-utils](https://github.com/GSA/notifications-utils)
- [us-notify-compliance](https://github.com/GSA/us-notify-compliance/)
- [notify-python-demo](https://github.com/GSA/notify-python-demo)

Expand Down Expand Up @@ -420,23 +419,6 @@ In either situation, once you are finished and have verified the dependency
changes are working, please be sure to commit both the `pyproject.toml` and
`poetry.lock` files.

### Keeping the notification-utils Dependency Up-to-Date

The `notifications-utils` dependency references the other repository we have at
https://github.com/GSA/notifications-utils - this dependency requires a bit of
extra legwork to ensure it stays up-to-date.

Whenever a PR is merged in the `notifications-utils` repository, we need to make
sure the changes are pulled in here and committed to this repository as well.
You can do this by going through these steps:

- Make sure your local `main` branch is up-to-date
- Create a new branch to work in
- Run `make update-utils`
- Commit the updated `poetry.lock` file and push the changes
- Make a new PR with the change
- Have the PR get reviewed and merged

## Known Installation Issues

### Python Installation Errors
Expand Down
12 changes: 6 additions & 6 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
from flask_wtf.csrf import CSRFError
from itsdangerous import BadSignature
from notifications_python_client.errors import HTTPError
from notifications_utils import logging, request_helper
from notifications_utils.formatters import (
formatted_list,
get_lines_with_normalised_whitespace,
)
from notifications_utils.recipients import format_phone_number_human_readable
from werkzeug.exceptions import HTTPException as WerkzeugHTTPException
from werkzeug.exceptions import abort
from werkzeug.local import LocalProxy
Expand Down Expand Up @@ -114,6 +108,12 @@
from app.notify_client.user_api_client import user_api_client
from app.url_converters import SimpleDateTypeConverter, TemplateTypeConverter
from app.utils.govuk_frontend_jinja.flask_ext import init_govuk_frontend
from notifications_utils import logging, request_helper
from notifications_utils.formatters import (
formatted_list,
get_lines_with_normalised_whitespace,
)
from notifications_utils.recipients import format_phone_number_human_readable

login_manager = LoginManager()
csrf = CSRFProtect()
Expand Down
24 changes: 24 additions & 0 deletions app/assets/javascripts/chartDashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(function (window) {

const ctx = document.getElementById('myChart');

new Chart(ctx, {
type: 'bar',
data: {
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});

})(window);
2 changes: 1 addition & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from os import getenv

import newrelic.agent
from notifications_utils import DAILY_MESSAGE_LIMIT

from app.cloudfoundry_config import cloud_config
from notifications_utils import DAILY_MESSAGE_LIMIT


class Config(object):
Expand Down
6 changes: 3 additions & 3 deletions app/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
from flask import render_template_string, url_for
from flask.helpers import get_root_path
from markupsafe import Markup

from app.utils.csv import get_user_preferred_timezone
from app.utils.time import parse_naive_dt
from notifications_utils.field import Field
from notifications_utils.formatters import make_quotes_smart
from notifications_utils.formatters import nl2br as utils_nl2br
from notifications_utils.recipients import InvalidPhoneError, validate_phone_number
from notifications_utils.take import Take

from app.utils.csv import get_user_preferred_timezone
from app.utils.time import parse_naive_dt


def apply_html_class(tags, html_file):
new_html = html_file
Expand Down
6 changes: 3 additions & 3 deletions app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
from flask_wtf.file import FileField as FileField_wtf
from flask_wtf.file import FileSize
from markupsafe import Markup
from notifications_utils.formatters import strip_all_whitespace
from notifications_utils.insensitive_dict import InsensitiveDict
from notifications_utils.recipients import InvalidPhoneError, validate_phone_number
from werkzeug.utils import cached_property
from wtforms import (
BooleanField,
Expand Down Expand Up @@ -66,6 +63,9 @@
from app.utils import merge_jsonlike
from app.utils.csv import get_user_preferred_timezone
from app.utils.user_permissions import all_ui_permissions, permission_options
from notifications_utils.formatters import strip_all_whitespace
from notifications_utils.insensitive_dict import InsensitiveDict
from notifications_utils.recipients import InvalidPhoneError, validate_phone_number


def get_time_value_and_label(future_time):
Expand Down
8 changes: 4 additions & 4 deletions app/main/validators.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import re
from abc import ABC, abstractmethod

from notifications_utils.field import Field
from notifications_utils.formatters import formatted_list
from notifications_utils.recipients import InvalidEmailError, validate_email_address
from notifications_utils.sanitise_text import SanitiseSMS
from wtforms import ValidationError

from app.main._commonly_used_passwords import commonly_used_passwords
from app.models.spreadsheet import Spreadsheet
from app.utils.user import is_gov_user
from notifications_utils.field import Field
from notifications_utils.formatters import formatted_list
from notifications_utils.recipients import InvalidEmailError, validate_email_address
from notifications_utils.sanitise_text import SanitiseSMS


class CommonlyUsedPassword:
Expand Down
4 changes: 2 additions & 2 deletions app/main/views/conversation.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from flask import jsonify, redirect, render_template, session, url_for
from flask_login import current_user
from notifications_python_client.errors import HTTPError
from notifications_utils.recipients import format_phone_number_human_readable
from notifications_utils.template import SMSPreviewTemplate

from app import current_service, notification_api_client, service_api_client
from app.main import main
from app.main.forms import SearchByNameForm
from app.models.template_list import TemplateList
from app.utils.user import user_has_permissions
from notifications_utils.recipients import format_phone_number_human_readable
from notifications_utils.template import SMSPreviewTemplate


@main.route("/services/<uuid:service_id>/conversation/<uuid:notification_id>")
Expand Down
2 changes: 1 addition & 1 deletion app/main/views/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from flask import Response, abort, jsonify, render_template, request, session, url_for
from flask_login import current_user
from notifications_utils.recipients import format_phone_number_human_readable
from werkzeug.utils import redirect

from app import (
Expand All @@ -30,6 +29,7 @@
from app.utils.pagination import generate_next_dict, generate_previous_dict
from app.utils.time import get_current_financial_year
from app.utils.user import user_has_permissions
from notifications_utils.recipients import format_phone_number_human_readable


@main.route("/services/<uuid:service_id>/dashboard")
Expand Down
2 changes: 1 addition & 1 deletion app/main/views/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
)
from flask_login import current_user
from markupsafe import Markup
from notifications_utils.template import EmailPreviewTemplate, SMSBodyPreviewTemplate

from app import (
current_service,
Expand All @@ -35,6 +34,7 @@
get_page_from_request,
)
from app.utils.user import user_has_permissions
from notifications_utils.template import EmailPreviewTemplate, SMSBodyPreviewTemplate


@main.route("/services/<uuid:service_id>/jobs")
Expand Down
2 changes: 1 addition & 1 deletion app/main/views/new_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
url_for,
)
from itsdangerous import SignatureExpired
from notifications_utils.url_safe_token import check_token

from app.main import main
from app.main.forms import NewPasswordForm
from app.models.user import User
from app.utils.login import log_in_user
from notifications_utils.url_safe_token import check_token


@main.route("/new-password/<path:token>", methods=["GET", "POST"])
Expand Down
2 changes: 1 addition & 1 deletion app/main/views/pricing.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from flask import current_app, render_template
from flask_login import current_user
from notifications_utils.international_billing_rates import INTERNATIONAL_BILLING_RATES

from app.main import main
from app.main.forms import SearchByNameForm
from app.main.views.sub_navigation_dictionaries import using_notify_nav
from app.utils.user import user_is_logged_in
from notifications_utils.international_billing_rates import INTERNATIONAL_BILLING_RATES

CURRENT_SMS_RATE = "1.72"

Expand Down
Loading

0 comments on commit 3887ad1

Please sign in to comment.