mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 18:56:15 +02:00
Merge pull request #3150 from cisagov/za/lint-2737
[BUGFIX] Fix failing linter + fix javascript bug (failing js on pages) - [MEOWARD]
This commit is contained in:
commit
3a4ba383eb
7 changed files with 18 additions and 27 deletions
|
@ -2925,7 +2925,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
const selectParent = select?.parentElement;
|
||||
const suborgContainer = document.getElementById("suborganization-container");
|
||||
const suborgDetailsContainer = document.getElementById("suborganization-container__details");
|
||||
const subOrgCreateNewOption = document.getElementById("option-to-add-suborg").value
|
||||
const subOrgCreateNewOption = document.getElementById("option-to-add-suborg")?.value;
|
||||
// Make sure all crucial page elements exist before proceeding.
|
||||
// This more or less ensures that we are on the Requesting Entity page, and not elsewhere.
|
||||
if (!radios || !select || !selectParent || !suborgContainer || !suborgDetailsContainer) return;
|
||||
|
|
|
@ -2,7 +2,12 @@ from django.db import models
|
|||
from django.forms import ValidationError
|
||||
from registrar.models.user_domain_role import UserDomainRole
|
||||
from registrar.utility.waffle import flag_is_active_for_user
|
||||
from registrar.models.utility.portfolio_helper import UserPortfolioPermissionChoices, UserPortfolioRoleChoices, DomainRequestPermissionDisplay, MemberPermissionDisplay
|
||||
from registrar.models.utility.portfolio_helper import (
|
||||
UserPortfolioPermissionChoices,
|
||||
UserPortfolioRoleChoices,
|
||||
DomainRequestPermissionDisplay,
|
||||
MemberPermissionDisplay,
|
||||
)
|
||||
from .utility.time_stamped_model import TimeStampedModel
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
|
||||
|
@ -115,7 +120,7 @@ class UserPortfolioPermission(TimeStampedModel):
|
|||
UserPortfolioPermissionChoices.VIEW_ALL_REQUESTS,
|
||||
UserPortfolioPermissionChoices.EDIT_REQUESTS,
|
||||
]
|
||||
|
||||
|
||||
if all(perm in all_permissions for perm in all_domain_perms):
|
||||
return DomainRequestPermissionDisplay.VIEWER_REQUESTER
|
||||
elif UserPortfolioPermissionChoices.VIEW_ALL_REQUESTS in all_permissions:
|
||||
|
|
|
@ -51,6 +51,7 @@ class DomainRequestPermissionDisplay(StrEnum):
|
|||
- VIEWER: "Viewer"
|
||||
- NONE: "None"
|
||||
"""
|
||||
|
||||
VIEWER_REQUESTER = "Viewer Requester"
|
||||
VIEWER = "Viewer"
|
||||
NONE = "None"
|
||||
|
@ -64,6 +65,7 @@ class MemberPermissionDisplay(StrEnum):
|
|||
- VIEWER: "Viewer"
|
||||
- NONE: "None"
|
||||
"""
|
||||
|
||||
MANAGER = "Manager"
|
||||
VIEWER = "Viewer"
|
||||
NONE = "None"
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block form_fields %}
|
||||
<input id="option-to-add-suborg" value="Other (enter your suborganization manually)"/>
|
||||
{% comment %}
|
||||
Store the other option in a variable to be used by the js function handleRequestingEntity.
|
||||
Injected into the 'sub_organization' option list.
|
||||
{% endcomment %}
|
||||
<input id="option-to-add-suborg" class="display-none" value="Other (enter your suborganization manually)"/>
|
||||
<fieldset class="usa-fieldset">
|
||||
<legend>
|
||||
<h2>Who will use the domain you’re requesting?</h2>
|
||||
|
|
|
@ -198,8 +198,8 @@ class BaseExport(ABC):
|
|||
|
||||
# We can infer that if we're passing in annotations,
|
||||
# we want to grab the result of said annotation.
|
||||
if computed_fields :
|
||||
related_table_fields.extend(computed_fields .keys())
|
||||
if computed_fields:
|
||||
related_table_fields.extend(computed_fields.keys())
|
||||
|
||||
# Get prexisting fields on the model
|
||||
model_fields = set()
|
||||
|
@ -263,25 +263,6 @@ class BaseExport(ABC):
|
|||
def get_model_annotation_dict(cls, **kwargs):
|
||||
return convert_queryset_to_dict(cls.get_annotated_queryset(**kwargs), is_model=False)
|
||||
|
||||
@classmethod
|
||||
def export_data_to_csv(cls, csv_file, **kwargs):
|
||||
"""
|
||||
All domain metadata:
|
||||
Exports domains of all statuses plus domain managers.
|
||||
"""
|
||||
writer = csv.writer(csv_file)
|
||||
columns = cls.get_columns()
|
||||
models_dict = cls.get_model_annotation_dict(**kwargs)
|
||||
|
||||
# Write to csv file before the write_csv
|
||||
cls.write_csv_before(writer, **kwargs)
|
||||
|
||||
# Write the csv file
|
||||
rows = cls.write_csv(writer, columns, models_dict)
|
||||
|
||||
# Return rows that for easier parsing and testing
|
||||
return rows
|
||||
|
||||
@classmethod
|
||||
def write_csv(
|
||||
cls,
|
||||
|
|
|
@ -49,6 +49,7 @@ class DefaultUserValues(StrEnum):
|
|||
- SYSTEM: "System" <= Default username
|
||||
- UNRETRIEVED: "Unretrieved" <= Default email state
|
||||
"""
|
||||
|
||||
HELP_EMAIL = "help@get.gov"
|
||||
SYSTEM = "System"
|
||||
UNRETRIEVED = "Unretrieved"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from django.http import JsonResponse
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models import Value, F, CharField, TextField, Q, Case, When, OuterRef, Subquery
|
||||
from django.db.models.expressions import Func
|
||||
from django.db.models.functions import Cast, Coalesce, Concat
|
||||
from django.contrib.postgres.aggregates import ArrayAgg
|
||||
from django.urls import reverse
|
||||
|
@ -214,4 +213,3 @@ class PortfolioMembersJson(PortfolioMembersPermission, View):
|
|||
"svg_icon": ("visibility" if view_only else "settings"),
|
||||
}
|
||||
return member_json
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue