diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 9219001d9f..20279ddac1 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -17,6 +17,7 @@ RUN apt-get update \
emacs \
exa \
fd-find \
+ fzf \
git \
iputils-ping \
iproute2 \
diff --git a/.devcontainer/scripts/installations.sh b/.devcontainer/scripts/installations.sh
index f009a6b51e..7151480947 100644
--- a/.devcontainer/scripts/installations.sh
+++ b/.devcontainer/scripts/installations.sh
@@ -13,6 +13,10 @@ echo -e "alias ll='exa -alh@ --git'" >> ~/.zshrc
echo -e "alias lt='exa -al -T -L 2'" >> ~/.zshrc
echo -e "alias poe='poetry run poe'" >> ~/.zshrc
+echo -e "# fzf key bindings and completion" >> ~/.zshrc
+echo -e "source /usr/share/doc/fzf/examples/key-bindings.zsh" >> ~/.zshrc
+echo -e "source /usr/share/doc/fzf/examples/completion.zsh" >> ~/.zshrc
+
# Poetry autocomplete
echo -e "fpath+=/.zfunc" >> ~/.zshrc
echo -e "autoload -Uz compinit && compinit"
diff --git a/app/config.py b/app/config.py
index 920bbf13cc..9b37a55798 100644
--- a/app/config.py
+++ b/app/config.py
@@ -80,10 +80,10 @@ class Config(object):
# FEATURE FLAGS
FF_SALESFORCE_CONTACT = env.bool("FF_SALESFORCE_CONTACT", True)
FF_RTL = env.bool("FF_RTL", True)
- FF_ANNUAL_LIMIT = env.bool("FF_ANNUAL_LIMIT", True)
+ FF_ANNUAL_LIMIT = env.bool("FF_ANNUAL_LIMIT", False)
- FREE_YEARLY_EMAIL_LIMIT = env.int("FREE_YEARLY_EMAIL_LIMIT", 10_000_000)
- FREE_YEARLY_SMS_LIMIT = env.int("FREE_YEARLY_SMS_LIMIT", 25_000)
+ FREE_YEARLY_EMAIL_LIMIT = env.int("FREE_YEARLY_EMAIL_LIMIT", 20_000_000)
+ FREE_YEARLY_SMS_LIMIT = env.int("FREE_YEARLY_SMS_LIMIT", 100_000)
GC_ARTICLES_API = os.environ.get("GC_ARTICLES_API", "articles.alpha.canada.ca/notification-gc-notify")
GC_ARTICLES_API_AUTH_PASSWORD = os.environ.get("GC_ARTICLES_API_AUTH_PASSWORD")
GC_ARTICLES_API_AUTH_USERNAME = os.environ.get("GC_ARTICLES_API_AUTH_USERNAME")
@@ -215,7 +215,7 @@ class Test(Development):
NO_BRANDING_ID = "0af93cf1-2c49-485f-878f-f3e662e651ef"
FF_RTL = True
- FF_ANNUAL_LIMIT = False
+ FF_ANNUAL_LIMIT = True
class ProductionFF(Config):
diff --git a/app/extensions.py b/app/extensions.py
index 8421b1e560..51bebe6e38 100644
--- a/app/extensions.py
+++ b/app/extensions.py
@@ -1,5 +1,6 @@
from flask_caching import Cache
from notifications_utils.clients.antivirus.antivirus_client import AntivirusClient
+from notifications_utils.clients.redis.annual_limit import RedisAnnualLimit
from notifications_utils.clients.redis.bounce_rate import RedisBounceRate
from notifications_utils.clients.redis.redis_client import RedisClient
from notifications_utils.clients.statsd.statsd_client import StatsdClient
@@ -10,4 +11,6 @@
zendesk_client = ZendeskClient()
redis_client = RedisClient()
bounce_rate_client = RedisBounceRate(redis_client)
+annual_limit_client = RedisAnnualLimit(redis_client)
+
cache = Cache(config={"CACHE_TYPE": "simple"}) # TODO: pull config out to config.py later
diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py
index f1bd214bfe..54c141a82d 100644
--- a/app/main/views/dashboard.py
+++ b/app/main/views/dashboard.py
@@ -24,7 +24,7 @@
service_api_client,
template_statistics_client,
)
-from app.extensions import bounce_rate_client
+from app.extensions import annual_limit_client, bounce_rate_client
from app.main import main
from app.models.enum.bounce_rate_status import BounceRateStatus
from app.models.enum.notification_statuses import NotificationStatuses
@@ -229,16 +229,90 @@ def usage(service_id):
@main.route("/services/ {{ _('Daily limit per service:') }} {{ _('10,000 emails {{ _('10,000 emails{{ _(headings[1].title) }}
1000 text messages') }}
1,000 text messages') }}{{ _(headings[1].title) }}
{{ _('10 million emails
25,000 text messages') }}
{{ _('20 million emails
100,000 text messages') }}
- {{ _("You can try sending these messages after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], content_link(_("your current local time"), 'https://nrc.canada.ca/en/web-clock/', is_external_link=true))}} + {{ _("You can try sending these messages after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], + content_link(_("your current local time"), _('https://nrc.canada.ca/en/web-clock/'), is_external_link=true))}}
{% elif recipients.more_rows_than_can_send and false %} {% call banner_wrapper(type='dangerous') %} @@ -173,7 +174,8 @@- {{ _("You can try sending these messages after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], content_link(_("your current local time"), 'https://nrc.canada.ca/en/web-clock/', is_external_link=true))}} + {{ _("You can try sending these messages after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], + content_link(_("your current local time"), _('https://nrc.canada.ca/en/web-clock/'), is_external_link=true))}}
diff --git a/app/templates/views/dashboard/_totals_annual.html b/app/templates/views/dashboard/_totals_annual.html new file mode 100644 index 0000000000..4985ec80be --- /dev/null +++ b/app/templates/views/dashboard/_totals_annual.html @@ -0,0 +1,25 @@ +{% from "components/big-number.html" import big_number %} +{% from "components/message-count-label.html" import message_count_label %} +{% from 'components/remaining-messages.html' import remaining_messages %} +{% from "components/show-more.html" import show_more %} + +- {{ _("You can try sending this message after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], content_link(_("your current local time"), 'https://nrc.canada.ca/en/web-clock/', is_external_link=true))}} + {{ _("You can try sending this message after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], + content_link(_("your current local time"), _('https://nrc.canada.ca/en/web-clock/'), is_external_link=true))}}
- {{ _("You can try sending this message after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], content_link(_("your current local time"), 'https://nrc.canada.ca/en/web-clock/', is_external_link=true))}} + {{ _("You can try sending this message after {} Eastern Time. Check {}.").format(time_to_reset[current_lang], + content_link(_("your current local time"), _('https://nrc.canada.ca/en/web-clock/'), is_external_link=true))}}