-
Notifications
You must be signed in to change notification settings - Fork 15
[ENG-8770] Add TOS Banner to angular-osf #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Fix/improvements (CenterForOpenScience#319) * fix(meetings): fixed meetings small issues * fix(tooltips): added tooltips * fix(table): updated sorting * fix(settings): fixed update project * fix(bookmarks): updated bookmarks * fix(my-registrations): fixed my registrations * fix(developer-apps): fixed developer apps * fix(settings): updated tokens and notifications * fix(translation): removed dot * fix(info-icon): updated info icon translate * fix(profile-settings): fixed profile settings * fix(test): updated tests * fix(settings): updated settings * fix(user-emails): updated adding emails to user account * fix(tests): updated tests * fix(clean-up): clean up * fix(models): updated models * fix(models): updated region and license models * fix(styles): moved styles from assets * fix(test): fixed institution loading and test for view only link * fix(analytics): added check if is public * fix(analytics): updated analytics feature * fix(analytics): show message when data loaded * fix(view-only-links): updated view only links * fix(view only links): added shared components * fix(tests): fixed tests * fix(unit-tests): updated jest config * fix(view-only-links): update view only links for components * fix(create-view-link): added logic for uncheck --------- Co-authored-by: Nazar Semets <nazar690@gmail.com> * Test/387 settings page tokens (CenterForOpenScience#318) * test(tokens): added new tests * test(tokens): added new unit tests * test(tokens): fixed tests and jest.config * test(tokens): fixed pr comments * Fix - Search (CenterForOpenScience#286) * feat(search): added generic search component * feat(search): improved search for institutions * feat(search): remove unused files * feat(search): fixed some issues * fix(search): removed comments * fix(profile): renamed it to profile * fix(updates): updates * fix(branding): Minor fixed regarding provider hero for preprints and registry * refactor(search-results-container): Encapsulated some logic, reduced duplication * refactor(search-results-container): Encapsulated tabs logic * refactor(search): Refactored partly search section for preprints and profile * refactor(search): Refactored search logic for global, institutions page, registrations page search * refactor(search): Refactored search logic for global, institutions page, registrations page search * refactor(search): Refactored search logic for profile * feat(profile): Implemented my-profile and user/:id pages * refactor(preprint-provider-discover): Removed search section that uses old approach * refactor(search): Create shared component that encapsulates search logic and reused across the app * refactor(shared-search): Extracted state model. Reduced duplications. Fixed IndexValueSearch filters * refactor(search): Using ResourceType instead of ResourceTab. Fixed params for index-value-search * refactor(search-models): Cleaned up models - renamed files, moved models to appropriate locations * refactor(index-card-search): Refactored models * fix(resource-card): Fixed resource-card component * fix(resource-card-secondary-metadata): Fixed resource-card component * fix(search): Fixed PR comments and conflicts after merge * refactor(search): Renamed OsfSearch- to GlobalSearch- * fix(unit-tests): fixed unit tests --------- Co-authored-by: volodyayakubovskyy <vyakubovskyy477@gmail.com> Co-authored-by: nsemets <nsemets@exoft.net> * Fix/557 missing tooltip (CenterForOpenScience#320) * fix(tooltip): added tooltip to next button * fix(emails): fixed emails bug * chore(test-env): added test env (CenterForOpenScience#321) * Chore/test docs added more docs and updated docs in the ever expanding evolution. (CenterForOpenScience#309) * chore(testing-docs): incremental update to the testing docs * chore(diagram): updated the ngx application diagram * chore(indexes): added indexes to all files * docs(updates): added new docs and explanations * chore(pr-updates): updated the files based on pr feedback --------- Co-authored-by: nsemets <nsemets@exoft.net> Co-authored-by: Nazar Semets <nazar690@gmail.com> Co-authored-by: dinlvkdn <104976612+dinlvkdn@users.noreply.github.com> Co-authored-by: rrromchIk <90086332+rrromchIk@users.noreply.github.com> Co-authored-by: volodyayakubovskyy <vyakubovskyy477@gmail.com>
…enterForOpenScience#308) * feat(datacite-tracker): implemented datacite view tracking for registries and preprints * chore(datacite-tracker): refactored doi extraction to be less repetitive * fix(datacite-tracker): reverted undesired refactor * chore(datacite-tracker): added tests to registry component * fix(datacite-tracker): fixed datacite tracker effect * chore(datacite-tracker): added tests to project and preprint components
… rearrange title and description layout (CenterForOpenScience#304) * feat(registries): add context to registration submission + rearrange layout * feat(registries): CR followup * feat(registries): Add test for TagsComponent * feat(registries): Add moar tests * feat(registries): CR followup
…Registries, Preprints url banners if user have not created any project for home (/dashboard) tab (CenterForOpenScience#301) * Show Osf introduction video and Collections,Institutions, Registries, Preprints url banners if user have not created any project for home (/dashboard) tab * 1. add translations 2. add loading ( <osf-loading-spinner/>) - otherwise interface show video and afterward search (shown in details in github PR 301 video) 3. maybe there is better solution for existsProjects() || cd angular-osfsearchControl?.value?.length to check if user has at least one project * align footer content left * use angular routerLink approach for <a> * add margin bottom for Visit button to look it better on resizing * update footer formatting * fix(dashboard): Fix [WARNING] NG8107 * fix(dashboard): remove not used variable * fix(dashboard): fix code format by running "npm run lint:fix && npm run format" * fix(dashboard): use .png names without guid * implement unit testing for dashboard when there is a project and there is no project * remove redundant footer RPCB and RCP links * move dashboard images alt text to en.json * add test for openInfoLink() * update(dashboard): use dashboard.data for mocking * update(dashboard): add test to show that products footer images no exists on spinner run and are rendering after it finished running * fix(dashboard): npm run lint:fix && npm run format * add missing code for dashboard * remove redundant imports for dashboard test * use providers -> useValue mock approach for dashboard * resolve CR comments
* Fix/improvements (CenterForOpenScience#319) * fix(meetings): fixed meetings small issues * fix(tooltips): added tooltips * fix(table): updated sorting * fix(settings): fixed update project * fix(bookmarks): updated bookmarks * fix(my-registrations): fixed my registrations * fix(developer-apps): fixed developer apps * fix(settings): updated tokens and notifications * fix(translation): removed dot * fix(info-icon): updated info icon translate * fix(profile-settings): fixed profile settings * fix(test): updated tests * fix(settings): updated settings * fix(user-emails): updated adding emails to user account * fix(tests): updated tests * fix(clean-up): clean up * fix(models): updated models * fix(models): updated region and license models * fix(styles): moved styles from assets * fix(test): fixed institution loading and test for view only link * fix(analytics): added check if is public * fix(analytics): updated analytics feature * fix(analytics): show message when data loaded * fix(view-only-links): updated view only links * fix(view only links): added shared components * fix(tests): fixed tests * fix(unit-tests): updated jest config * fix(view-only-links): update view only links for components * fix(create-view-link): added logic for uncheck --------- Co-authored-by: Nazar Semets <nazar690@gmail.com> * Test/387 settings page tokens (CenterForOpenScience#318) * test(tokens): added new tests * test(tokens): added new unit tests * test(tokens): fixed tests and jest.config * test(tokens): fixed pr comments * Fix - Search (CenterForOpenScience#286) * feat(search): added generic search component * feat(search): improved search for institutions * feat(search): remove unused files * feat(search): fixed some issues * fix(search): removed comments * fix(profile): renamed it to profile * fix(updates): updates * fix(branding): Minor fixed regarding provider hero for preprints and registry * refactor(search-results-container): Encapsulated some logic, reduced duplication * refactor(search-results-container): Encapsulated tabs logic * refactor(search): Refactored partly search section for preprints and profile * refactor(search): Refactored search logic for global, institutions page, registrations page search * refactor(search): Refactored search logic for global, institutions page, registrations page search * refactor(search): Refactored search logic for profile * feat(profile): Implemented my-profile and user/:id pages * refactor(preprint-provider-discover): Removed search section that uses old approach * refactor(search): Create shared component that encapsulates search logic and reused across the app * refactor(shared-search): Extracted state model. Reduced duplications. Fixed IndexValueSearch filters * refactor(search): Using ResourceType instead of ResourceTab. Fixed params for index-value-search * refactor(search-models): Cleaned up models - renamed files, moved models to appropriate locations * refactor(index-card-search): Refactored models * fix(resource-card): Fixed resource-card component * fix(resource-card-secondary-metadata): Fixed resource-card component * fix(search): Fixed PR comments and conflicts after merge * refactor(search): Renamed OsfSearch- to GlobalSearch- * fix(unit-tests): fixed unit tests --------- Co-authored-by: volodyayakubovskyy <vyakubovskyy477@gmail.com> Co-authored-by: nsemets <nsemets@exoft.net> * Fix/557 missing tooltip (CenterForOpenScience#320) * fix(tooltip): added tooltip to next button * fix(emails): fixed emails bug * chore(test-env): added test env (CenterForOpenScience#321) * Chore/test docs added more docs and updated docs in the ever expanding evolution. (CenterForOpenScience#309) * chore(testing-docs): incremental update to the testing docs * chore(diagram): updated the ngx application diagram * chore(indexes): added indexes to all files * docs(updates): added new docs and explanations * chore(pr-updates): updated the files based on pr feedback * Fix/registrations (CenterForOpenScience#326) * fix(settings): updated settings routes * fix(registry-links): updated registry links * fix(registration): updated components, resource and links * fix(wiki): updated wiki * fix(redirect-link): removed it (CenterForOpenScience#327) * [ENG-8505] Finished adding the GFP to the files page (CenterForOpenScience#325) * feat(eng-8505): Added the initial google drive button * feat(eng-8505): add the accountid with tests * feat(more-tests): updated tests * feat(eng-8505): updates for tests * feat(eng-8505): finishing updates for the google file picker * chore(test fixes): updates to broken tests * chore(pr updates): add updates based on pr feedback and more docs --------- Co-authored-by: Nazar Semets <nazar690@gmail.com> Co-authored-by: dinlvkdn <104976612+dinlvkdn@users.noreply.github.com> Co-authored-by: rrromchIk <90086332+rrromchIk@users.noreply.github.com> Co-authored-by: volodyayakubovskyy <vyakubovskyy477@gmail.com> Co-authored-by: Lord Business <113387478+bp-cos@users.noreply.github.com>
* chore(meta-tags): cleaner meta-tag cleanup (without urls) * chore(meta-tags): add full name to contributor tag * feat(meta-tags): add meta tags to file-detail page * fix(meta-tags): use image that exists
e957f6c
to
fee9e8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
0710605
to
c4e31ce
Compare
c4e31ce
to
47bb32f
Compare
src/app/features/home/pages/tos-consent-banner/tos-consent-banner.component.html
Outdated
Show resolved
Hide resolved
src/app/features/home/pages/tos-consent-banner/tos-consent-banner.component.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code formatted with npm run format
?
|
||
@Component({ | ||
selector: 'osf-tos-consent-banner', | ||
imports: [FormsModule, CheckboxModule, ButtonModule, MessageModule, TranslateModule], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use modules for primeng elements:
imports: [FormsModule, CheckboxModule, ButtonModule, MessageModule, TranslateModule], | |
imports: [FormsModule, Checkbox, Button, Message, TranslateModule], | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use TranslatePipe and TranslateService instead of TranslateModule
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use it separate: TranslateService
and TranslatePipe
, because we use standalone components.
src/app/features/home/pages/tos-consent-banner/tos-consent-banner.component.ts
Outdated
Show resolved
Hide resolved
src/app/features/home/pages/tos-consent-banner/tos-consent-banner.component.ts
Outdated
Show resolved
Hide resolved
src/assets/i18n/en.json
Outdated
"paragraphPath1": "Notice: We've updated our ", | ||
"paragraphPath2": " terms of use ", | ||
"paragraphPath3": " and ", | ||
"paragraphPath4": " privacy policy.", | ||
"haveReadAndAgree": "I've read and agree to the terms and conditions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be combined into one? Also it needs better naming.
cdbdfc2
to
a5207f5
Compare
constructor( | ||
private translateService: TranslateService, | ||
) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use inject()
.
constructor( | |
private translateService: TranslateService, | |
) {} | |
private translateService = inject(TranslateService); |
readonly actions = createDispatchMap({ acceptTermsOfServiceByUser: AcceptTermsOfServiceByUser }); | ||
readonly currentUser = select(UserSelectors.getCurrentUser); | ||
acceptedTermsOfServiceChange = computed(() => { | ||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why here 2 return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for testing purposes
Merge main into your branch. |
…service Todo: try find a way how to convert acceptedTermsOfService to accepted_terms_of_service in updateUserProfile more generic with mappers
91d41bb
to
26e0fed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found ot
// .updateUserProfile(currentUser.id, ProfileSettingsKey.User, apiRequest) | ||
|
||
return this.userService | ||
.updateUserProfile(currentUser.id, ProfileSettingsKey.User, { acceptedTermsOfService: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the problem
…service in more generic way with mappers and separate API method call
ad2675c
|
||
updateUserProfile(userId: string, key: string, data: ProfileSettingsUpdate): Observable<User> { | ||
const patchedData = key === ProfileSettingsKey.User ? data : { [key]: data }; | ||
let data_formatted = ProfileSettingsKey.User && data.hasOwnProperty('acceptedTermsOfService') ? {accepted_terms_of_service: true} : data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purpose
TOS consent banners are found in the TosConsentBanner component in ember-osf-web. It's a static banner that shows if they haven't acknowledged the banner. It shows if the user is authenticated but has not accepted the terms of service. You can check the user record for the attribute accepted_terms_of_service. If it’s true, don’t show the banner. If the user accepts the terms of service in the banner, set the user’s accepted_terms_of_service to true.
Text for the banner is:
tos_consent:
paragraph: 'We''ve updated our Terms of Use and Privacy Policy.'
have_read_and_agree: 'I’ve read and agree to the terms and conditions.'
continue: Continue
failed_save: 'We were unable to save your consent.''
Summary of Changes
Screenshot(s)
Side Effects
QA Notes
On user creation there is already checkbox to accept terms of service
https://centerforopenscience.slack.com/archives/C0812ETQQF2/p1757685236343919?thread_ts=1757617475.916129&cid=C0812ETQQF2