Skip to content

Commit

Permalink
Language and UI refactor (#1291)
Browse files Browse the repository at this point in the history
* Formatter fixes

* Updated wording

* Made changes based on PR recommendations
  • Loading branch information
jamesstottmoj authored Apr 22, 2024
1 parent 3c44f38 commit 7063301
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 103 deletions.
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/app-secret-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{% block content %}
<h2 class="govuk-heading-xl">{{ page_title }} - [{{ form.env_name.value() }}]</h2>
<p>Adding suffix as part of key is encourage, please avoid to use ECR_ and KUBE_ as suffix as they have been used for other purposes</p>
<p>Adding a suffix as part of the key is encouraged. Please avoid using ECR_ and KUBE_ as suffixes as they are used for other purposes</p>
{% if form.error %}
<div class="error">{{ form.error }}</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/app-secret-update.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% extends "base.html" %}

{% block content %}
<h1 class="govuk-heading-xl">Update the secret: {{ form.display_key.value() }} - [{{ form.env_name.value() }}]</h1>
<h1 class="govuk-heading-xl">Update Secret: {{ form.display_key.value() }} - [{{ form.env_name.value() }}]</h1>

{% if form.error %}
<div class="error">{{ form.error }}</div>
Expand Down
6 changes: 3 additions & 3 deletions controlpanel/frontend/jinja2/app-variable-manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
{% block content %}

{% if form.key.value() %}
<h3 class="govuk-heading-m">Update the variable: {{ form.display_key.value() }} - [{{ form.env_name.value() }}]</h3>
<h3 class="govuk-heading-m">Update Variable: {{ form.display_key.value() }} - [{{ form.env_name.value() }}]</h3>
{% else %}
<h3 class="govuk-heading-m">Add deployment an variable for the app - [{{ form.env_name.value() }}]</h3>
<h3 class="govuk-heading-m">Add environemnt variable - [{{ form.env_name.value() }}]</h3>
<p>Adding a suffix as part of the key is encouraged.</p>
{% endif %}
<section class="cpanel-section form-section" >
<p>Adding suffix as part of key is encourage.</p>
<div>
{% if form.errors %}
{{ govukErrorMessage({"text": form.errors}) }}
Expand Down
3 changes: 1 addition & 2 deletions controlpanel/frontend/jinja2/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{% set home_url = url("index") %}
{% set signout_url = url("oidc_logout") %}


{% block page_title %}
{{ page_title }} | {{ service_name }}
{% endblock %}
Expand Down Expand Up @@ -83,7 +84,6 @@
"text": "Home",
"href": home_url,
"active": page_name == "home",
"admin": request.user.is_superuser,
},
{
"hide": not request.user.is_staff,
Expand Down Expand Up @@ -116,7 +116,6 @@
"text": "Groups",
"href": url("list-policies"),
"active": page_name == "groups",
"admin": request.user.is_superuser,
},
{
"text": "Training",
Expand Down
4 changes: 2 additions & 2 deletions controlpanel/frontend/jinja2/customers-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 class="govuk-heading-s">
</section>

<h2 class="govuk-heading-s">
App customers under {{ groups_dict.get(group_id) }} environment
Customers under {{ groups_dict.get(group_id) }} environment
{{ modal_dialog(app_customers_html|safe) }}
</h2>

Expand Down Expand Up @@ -114,7 +114,7 @@ <h2 class="govuk-heading-s">
{{ csrf_input }}
<div class="govuk-form-group {% if errors and errors.customer_email %}govuk-form-group--error{% endif %}">
<label class="govuk-label" for="customer_email">
Add app customers by entering their email addresses (separated by spaces)
Add customers by entering their email addresses (separated by spaces)
</label>
{% if errors and errors.customer_email %}
{% for error in errors.customer_email %}
Expand Down
118 changes: 53 additions & 65 deletions controlpanel/frontend/jinja2/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,59 @@
{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">




<h1 class="govuk-heading-xl">Help</h1>

<p class="govuk-body">Common queries, support tasks and problems are
explained in the following videos.</p>

<p class="govuk-body">Should you still require help, please visit our
<a target="_blank" href="https://user-guidance.services.alpha.mojanalytics.xyz/#content">help and support documentation</a>.
If you encounter a technical issue with our infrastructure, please visit our
<a target="_blank" href="https://asdslack.slack.com/messages/C4PF7QAJZ#">support channel on Slack</a>.
Please remember to tell us your GitHub username and the name of any
affected S3 buckets or applications on the Analytical Platform that are
affected by the problem.</p>

<h2 class="govuk-heading-m">What is the Analytical Platform?</h2>

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/5467Hl3X9EI" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<p>Related links:</p>
<ul class="govuk-list govuk-list--bullet">
<li>The
<a target="_blank"
href="https://user-guidance.services.alpha.mojanalytics.xyz/get-started.html#get-started">getting started guide</a>
for new joiners.</li>
<li>Our
<a target="_blank"
href="https://user-guidance.services.alpha.mojanalytics.xyz/#content">help and support documentation</a>
for users of the platform.</li>
<li>A
<a target="_blank"
href="https://controlpanel.services.alpha.mojanalytics.xyz/">link to the platform</a> itself.</li>
</ul>

<h2 class="govuk-heading-m">Home Directory Reset</h2>

<p class="govuk-body">You need to reset your home directory if any of the
following applies:</p>

<ul class="govuk-list govuk-list--bullet">
<li>Your RStudio won't start.</li>
<li>Your Conda environment is a mess.</li>
<li>You need to start RStudio development from a clean state.</li>
</ul>

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/ziu8dWRRcVM" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<ol class="govuk-list govuk-list--number">
<li>From the <a href="{{ url("list-tools")}}">Analytic tools</a> page,
follow the link to <a href="{{ url('home-reset') }}">reset your home page</a>.</li>
<li>Read the information about what a home reset entails.</li>
<li>Enable the confirmation check-box and click the red "Reset" button.</li>
<li>You'll be returned to the Analytic tools page, but will see a
confirmation that the reset is underway.</li>
<li>Depending on the size of your home directory, this process can
take between seconds to a couple of minutes. Go make a coffee!</li>
<li>Finally, on the <a href="{{ url("list-tools")}}">Analytic tools</a>
page, click the "Restart" button for RStudio.</li>
<li>Give RStudio a few minutes to start up.</li>
</ol>



<h1 class="govuk-heading-xl">Help</h1>

<p class="govuk-body">Common questions, support tasks and issues are
addressed in the following videos.</p>

<p class="govuk-body">If you still require help, please visit our
<a target="_blank" href="https://user-guidance.services.alpha.mojanalytics.xyz/#content">help and support documentation</a>.
If you encounter a technical issue with our infrastructure, please raise a
<a target="_blank" href="https://github.com/ministryofjustice/data-platform-support/issues/new/choose">support ticket on Github</a>.
Please provide your GitHub username and the names of any
S3 buckets or applications on the Analytical Platform that are
impacted.</p>

<h2 class="govuk-heading-m">What is the Analytical Platform?</h2>

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/5467Hl3X9EI" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<p>Related links:</p>
<ul class="govuk-list govuk-list--bullet">
<li>The
<a target="_blank"
href="https://user-guidance.services.alpha.mojanalytics.xyz/get-started.html#get-started">getting started guide</a>
for new joiners.</li>
<li>Our
<a target="_blank"
href="https://user-guidance.services.alpha.mojanalytics.xyz/#content">help and support documentation</a>
for users of the platform.</li>
<li>A
<a target="_blank"
href="https://controlpanel.services.alpha.mojanalytics.xyz/">link to the platform</a> itself.</li>
</ul>

<h2 class="govuk-heading-m">Home Directory Reset</h2>

<p class="govuk-body">You need to reset your home directory if:</p>

<ul class="govuk-list govuk-list--bullet">
<li>Your RStudio won't start.</li>
<li>Your Conda environment needs resetting.</li>
<li>You need to start RStudio development from a clean state.</li>
</ul>

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/ziu8dWRRcVM" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<ol class="govuk-list govuk-list--number">
<li>From the <a href="{{ url("list-tools")}}">Analytical tools</a> page,
follow the link to <a href="{{ url('home-reset') }}">reset your home page</a>.</li>
<li>Read the information about what a home reset entails.</li>
<li>Enable the confirmation check-box and click the red "Reset" button.</li>
<li>You will be redirected back to the Analytical tools page, where you will see confirmation that the reset process has started.</li>
<li>Once your environment has been reset, click the "Restart" button for RStudio on the <a href="{{ url("list-tools")}}">Analytical tools</a> page.</li>
<li>Give RStudio time to start up.</li>
</ol>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/ip-allowlist-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

{% block content %}
<h1 class="govuk-heading-xl">{{ page_title }}</h1>
<h2>This ip_range are used by <b>{{ ip_allowlist.apps.count() }}</b> different deployment environments from all the apps</h2>
<h2>These IP ranges are used by <b>{{ ip_allowlist.apps.count() }}</b> different deployment environments across all apps</h2>
{% if form.errors %}
{{ govukErrorMessage({"text": form.errors}) }}
{% endif %}
Expand Down
12 changes: 6 additions & 6 deletions controlpanel/frontend/jinja2/reset.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
</div>
{% endif %}
<h1 class="govuk-heading-l">Home Directory Reset</h1>
<p>Even the best curated home directories can get into a bad
<p>Even the best curated home directories can get into an unusable
state (for example, a broken conda environment or Jupyter and RStudio won't
start).</p>

<p>Reset your home directory to recreate your conda environment and shell
settings to a clean state. This feature automates the
<a href="https://github.com/ministryofjustice/analytics-platform/wiki/Reset-your-R-Studio-environment">process described here</a>.</p>
<p>This feature automates the
<a href="https://github.com/ministryofjustice/analytics-platform/wiki/Reset-your-R-Studio-environment">process described here</a>. Make sure to save
any open files before resetting as you could lose any unsaved work.</p>

<div class="govuk-warning-text">
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
Expand All @@ -48,15 +48,15 @@ <h1 class="govuk-heading-l">Home Directory Reset</h1>
<fieldset class="govuk-fieldset govuk-!-padding-bottom-4">
{% if form.errors %}
<span id="confirm-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span>
<span class="govuk-visually-hidden">Error:</span>
Confirm you want to reset your home directory
</span>
{% endif %}
<div class="govuk-checkboxes">
<div class="govuk-checkboxes__item">
{{ form.confirm }}
<label class="govuk-label govuk-checkboxes__label">
{{ form.confirm.help_text }}
{{ form.confirm.help_text }}
</label>
</div>
</div>
Expand Down
17 changes: 4 additions & 13 deletions controlpanel/frontend/jinja2/tool-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="govuk-heading-xl">Your tools</h1>

<p class="govuk-body">The status of your tools will update automatically.</p>

<p class="govuk-body">If your tools get into a broken state, try
<p class="govuk-body">If your tools get into an unusable state, try
<a href="{{ url('home-reset') }}">resetting your home directory</a>.</p>

{% for chart_name, tool_info in tools_info.items() %}
Expand Down Expand Up @@ -110,9 +110,9 @@ <h2 class="govuk-heading-m">{{ tool_info.name }}</h2>
{% if deployment and deployment.tool_id == -1 %}
<div>
<p class="govuk-body">
Looks like your current deployment <b> ({{ deployment.chart_name}}-{{ deployment.chart_version }}: {{ deployment.image_tag }}) </b>
was not recognised within current maintained tool release versions, No worry you can still open it and have a look,
then feel free to switch one of versions from above dropdown list.
Your current deployment <b> ({{ deployment.chart_name}}-{{ deployment.chart_version }}: {{ deployment.image_tag }}) </b>
is not recognised as a current maintained tool release. You can still use it,
but it is recommended to switch to a new version from the dropdown list.
</p>
</div>
{% endif %}
Expand Down Expand Up @@ -145,15 +145,6 @@ <h2 class="govuk-heading-m">Airflow</h2>
</div>
<hr class="govuk-section-break govuk-section-break--visible govuk-!-margin-bottom-4">


<p class="govuk-body">
{% if env == "alpha" %}
You can <a href="https://grafana.services.{{ env }}.mojanalytics.xyz/d/platformusers/platform-users?refresh=10s&orgId=1&var-Username={{ request.user.username }}" target="_blank" rel="noopener">view your resource utilisation on Grafana (opens in new tab)</a>.
{% else %}
<em>(Grafana not available in {{ env }} environment)</em>
{% endif %}
</p>

<p class="govuk-body">
You can <a href="{{ aws_service_url }}" target="_blank" rel="noopener"> access AWS services such as S3 and Athena via the AWS Console (opens in new tab).</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/user-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2 class="govuk-heading-m govuk-error-summary-heading">
<strong>The user of this account has not logged in for over 90 days.</strong>
</p>

<p>If appropriate, please <a href="https://github.com/orgs/moj-analytical-services/people/{{ user.username }}" target="_blank">visit the GitHub page for their membership of the
<p>If necessary, please <a href="https://github.com/orgs/moj-analytical-services/people/{{ user.username }}" target="_blank">visit the GitHub page for their membership of the
Ministry of Justice organisation</a> to free up space.</p>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions controlpanel/frontend/jinja2/webapp-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ <h2 class="govuk-heading-m govuk-error-summary-heading">
Webapp repo setting
</h2>
<p>
<strong>Couldn't find/read the app's information from github repo based on the repo url, please
check whether the repo_url exists or whether you have enough permission to access this repo
<strong>Couldn't find/read the app's information from github based on the repo url, please
check whether the repo url exists or whether you have permission to access this repo
</strong>
</p>
<p>Raw error message: {{ repo_access_error_msg }}</p>
Expand Down Expand Up @@ -75,7 +75,7 @@ <h2 class="govuk-heading-m">App resources usage dashboard</h2>

<h2 class="govuk-heading-m">Deployment Pipeline</h2>
<p class="govuk-body"> Github workflows on app's repo are used for deploying the app.</p>
<p class="govuk-body"><strong>You are required to be member of admin team for this app repo in order to be able to maintain the deployments settings</strong></p>
<p class="govuk-body"><strong>You must be a member of the admin team for this app repo to be able to maintain the deployment settings</strong></p>

</header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<p>
If you would like to restrict access to your app to IP networks not covered by the allowlists given above,
contact the Analytical Platform team via our <a href="https://asdslack.slack.com/archives/C4PF7QAJZ">support Slack channel</a>.
contact the Analytical Platform team by raising a <a href="https://github.com/ministryofjustice/data-platform-support/issues/new/choose">support ticket on Github</a>.
</p>


Expand Down
1 change: 0 additions & 1 deletion controlpanel/frontend/static/components/navbar/macro.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<li class="moj-primary-navigation__item">
<a class="moj-primary-navigation__link" {{ 'aria-current="page"' | safe if item.active else '' }} href="{{ item.href }}" {%- for attribute, value in item.attributes -%} {{ attribute }}="{{ value }}"{% endfor %}>
{{- item.html | safe if item.html else item.text -}}
{% if item.admin %}&#128295;{% endif %}
</a>
</li>
{% endif -%}
Expand Down
6 changes: 3 additions & 3 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ AUTH0_NOMIS_GATEWAY_URL: "https://testing.com"


BROADCAST_MESSAGE: >
We are on the edge of hitting the limit of AWS S3 bucket (1000). | Before we implement the long term solution,
could you make sure you remove the buckets you do not need any more? also make sure not create more buckets than your need,
try to use sub-folders to manage different datasets rather than multiple buckets.
We are close to hitting the 1000 bucket limit on AWS. | Before we work on a long-term solution,
please delete any unnecessary buckets and avoid creating more than you need.
Consider using sub-folders to manage different datasets instead of multiple buckets.
GITHUB_VERSION: "2022-11-28"

Expand Down

0 comments on commit 7063301

Please sign in to comment.