Skip to content

Commit

Permalink
18653, 18380 - Affiliation REQUEST - update email templates, wording …
Browse files Browse the repository at this point in the history
…on labels, remove paging from api call. (#2645)
  • Loading branch information
hfekete authored Nov 23, 2023
1 parent 4dd20d1 commit a51b1c6
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 33 deletions.
8 changes: 0 additions & 8 deletions auth-api/src/auth_api/models/dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ class Activity:
actor_id: Optional[int] = None


@dataclass
class PaginationInfo:
"""Used for providing pagination info."""

page: int
limit: int


@dataclass
class AffiliationInvitationSearch: # pylint: disable=too-many-instance-attributes
"""Used for searching Affiliation Invitations."""
Expand Down
9 changes: 4 additions & 5 deletions auth-api/src/auth_api/models/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from auth_api.exceptions import BusinessException
from auth_api.exceptions.errors import Error
from auth_api.models.affiliation import Affiliation
from auth_api.models.dataclass import OrgSearch, PaginationInfo
from auth_api.models.dataclass import OrgSearch
from auth_api.utils.enums import AccessType, InvitationStatus, InvitationType
from auth_api.utils.enums import OrgStatus as OrgStatusEnum
from auth_api.utils.enums import OrgType as OrgTypeEnum
Expand Down Expand Up @@ -161,7 +161,6 @@ def search_org(cls, search: OrgSearch, environment: str):
@classmethod
def search_orgs_by_business_identifier(cls,
business_identifier,
pagination_info: PaginationInfo,
environment,
excluded_org_types: List[str] = None
):
Expand All @@ -173,10 +172,10 @@ def search_orgs_by_business_identifier(cls,
if excluded_org_types:
query = query.filter(Org.type_code.notin_(excluded_org_types))

pagination = query.order_by(Org.name.desc()) \
.paginate(per_page=pagination_info.limit, page=pagination_info.page)
query = query.order_by(Org.name.desc())

return pagination.items, pagination.total
items = query.all()
return items, len(items)

@classmethod
def _search_by_business_identifier(cls, query, business_identifier, environment):
Expand Down
7 changes: 1 addition & 6 deletions auth-api/src/auth_api/resources/v1/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from auth_api.models import Org as OrgModel
from auth_api.models.dataclass import Affiliation as AffiliationData
from auth_api.models.dataclass import DeleteAffiliationRequest
from auth_api.models.dataclass import PaginationInfo # noqa: I005; Not sure why isort doesn't like this
from auth_api.models.org import OrgSearch # noqa: I005; Not sure why isort doesn't like this
from auth_api.schemas import InvitationSchema, MembershipSchema
from auth_api.schemas import utils as schema_utils
Expand Down Expand Up @@ -392,14 +391,10 @@ def post_organization_affiliation(org_id):
def get_org_details_by_affiliation(business_identifier):
"""Search non staff orgs by BusinessIdentifier and return org Name, branch Name and UUID."""
environment = get_request_environment()
pagination_info = PaginationInfo(
limit=int(request.args.get('limit', 10)),
page=int(request.args.get('page', 1))
)
excluded_org_types = [OrgType.STAFF.value, OrgType.SBC_STAFF.value]
try:
data = OrgService.search_orgs_by_affiliation(
business_identifier, pagination_info, environment, excluded_org_types
business_identifier, environment, excluded_org_types
)

org_details = \
Expand Down
7 changes: 2 additions & 5 deletions auth-api/src/auth_api/services/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from sbc_common_components.tracing.service_tracing import ServiceTracing # noqa: I001

from auth_api import status as http_status
from auth_api.models.dataclass import Activity, DeleteAffiliationRequest, PaginationInfo
from auth_api.models.dataclass import Activity, DeleteAffiliationRequest
from auth_api.exceptions import BusinessException
from auth_api.exceptions.errors import Error
from auth_api.models import AccountLoginOptions as AccountLoginOptionsModel
Expand Down Expand Up @@ -731,20 +731,17 @@ def search_orgs(search: OrgSearch, environment): # pylint: disable=too-many-loc

@staticmethod
def search_orgs_by_affiliation(
business_identifier, pagination_info: PaginationInfo, environment, excluded_org_types
business_identifier, environment, excluded_org_types
):
"""Search for orgs based on input parameters."""
orgs, total = OrgModel.search_orgs_by_business_identifier(
business_identifier,
pagination_info,
environment,
excluded_org_types
)

return {
'orgs': orgs,
'page': pagination_info.page,
'limit': pagination_info.limit,
'total': total
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>

<div v-else-if="!isLoading && accounts && accounts.length > 0">
<span>Select the account you want to perform Registries activities for <strong>{{ businessName }}</strong></span>
<span>Select an account:</span>
<v-select
id="account-authorization-request-request-account-select"
v-model="selectedAccount"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@
v-model="requestAuthBusinessOption"
>
<template #activator>
<v-list-item-title>Request authorization from the business</v-list-item-title>
<v-list-item-title>
Request authorization from an account currently managing the business
</v-list-item-title>
</template>
<div class="list-body">
<AccountAuthorizationRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Attention **{{ account }}**.
**Attention {{ account }}**

Your BC Registries and Online Services account is listed as the account managing **{{ business_name }}**.

Expand All @@ -14,7 +14,7 @@
{% endif %}
Go to {{ business_name }} to respond to this request:

[Log in to your BC Registries Dashboard]({{ url }})
**[Log in to your BC Registries Dashboard]({{ url }})**

Only authorize this account if you recognize it.

Expand All @@ -33,5 +33,5 @@
**Business Registry**
BC Registries and Online Services
Toll Free: [1-877-526-1526](1-877-526-1526)
Victoria Office:
Victoria Office: [250-387-7848](250-387-7848)
Email: [BCRegistries@gov.bc.ca](BCRegistries@gov.bc.ca)
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Attention {{ requesting_account }}
**Attention {{ requesting_account }}**

{% if is_authorized %}
Your BC Registries and Online Services account is now authorized to manage {{ business_name }}.

To manage this business now, [Log in to your BC Registries Dashboard]({{ url }})
To manage this business now, **[Log in to your BC Registries Dashboard]({{ url }})**
{% else %}
Your request to manage {{ business_name }} has been declined.

To change your request or make a new request to manage this business, [log in to your BC Registries Dashboard]({{ url }})
To change your request or make a new request to manage this business, **[log in to your BC Registries Dashboard]({{ url }})**
{% endif %}
___
**Business Registry**
BC Registries and Online Services
Toll Free: [1-877-526-1526](1-877-526-1526)
Victoria Office:
Victoria Office: [250-387-7848](250-387-7848)
Email: [BCRegistries@gov.bc.ca](BCRegistries@gov.bc.ca)

0 comments on commit a51b1c6

Please sign in to comment.