-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: differentiate data offer UI for on request asset (#240)
- Loading branch information
Showing
18 changed files
with
224 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,21 @@ export namespace TestAssets { | |
This is a short description text that should be fully rendered without being **collapsed**. No *show more* button should be visible. | ||
`; | ||
|
||
export const onRequestAsset: UiAsset = { | ||
dataSourceAvailability: 'ON_REQUEST', | ||
assetId: 'comfee-or', | ||
title: 'Comfee OR', | ||
description: '', | ||
descriptionShortText: '', | ||
connectorEndpoint: 'https://my-other-connector/api/dsp', | ||
participantId: 'MDSL1234XX.C1234XX', | ||
creatorOrganizationName: 'my-org', | ||
temporalCoverageFrom: new Date('2024-01-01'), | ||
onRequestContactEmail: '[email protected]', | ||
onRequestContactEmailSubject: "Request for asset 'comfee-or'", | ||
isOwnConnector: false, | ||
}; | ||
|
||
export const boring: UiAsset = { | ||
assetId: 'data-sample-ckd-skd-demands-2023-Jan', | ||
title: 'data-sample-ckd-skd-demands-2023-Jan', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
authority-portal-frontend/src/app/core/services/mailto-link-builder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {Injectable} from '@angular/core'; | ||
import {removeUndefinedValues} from '../utils/record-utils'; | ||
|
||
@Injectable({providedIn: 'root'}) | ||
export class MailtoLinkBuilder { | ||
private readonly MAILTO = 'mailto:'; | ||
|
||
constructor() {} | ||
|
||
buildMailtoUrl( | ||
email: string, | ||
subject?: string, | ||
body?: string, | ||
cc?: string, | ||
bcc?: string, | ||
): string { | ||
const queryParams = new URLSearchParams( | ||
removeUndefinedValues({ | ||
subject, | ||
body, | ||
cc, | ||
bcc, | ||
}), | ||
); | ||
// URLSearchParams replaces spaces with '+', so we need to replace them with '%20' for the mail scenario | ||
const queryParamsStr = queryParams.toString().replaceAll('+', '%20'); | ||
const queryStr = queryParamsStr ? `?${queryParamsStr}` : ''; | ||
|
||
return `${this.MAILTO}${email}${queryStr}`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.