-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working on social consents * working on consent * added checkbox functionality (buggy) * almost there * feat(Testimonial): Ability to give consent on specific publication channels --------- Co-authored-by: Ubuntu <[email protected]> Co-authored-by: denbicloud <[email protected]>
- Loading branch information
1 parent
04c6345
commit d7c9bb2
Showing
6 changed files
with
121 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { SocialConsent } from 'app/shared/shared_modules/testimonial-forms/social-consent.model'; | ||
|
||
/** | ||
* Generic Pipe to check if element is in list. | ||
*/ | ||
@Pipe({ | ||
name: 'socialConsentGiven', | ||
}) | ||
export class SocialConsentGivenPipe implements PipeTransform { | ||
transform(list: SocialConsent[], value: SocialConsent): boolean { | ||
const idx: number = list.findIndex(consent => consent.id === value.id); | ||
if (idx !== -1) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/app/shared/shared_modules/testimonial-forms/social-consent.model.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,12 @@ | ||
/** | ||
* Social Consent class. | ||
*/ | ||
export class SocialConsent { | ||
id: number; | ||
name: string; | ||
description: string; | ||
|
||
constructor(socialConsent?: Partial<SocialConsent>) { | ||
Object.assign(this, socialConsent); | ||
} | ||
} |
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