diff --git a/frontend/src/app/common/pipes/text-cleanup.pipe.spec.ts b/frontend/src/app/common/pipes/text-cleanup.pipe.spec.ts new file mode 100644 index 00000000..a3dceedd --- /dev/null +++ b/frontend/src/app/common/pipes/text-cleanup.pipe.spec.ts @@ -0,0 +1,8 @@ +import { TextCleanupPipe } from './text-cleanup.pipe'; + +describe('TextCleanupPipe', () => { + it('create an instance', () => { + const pipe = new TextCleanupPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/common/pipes/text-cleanup.pipe.ts b/frontend/src/app/common/pipes/text-cleanup.pipe.ts new file mode 100644 index 00000000..3e3b726c --- /dev/null +++ b/frontend/src/app/common/pipes/text-cleanup.pipe.ts @@ -0,0 +1,22 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'textCleanup', + standalone: true, +}) +export class TextCleanupPipe implements PipeTransform { + + transform(value: string, ...args: unknown[]): string { + let cleanedValue = value; + + cleanedValue = cleanedValue.trim(); + + if (cleanedValue.startsWith(',')) { + cleanedValue = cleanedValue.slice(1); + cleanedValue = cleanedValue.trim(); + } + + return cleanedValue; + } + +} diff --git a/frontend/src/app/features/components/listings-table/aggregated-listings-table/aggregated-listings-table.component.html b/frontend/src/app/features/components/listings-table/aggregated-listings-table/aggregated-listings-table.component.html index 7f5b8066..f5b86bf4 100644 --- a/frontend/src/app/features/components/listings-table/aggregated-listings-table/aggregated-listings-table.component.html +++ b/frontend/src/app/features/components/listings-table/aggregated-listings-table/aggregated-listings-table.component.html @@ -118,7 +118,7 @@

Aggregated Listings

{{ row.lastActionNm }} - {{ row.lastActionDtm |date }} + {{ row.lastActionDtm |date:'yyyy-MM-dd' }} {{ row.listings.length }} @@ -210,7 +210,7 @@

Aggregated Listings

{{ listing.lastActionNm }} - {{ listing.lastActionDtm |date }} + {{ listing.lastActionDtm |date:'yyyy-MM-dd' }} @@ -222,7 +222,7 @@

Aggregated Listings

- No listings matched your search. Please try again. + No listings matched your search. Please try again. diff --git a/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.html b/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.html index 0fdaa766..64c7e58e 100644 --- a/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.html +++ b/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.html @@ -104,7 +104,7 @@

Detailed Listing Information for

Address (Platform Listing): - {{listing.originalAddressTxt}} + {{listing.originalAddressTxt | textCleanup}}
Entire Unit? (Platform Listing): @@ -211,7 +211,7 @@

Detailed Listing Information for

{{ addressChange.type }} - {{ addressChange.platformAddress }} + {{ addressChange.platformAddress | textCleanup }} {{ addressChange.bestMatchAddress }} {{ addressChange.date |date:'yyyy-MM-dd' }} {{ addressChange.user }} @@ -243,7 +243,7 @@

Detailed Listing Information for

{{ actionHistory.action }} - {{ actionHistory.date |date}} + {{ actionHistory.date |date:'yyyy-MM-dd'}} {{ actionHistory.user }} diff --git a/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.ts b/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.ts index 78551bc3..866dedfb 100644 --- a/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.ts +++ b/frontend/src/app/features/components/listings-table/listing-details/listing-details.component.ts @@ -23,6 +23,7 @@ import { BusinessLicence } from '../../../../common/models/business-licence'; import { BusinessLicenceService } from '../../../../common/services/business-licence.service'; import { BLSearchResultRow } from '../../../../common/models/bl-search-result-row'; import { UrlProtocolPipe } from '../../../../common/pipes/url-protocol.pipe'; +import { TextCleanupPipe } from '../../../../common/pipes/text-cleanup.pipe'; @Component({ selector: 'app-listing-details', @@ -40,6 +41,7 @@ import { UrlProtocolPipe } from '../../../../common/pipes/url-protocol.pipe'; TooltipModule, TagModule, UrlProtocolPipe, + TextCleanupPipe, ], templateUrl: './listing-details.component.html', styleUrl: './listing-details.component.scss' diff --git a/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.html b/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.html index 07a350b7..53ffa98f 100644 --- a/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.html +++ b/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.html @@ -40,7 +40,7 @@

Manage Jurisdictions

- Update Local Government Information + Update Local Government Information
@@ -58,7 +58,7 @@

Manage Jurisdictions

{{jurisdiction.localGovernmentTypeNm || '-'}} {{jurisdiction.organizationCd || '-'}} {{jurisdiction.businessLicenceFormatTxt || '-'}} - + @@ -114,7 +114,7 @@

Manage Jurisdictions

- Update Jurisdiction Info + Update Jurisdiction Info @@ -125,7 +125,7 @@

Manage Jurisdictions

{{jurisdiction.isPrincipalResidenceRequired?'Yes':'No'}} {{jurisdiction.isStrProhibited?'Yes':'No'}} {{jurisdiction.isBusinessLicenceRequired?'Yes':'No'}} - +
diff --git a/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.ts b/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.ts index 51aa85e0..ca548e2c 100644 --- a/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.ts +++ b/frontend/src/app/features/components/manage-jurisdictions/manage-jurisdictions.component.ts @@ -9,6 +9,8 @@ import { CommonModule } from '@angular/common'; import { LocalGovernment } from '../../../common/models/jurisdiction'; import { PagingResponse, PagingResponsePageInfo } from '../../../common/models/paging-response'; import { GlobalLoaderService } from '../../../common/services/global-loader.service'; +import { UserDataService } from '../../../common/services/user-data.service'; +import { jurisdiction_write } from '../../../common/consts/permissions.const'; @Component({ selector: 'app-manage-jurisdictions', @@ -30,9 +32,11 @@ export class ManageJurisdictionsComponent implements OnInit { sort!: { prop: string; dir: 'asc' | 'desc' }; sortSub!: { prop: string; dir: 'asc' | 'desc' }; currentPage!: PagingResponsePageInfo; + canEdit = false; constructor( private organizationsService: OrganizationService, + private userService: UserDataService, private cd: ChangeDetectorRef, private router: Router, private loaderService: GlobalLoaderService, @@ -98,8 +102,6 @@ export class ManageJurisdictionsComponent implements OnInit { this.currentPage = result.pageInfo; this.jurisdictions = result.sourceList; - console.info('First jurisdiction', this.jurisdictions[0]); - this.cd.detectChanges(); }, complete: () => { @@ -115,6 +117,11 @@ export class ManageJurisdictionsComponent implements OnInit { } private init(): void { + this.canUserEditJurisdiction() this.getPlatforms(); } + + private canUserEditJurisdiction() { + this.canEdit = this.userService.currentUser.permissions.includes(jurisdiction_write); + } } diff --git a/frontend/src/app/features/components/manage-jurisdictions/update-jurisdiction-information/update-jurisdiction-information.component.html b/frontend/src/app/features/components/manage-jurisdictions/update-jurisdiction-information/update-jurisdiction-information.component.html index 9c7ede04..87a69fdf 100644 --- a/frontend/src/app/features/components/manage-jurisdictions/update-jurisdiction-information/update-jurisdiction-information.component.html +++ b/frontend/src/app/features/components/manage-jurisdictions/update-jurisdiction-information/update-jurisdiction-information.component.html @@ -22,7 +22,7 @@

Update Jurisdiction Information

- +
Detailed Platform Contact Information
- Email for Non-Compliance Notices: + Email(s) for Non-Compliance Notices: - {{platform.primaryNoticeOfTakedownContactEmail || '-'}} + @if(platform.primaryNoticeOfTakedownContactEmail && + platform.secondaryNoticeOfTakedownContactEmail){ + {{platform.primaryNoticeOfTakedownContactEmail}}, + {{platform.secondaryNoticeOfTakedownContactEmail}} + } @else { + {{platform.primaryNoticeOfTakedownContactEmail}}{{platform.secondaryNoticeOfTakedownContactEmail}} + } + + @if(!platform.primaryNoticeOfTakedownContactEmail && + !platform.secondaryNoticeOfTakedownContactEmail){ + - + } +
- Email for Takedown Request Letters: + Email(s) for Takedown Request Letters: - {{platform.primaryTakedownRequestContactEmail || '-'}} + @if(platform.primaryTakedownRequestContactEmail && + platform.secondaryTakedownRequestContactEmail){ + {{platform.primaryTakedownRequestContactEmail}}, + {{platform.secondaryTakedownRequestContactEmail}} + } @else { + {{platform.primaryTakedownRequestContactEmail}}{{platform.secondaryTakedownRequestContactEmail}} + } + + @if(!platform.primaryTakedownRequestContactEmail && + !platform.secondaryTakedownRequestContactEmail){ + - + }
@@ -99,15 +122,32 @@

Detailed Platform Contact Information

- Email for Non-Compliance Notices: + Email(s) for Non-Compliance Notices: - {{sub.primaryNoticeOfTakedownContactEmail || '-'}} + + @if(sub.primaryNoticeOfTakedownContactEmail && sub.secondaryNoticeOfTakedownContactEmail){ + {{sub.primaryNoticeOfTakedownContactEmail}}, {{sub.secondaryNoticeOfTakedownContactEmail}} + } @else { + {{sub.primaryNoticeOfTakedownContactEmail}}{{sub.secondaryNoticeOfTakedownContactEmail}} + } + + @if(!sub.primaryNoticeOfTakedownContactEmail && !sub.secondaryNoticeOfTakedownContactEmail){ + - + }
- Email for Takedown Request Letters: + Email(s) for Takedown Request Letters: - {{sub.primaryTakedownRequestContactEmail || '-'}} + @if(sub.primaryTakedownRequestContactEmail && sub.secondaryTakedownRequestContactEmail){ + {{sub.primaryTakedownRequestContactEmail}}, {{sub.secondaryTakedownRequestContactEmail}} + } @else { + {{sub.primaryTakedownRequestContactEmail}}{{sub.secondaryTakedownRequestContactEmail}} + } + + @if(!sub.primaryTakedownRequestContactEmail && !sub.secondaryTakedownRequestContactEmail){ + - + }
diff --git a/frontend/src/app/features/components/roles-list/role-details/role-details.component.scss b/frontend/src/app/features/components/roles-list/role-details/role-details.component.scss index 87749898..30a61baa 100644 --- a/frontend/src/app/features/components/roles-list/role-details/role-details.component.scss +++ b/frontend/src/app/features/components/roles-list/role-details/role-details.component.scss @@ -72,7 +72,6 @@ .permissions-container { margin-top: 24px; width: 100%; - height: 666px; border-radius: 4px; box-shadow: 0px 3.2px 7.2px 0px rgba(0, 0, 0, 0.23);