Skip to content

Conversation

mkovalua
Copy link
Contributor

@mkovalua mkovalua commented Sep 11, 2025

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)

image

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

bp-cos and others added 16 commits September 4, 2025 16:16
* 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
bp-cos
bp-cos previously approved these changes Sep 11, 2025
Copy link
Contributor

@bp-cos bp-cos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

@mkovalua mkovalua changed the base branch from develop to main September 11, 2025 20:00
@mkovalua mkovalua dismissed bp-cos’s stale review September 11, 2025 20:00

The base branch was changed.

@mkovalua mkovalua force-pushed the feature/ENG-8780 branch 3 times, most recently from 0710605 to c4e31ce Compare September 11, 2025 21:33
Copy link
Collaborator

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],
Copy link
Collaborator

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:

Suggested change
imports: [FormsModule, CheckboxModule, ButtonModule, MessageModule, TranslateModule],
imports: [FormsModule, Checkbox, Button, Message, TranslateModule],

Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not confident about, TranslateModule is used all over the project

image

Copy link
Collaborator

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.

Comment on lines 217 to 221
"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",
Copy link
Collaborator

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.

Comment on lines 35 to 37
constructor(
private translateService: TranslateService,
) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use inject().

Suggested change
constructor(
private translateService: TranslateService,
) {}
private translateService = inject(TranslateService);

readonly actions = createDispatchMap({ acceptTermsOfServiceByUser: AcceptTermsOfServiceByUser });
readonly currentUser = select(UserSelectors.getCurrentUser);
acceptedTermsOfServiceChange = computed(() => {
return false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why here 2 return?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for testing purposes

@nsemets nsemets marked this pull request as ready for review September 12, 2025 15:51
@nsemets
Copy link
Collaborator

nsemets commented Sep 12, 2025

Merge main into your branch.

nsemets
nsemets previously approved these changes Sep 12, 2025
…service

Todo: try find a way how to convert acceptedTermsOfService to accepted_terms_of_service in updateUserProfile more generic with mappers
Copy link
Contributor

@bp-cos bp-cos left a 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 })
Copy link
Contributor

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
@bp-cos bp-cos added this pull request to the merge queue Sep 13, 2025
Merged via the queue into CenterForOpenScience:main with commit ad2675c Sep 13, 2025
1 of 3 checks passed

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image Did you have here a lint error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants