mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
Merge branch 'main' into za/2927-blocked-from-starting-requests
This commit is contained in:
commit
6b91236f34
7 changed files with 48 additions and 51 deletions
66
.github/workflows/clone-staging.yaml
vendored
66
.github/workflows/clone-staging.yaml
vendored
|
@ -18,44 +18,30 @@ jobs:
|
||||||
clone-database:
|
clone-database:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
CF_USERNAME: CF_MS_USERNAME
|
CF_USERNAME: ${{ secrets.CF_MS_USERNAME }}
|
||||||
CF_PASSWORD: CF_MS_PASSWORD
|
CF_PASSWORD: ${{ secrets.CF_MS_PASSWORD }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Clone Database
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
# install cf cli and other tools
|
||||||
- name: Setup Python
|
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cli.cloudfoundry.org.gpg
|
||||||
uses: actions/setup-python@v5
|
echo "deb [signed-by=/usr/share/keyrings/cli.cloudfoundry.org.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
sudo apt-get update
|
||||||
cache: 'pip' # caching pip dependencies
|
sudo apt-get install cf8-cli postgresql-client-common
|
||||||
|
# install cg-manage-rds tool
|
||||||
- name: Install CG Tool
|
pip install git+https://github.com/cloud-gov/cg-manage-rds.git
|
||||||
run: pip install git+https://github.com/cloud-gov/cg-manage-rds.git
|
|
||||||
|
# Authenticate and target CF org and space.
|
||||||
- name: Share DB Service
|
cf api api.fr.cloud.gov
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
cf auth "$CF_USERNAME" "$CF_PASSWORD"
|
||||||
with:
|
cf target -o cisa-dotgov -s $DESTINATION_ENVIRONMENT
|
||||||
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
|
||||||
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
# share the target db with the source space
|
||||||
cf_org: cisa-dotgov
|
cf share-service getgov-$DESTINATION_ENVIRONMENT-database -s $SOURCE_ENVIRONMENT
|
||||||
cf_space: ${{ env.DESTINATION_ENVIRONMENT }}
|
|
||||||
cf_command: share-service getgov-${{ env.DESTINATION_ENVIRONMENT }}-database -s ${{ env.SOURCE_ENVIRONMENT }}
|
# clone from source to destination
|
||||||
|
cg-manage-rds clone getgov-$DESTINATION_ENVIRONMENT-database getgov-$SOURCE_ENVIRONMENT-database
|
||||||
- name: Clone Database
|
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
# unshare the service
|
||||||
with:
|
cf unshare-service getgov-$DESTINATION_ENVIRONMENT-database -s $SOURCE_ENVIRONMENT
|
||||||
cf_username: ${{ secrets.CF_MS_USERNAME }}
|
|
||||||
cf_password: ${{ secrets.CF_MS_PASSWORD }}
|
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ env.SOURCE_ENVIRONMENT }}
|
|
||||||
command: cg-manage-rds clone getgov-${{ env.SOURCE_ENVIRONMENT }}-database getgov-${{ env.DESTINATION_ENVIRONMENT }}-database
|
|
||||||
|
|
||||||
- name: Unshare DB Service
|
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
|
||||||
with:
|
|
||||||
cf_username: ${{ secrets.CF_MS_USERNAME }}
|
|
||||||
cf_password: ${{ secrets.CF_MS_PASSWORD }}
|
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ env.SOURCE_ENVIRONMENT }}
|
|
||||||
cf_command: unshare-service getgov-${{ env.DESTINATION_ENVIRONMENT }}-database -s ${{ env.SOURCE_ENVIRONMENT }}
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
{# hint: spacing in the class string matters #}
|
{# hint: spacing in the class string matters #}
|
||||||
class="{{ uswds_input_class }}{% if classes %} {{ classes }}{% endif %}"
|
class="{{ uswds_input_class }}{% if classes %} {{ classes }}{% endif %}"
|
||||||
{% if widget.value != None %}value="{{ widget.value|stringformat:'s' }}"{% endif %}
|
{% if widget.value != None %}value="{{ widget.value|stringformat:'s' }}"{% endif %}
|
||||||
|
{% if aria_label %}aria-label="{{ aria_label }} {{ label }}"{% endif %}
|
||||||
{% if sublabel_text %}aria-describedby="{{ widget.attrs.id }}__sublabel"{% endif %}
|
{% if sublabel_text %}aria-describedby="{{ widget.attrs.id }}__sublabel"{% endif %}
|
||||||
{% include "django/forms/widgets/attrs.html" %}
|
{% include "django/forms/widgets/attrs.html" %}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -63,11 +63,12 @@
|
||||||
|
|
||||||
<div class="grid-row margin-top-1">
|
<div class="grid-row margin-top-1">
|
||||||
<div class="grid-col">
|
<div class="grid-col">
|
||||||
<button type="button" class="usa-button usa-button--unstyled usa-button--with-icon float-right-tablet delete-record text-secondary line-height-sans-5">
|
<button type="button" id="button label" class="usa-button usa-button--unstyled usa-button--with-icon float-right-tablet delete-record text-secondary line-height-sans-5">
|
||||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||||
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
||||||
</svg>Delete
|
</svg>Delete
|
||||||
</button>
|
<span class="sr-only">DS data record {{forloop.counter}}</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
<div class="tablet:grid-col-5">
|
<div class="tablet:grid-col-5">
|
||||||
{% with sublabel_text="Example: 86.124.49.54 or 2001:db8::1234:5678" add_group_class="usa-form-group--unstyled-error" %}
|
{% with label_text=form.ip.label sublabel_text="Example: 86.124.49.54 or 2001:db8::1234:5678" add_group_class="usa-form-group--unstyled-error" add_aria_label="Name server "|concat:forloop.counter|concat:" "|concat:form.ip.label %}
|
||||||
{% input_with_errors form.ip %}
|
{% input_with_errors form.ip %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -56,6 +56,7 @@
|
||||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||||
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
||||||
</svg>Delete
|
</svg>Delete
|
||||||
|
<span class="sr-only">Name server {{forloop.counter}}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</svg>
|
</svg>
|
||||||
Reset
|
Reset
|
||||||
</button>
|
</button>
|
||||||
<label class="usa-sr-only" for="domain-requests__search-field">
|
<label id="domain-requests__search-label" class="usa-sr-only" for="domain-requests__search-field">
|
||||||
{% if portfolio %}
|
{% if portfolio %}
|
||||||
Search by domain name or creator
|
Search by domain name or creator
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
placeholder="Search by domain name"
|
placeholder="Search by domain name"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
/>
|
/>
|
||||||
<button class="usa-button" type="submit" id="domain-requests__search-field-submit">
|
<button class="usa-button" type="submit" id="domain-requests__search-field-submit" aria-labelledby="domain-requests__search-label">
|
||||||
<img
|
<img
|
||||||
src="{% static 'img/usa-icons-bg/search--white.svg' %}"
|
src="{% static 'img/usa-icons-bg/search--white.svg' %}"
|
||||||
class="usa-search__submit-icon"
|
class="usa-search__submit-icon"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</svg>
|
</svg>
|
||||||
Reset
|
Reset
|
||||||
</button>
|
</button>
|
||||||
<label class="usa-sr-only" for="domains__search-field">Search by domain name</label>
|
<label id="domains__search-label" class="usa-sr-only" for="domains__search-field">Search by domain name</label>
|
||||||
<input
|
<input
|
||||||
class="usa-input"
|
class="usa-input"
|
||||||
id="domains__search-field"
|
id="domains__search-field"
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
name="domains-search"
|
name="domains-search"
|
||||||
placeholder="Search by domain name"
|
placeholder="Search by domain name"
|
||||||
/>
|
/>
|
||||||
<button class="usa-button" type="submit" id="domains__search-field-submit">
|
<button class="usa-button" type="submit" id="domains__search-field-submit" aria-labelledby="domains__search-label">
|
||||||
<img
|
<img
|
||||||
src="{% static 'img/usa-icons-bg/search--white.svg' %}"
|
src="{% static 'img/usa-icons-bg/search--white.svg' %}"
|
||||||
class="usa-search__submit-icon"
|
class="usa-search__submit-icon"
|
||||||
|
|
|
@ -24,6 +24,7 @@ def input_with_errors(context, field=None): # noqa: C901
|
||||||
add_label_class: append to input element's label's `class` attribute
|
add_label_class: append to input element's label's `class` attribute
|
||||||
add_legend_class: append to input element's legend's `class` attribute
|
add_legend_class: append to input element's legend's `class` attribute
|
||||||
add_group_class: append to input element's surrounding tag's `class` attribute
|
add_group_class: append to input element's surrounding tag's `class` attribute
|
||||||
|
add_aria_label: append to input element's `aria_label` attribute
|
||||||
attr_* - adds or replaces any single html attribute for the input
|
attr_* - adds or replaces any single html attribute for the input
|
||||||
add_error_attr_* - like `attr_*` but only if field.errors is not empty
|
add_error_attr_* - like `attr_*` but only if field.errors is not empty
|
||||||
toggleable_input: shows a simple edit button, and adds display-none to the input field.
|
toggleable_input: shows a simple edit button, and adds display-none to the input field.
|
||||||
|
@ -55,6 +56,7 @@ def input_with_errors(context, field=None): # noqa: C901
|
||||||
label_classes = []
|
label_classes = []
|
||||||
legend_classes = []
|
legend_classes = []
|
||||||
group_classes = []
|
group_classes = []
|
||||||
|
aria_labels = []
|
||||||
|
|
||||||
# this will be converted to an attribute string
|
# this will be converted to an attribute string
|
||||||
described_by = []
|
described_by = []
|
||||||
|
@ -98,6 +100,9 @@ def input_with_errors(context, field=None): # noqa: C901
|
||||||
if "display-none" not in classes:
|
if "display-none" not in classes:
|
||||||
classes.append("display-none")
|
classes.append("display-none")
|
||||||
|
|
||||||
|
elif key == "add_aria_label":
|
||||||
|
aria_labels.append(value)
|
||||||
|
|
||||||
attrs["id"] = field.auto_id
|
attrs["id"] = field.auto_id
|
||||||
|
|
||||||
# do some work for various edge cases
|
# do some work for various edge cases
|
||||||
|
@ -151,7 +156,10 @@ def input_with_errors(context, field=None): # noqa: C901
|
||||||
# ensure we don't overwrite existing attribute value
|
# ensure we don't overwrite existing attribute value
|
||||||
if "aria-describedby" in attrs:
|
if "aria-describedby" in attrs:
|
||||||
described_by.append(attrs["aria-describedby"])
|
described_by.append(attrs["aria-describedby"])
|
||||||
attrs["aria-describedby"] = " ".join(described_by)
|
attrs["aria_describedby"] = " ".join(described_by)
|
||||||
|
|
||||||
|
if aria_labels:
|
||||||
|
context["aria_label"] = " ".join(aria_labels)
|
||||||
|
|
||||||
# ask Django to give us the widget dict
|
# ask Django to give us the widget dict
|
||||||
# see Widget.get_context() on
|
# see Widget.get_context() on
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue