Skip to content

Commit 8425b10

Browse files
rnastyuknsemetsmfraezznmykhalkevch-exoftbp-cos
authored
Fix/addons - Connect/configure logic fixes (#408)
* fix(add-project-redirect-modal): added project redirect modal * refactor(add-project-redirect-modal): added pipe to the modal subscription * fix(addons): added logic for handling redirection after the oauth flow has finished * fix(addons): added data attributes * fix(addons): fixed comments * fix(addons): fixed binding visibility change issues * fix(addons): fixed issue with connecting citations addons * Fix/625 view duplicates bug (#389) * fix(tests): fixed unit tests * fix(bug): fixed view duplicates bug * fix(bugs): fixed permission bug * fix(users): added 5 more columns options (#390) * fix(users): added 5 more columns options * fix(summary): fixed charts numbers display * Fix test env SHARE url (#393) * Fix/wiki (#392) * fix(scroll): scroll to top after navigation end * fix(scroll): scroll to top after navigation end * fix(wiki): wiki bugs * Feature/eslint pipeline Fixed all the lint errors and updated sentry (#396) * chore(eslint): added updates to eslint for the pipeline * chore(linting): fixed some linting * chore(error-updates): added hints to the sentry * Fix/main to dev (#395) * Update develop from main (#322) * Fix/improvements (#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 (#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 (#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 (#320) * fix(tooltip): added tooltip to next button * fix(emails): fixed emails bug * chore(test-env): added test env (#321) * Chore/test docs added more docs and updated docs in the ever expanding evolution. (#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> * Feat(8653): Implement view tracking for registrations and preprints (#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 * [ENG-8624] feat(registries): add context to registration submission + rearrange title and description layout (#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 * [ENG-8504] Show Osf introduction video and Collections,Institutions, Registries, Preprints url banners if user have not created any project for home (/dashboard) tab (#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/develop conflicts (#332) * Fix/improvements (#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 (#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 (#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 (#320) * fix(tooltip): added tooltip to next button * fix(emails): fixed emails bug * chore(test-env): added test env (#321) * Chore/test docs added more docs and updated docs in the ever expanding evolution. (#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 (#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 (#327) * [ENG-8505] Finished adding the GFP to the files page (#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> * [ENG-8639] add <meta> tags to files detail (#324) * 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 * feat(ci): separate linting from tests (#345) * Feat(datacite-tracker): implemented file view and download tracking (#335) * feat(datacite-tracker): implemented file view and download tracking * feat(datacite-tracker): implemented preprint version download tracking * chore(datacite-tracker): rewritten existing tests to respect recent refactor * chore(datacite-tracker): added tests for file downloads tracking * chore(datacite-tracker): added tests for leftover components and pr comment fixes * Feat(ENG-8778): Implement Cookie consent message (#353) * feat(cookie-consent): added toast which asks for cookie consent * chore(cookie-consent): added tests for cookie consent * chore(datacite-tracker): fixed review comments * [eng-8741] Added Sentry to the app (#340) * chore(config-service): added a config service with tests * feat(sentry): added sentry to the app and state-error handler with tests * feat(promise): added a promise for application loading * refactor(rename): renamed the files and consts to be more explicit * feat(google-tag-manager): added a google tag manager factor * feat(gtm): added the logic to get the google tag manager working * feat(pr-review): add code from pr * feat(eng-8741): added conditions if the config variables are not present * chore(nit-pick-for-brian-g): add a gitignore * Fix/dev to main (#368) * Fix/improvements (#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 (#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 (#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 (#320) * fix(tooltip): added tooltip to next button * fix(emails): fixed emails bug * chore(test-env): added test env (#321) * Chore/test docs added more docs and updated docs in the ever expanding evolution. (#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 (#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 (#327) * [ENG-8505] Finished adding the GFP to the files page (#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 * Test/565 my projects (#334) * test(my-projects): added unit tests * test(create-project-dialog): fixed errors * test(my-projects): fixed errors * test(create-project-dialog): fixed * Feat/550 file widget (#323) * feat(file): file-widget * feat(file): fixed move file * Update src/app/features/project/overview/components/files-widget/files-widget.component.html Co-authored-by: nsemets <nsemets@exoft.net> * feat(file): resolve comments * feat(file): refactoring * feat(file): remove sorting storage * feat(file): navigate to file --------- Co-authored-by: nsemets <nsemets@exoft.net> * Fix/metadata (#336) * fix(metadata): updated metadata * fix(metadata): fixes * fix(my-profile): fixed route * fix(models): updated some models * fix(tests): fixed unit tests * chore(env): updated env files (#328) * chore(env): updated env files * fix(env): updated api url * fix(env): updated env for files widget * fix(redirect): fixed redirect after registration (#339) * Test/576 analytics (#341) * test(analytics): added new unit tests * test(analytics): fixed * Feat - Admin institution filters (#333) * refactor(admin-institutions): Refactored and simplified code * fix(admin-institutions): Fixed columns and sorting * feat(institutions-projects): Implemented filters for projects tab. Fixed search result parsing * feat(institutions-preprints): Implemented filters for preprints tab. Fixed search result parsing * feat(institutions-registration): Implemented filters for registration tab * fix(institutions-admin): Fixed resources to table mapping * fix(institutions-admin): Fixed hardcoded institution iri for index-value-search * refactor(institutions-admin-service): Extracted apiUrl to local variable * fix(resource-model): Fix after merge conflict * fix(institution-users): Fixed links to user * fix(institutions-dashboard): Added translations * fix(institutions-dashboard): Fixed tests * fix(admin-institutions): Refactored filters to reusable component * fix(admin-institutions): Fixed comments * Fix - Preprints bugs (#337) * fix(metadata-step): Made Publication DOI field optional * fix(preprints-landing): Contact Us button titlecased, Show example button link fixed * fix(create-new-version): Handled back button * fix(preprint-moderation): Fixed sorting for submissions * fix(license-component): Clearing all fields on cancel button click * fix(preprint-stepper): Fixed add-project-form * Fix/affiliated institutions (#342) * fix(metadata): updated metadata * fix(metadata): fixes * fix(my-profile): fixed route * fix(models): updated some models * fix(tests): fixed unit tests * fix(institutions): updated institutions * fix(my-projects): bookmarks * fix(institutions): updated affiliated institutions and fixed some bugs * fix(tests): fixed tests * fix(tests): updated if statement * fix(bugs): fixed some bugs * Fix/affiliated institutions (#344) * fix(metadata): updated metadata * fix(metadata): fixes * fix(my-profile): fixed route * fix(models): updated some models * fix(tests): fixed unit tests * fix(institutions): updated institutions * fix(my-projects): bookmarks * fix(institutions): updated affiliated institutions and fixed some bugs * fix(tests): fixed tests * fix(tests): updated if statement * fix(bugs): fixed some bugs * fix(files): updated files * Feat/185 - Linked services (#338) * feat(verified-links): fixed minor linked resources bugs * feat(linked-services): added link addons configuration logic to the project settings * feat(linked-services): added linked services page and nav tab, added link addons to settings * feat(linked-services): fixed issues after merging * feat(linked-services): fixed pre-push husky file * fix(linked-services): updated tables * feat(linked-services): added link disabling logic for storage item selector * feat(linked-services): fixed comments and minor bugs * feat(linked-services): fixed test issues * feat(linked-services): fixed storage description display issue on addon terms page * fix(recent-activity): resolved view only link addon logging issue --------- Co-authored-by: nsemets <nsemets@exoft.net> * Fix/clean code (#347) * fix(packages): removed unused packages * fix(protected): removed protected in all files * fix(styles): removed some mixins and scss files * fix(classes): removed old classes --------- Co-authored-by: Nazar Semets <nazar690@gmail.com> * fix(file): downloads link (#346) * Test/580 home page (#348) * test(router): added route mocks * test(router): added tests for dashboard page * test(router): added tests for home page * test(analytics): fixed * Fix/overview (#349) * fix(add): updated add project and component dialog * fix(move-file): updated button * fix(overview): updated project overview * fix(children): refactor get children request (#351) * Fix/overview (#352) * fix(add): updated add project and component dialog * fix(move-file): updated button * fix(overview): updated project overview * fix(updates): clean up some code * fix(regions): updated regions state and removed duplication * fix(providers): updated models for providers * fix(test): fixed unit test * fix(bugs): fixed bugs (#354) * Feat(project-redirect-modal): added project redirect modal (#350) * fix(add-project-redirect-modal): added project redirect modal * refactor(add-project-redirect-modal): added pipe to the modal subscription * Test/395 institutions components (#358) * test(institutions): tested institutions, institutions-list, institutions-search components * fix(tests): fixed tests * Fix/registration bugs (#356) * fix(registration): fixed 594 * fix(registration-bugs): fixed some registrations bugs * fix(registration): fixed registrations fr project * fix(registration): remove useless font class * fix(tags-input): Fix strange behaviour when removing first tag (#361) * Fix/accessibility (#359) * fix(accessibility): update accessibility for some pages * fix(accessibility): added aria labels * fix(updates): clean up code * fix(routes): removed unused route * fix(accessibility): added aria labels to institutions * fix(accessibility): removed aria label for header button * fix(metadata): fixed spacing * fix(resource-metadata): fixed url --------- Co-authored-by: Nazar Semets <nazar690@gmail.com> * Fix/search filters (#360) * fix(global-search-filters): Resolved TODOs * fix(global-search-filters): Fixed and simplified filters logic code * fix(global-search-resource-card): Made links open in a new tab * fix(global-search-filters): Added cardSearchResultCount to filter option * fix(global-search-filters): Fixed boolean filters selected state * fix(global-search-filters): Fixed after merge conflict * fix(global-search-filters): Fixed PR comments * Feat(ENG-8625): add Recent Activity to registrations (#315) * feat(registration-recent-activity): add Recent Activity to registrations * feat(registration-recent-activity): code fixes regarding comments * feat(registration-recent-activity): second round of code fixes regarding review comments * feat(registration-recent-activity): run lint fix * fix(recent-activity): updated some code (#364) * fix(errors): fixed some issues * fix(dashboard): fixed bugs * fix(tests): fixed unit tests * fix(config): added error handling --------- 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> Co-authored-by: nmykhalkevych-exoft <nmykhalkevych@exoft.net> Co-authored-by: Roman Nastyuk <rnastyuk@exoft.net> Co-authored-by: sh-andriy <105591819+sh-andriy@users.noreply.github.com> * [eng-8768] Added helpscout to various pages. (#357) * feat(eng-8768): add the help-scout to preprints * feat(eng-8768): add the help-scout to projects * feat(eng-8768): add the help-scout to registration * feat(eng-8768): add the help-scout to settings and registries files * feat(pr-updates): updated code based on the pr * [ENG-8777] Add scheduled banner (#371) * feat(banner): Add services and models for scheduled banners * feat(osf): Add scheduled banner * feat(banner): CR followup * feat(banners): CR followup again * feat(banners): Use primeflex classesl; remove scss file --------- Co-authored-by: Lord Business <113387478+bp-cos@users.noreply.github.com> 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: Oleh Paduchak <158075011+opaduchak@users.noreply.github.com> Co-authored-by: Yuhuai Liu <yuhuai@cos.io> Co-authored-by: mkovalua <mkoval@exoft.net> Co-authored-by: abram axel booth <aaxelb@users.noreply.github.com> Co-authored-by: nmykhalkevych-exoft <nmykhalkevych@exoft.net> Co-authored-by: Roman Nastyuk <rnastyuk@exoft.net> Co-authored-by: sh-andriy <105591819+sh-andriy@users.noreply.github.com> * Fix/wiki (#398) * fix(scroll): scroll to top after navigation end * fix(scroll): scroll to top after navigation end * fix(wiki): wiki bugs * fix(file): file limits * fix(wiki): responsive * Fix - Contributors permissions (#391) * fix(contributors): Fixed contributors management permissions * fix(contributors): Fixed contributors mapping for registration card * fix(eng-8505): added config variable for google file picker (#397) * Fix/649 moderation tab (#400) * fix(users): added 5 more columns options * fix(summary): fixed charts numbers display * fix(institutions): updates * fix(users-state): removed unused code * fix(collections): updated imports * fix(provider): updated collection and registration providers * fix(registry-provider): updated provider for registrations * fix(moderation-tab): updated provider setup * fix(tests): fixed unit tests * fix(conflict): removed code from conflict * fix(banner): fixed code in banner component * fix(collections): fixed visibility of collections tab * fix(collections): fixed subjects bug * fix(moderators): fixed moderators and contributors search * fix(datalayer): fixed to handle datalayer existence (#401) * fix(metadata): correct resource type values (#402) * Fix(view-only-links): View only links files access issues (#399) * fix(view-only-links): fixed view only links files access issues * fix(view-only-links): fixed file guid absence while redirecting * fix(view-only-links): fixed files spec file issue * fix(addons): fixed connect/configure button appearence and logic --------- Co-authored-by: nsemets <nsemets@exoft.net> Co-authored-by: mfraezz <maf7sm@virginia.edu> Co-authored-by: nmykhalkevych-exoft <nmykhalkevych@exoft.net> Co-authored-by: Lord Business <113387478+bp-cos@users.noreply.github.com> 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: Oleh Paduchak <158075011+opaduchak@users.noreply.github.com> Co-authored-by: Yuhuai Liu <yuhuai@cos.io> Co-authored-by: mkovalua <mkoval@exoft.net> Co-authored-by: abram axel booth <aaxelb@users.noreply.github.com> Co-authored-by: sh-andriy <105591819+sh-andriy@users.noreply.github.com>
1 parent 503652d commit 8425b10

File tree

12 files changed

+98
-38
lines changed

12 files changed

+98
-38
lines changed

src/app/features/project/addons/addons.component.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@
5858
/>
5959

6060
@if (!isConfiguredAddonsLoading()) {
61-
<osf-addon-card-list
62-
[cards]="allConfiguredAddons()"
63-
[cardButtonLabel]="'settings.addons.connectAddon.configure' | translate"
64-
/>
61+
<osf-addon-card-list [cards]="allConfiguredAddons()" />
6562
} @else {
6663
<div class="flex-1 mt-6 md:mt-8 lg:pt-7">
6764
<osf-loading-spinner />

src/app/features/project/addons/addons.component.ts

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { LoadingSpinnerComponent, SearchInputComponent, SelectComponent, SubHead
2525
import { AddonCardListComponent } from '@shared/components/addons';
2626
import { ADDON_CATEGORY_OPTIONS, ADDON_TAB_OPTIONS } from '@shared/constants';
2727
import { AddonCategory, AddonTabValue } from '@shared/enums';
28+
import { isAddonServiceConfigured } from '@shared/helpers';
29+
import { AddonCardModel } from '@shared/models';
2830
import {
2931
AddonsSelectors,
3032
ClearConfiguredAddons,
@@ -151,6 +153,10 @@ export class AddonsComponent implements OnInit {
151153
return authorizedAddons.filter((card) => card.displayName.toLowerCase().includes(searchValue));
152154
});
153155

156+
allConfiguredAddonsForCheck = computed(() => {
157+
return [...this.configuredStorageAddons(), ...this.configuredCitationAddons(), ...this.configuredLinkAddons()];
158+
});
159+
154160
resourceReferenceId = computed(() => {
155161
return this.addonsResourceReference()[0]?.id;
156162
});
@@ -181,13 +187,28 @@ export class AddonsComponent implements OnInit {
181187
}
182188
});
183189

184-
filteredAddonCards = computed(() => {
190+
filteredAddonCards = computed((): AddonCardModel[] => {
185191
const searchValue = this.searchValue().toLowerCase();
186-
return this.currentAddonsState().filter(
187-
(card) =>
188-
card.externalServiceName.toLowerCase().includes(searchValue) ||
189-
card.displayName.toLowerCase().includes(searchValue)
190-
);
192+
const configuredAddons = this.allConfiguredAddonsForCheck();
193+
194+
return this.currentAddonsState()
195+
.filter(
196+
(card) =>
197+
card.externalServiceName.toLowerCase().includes(searchValue) ||
198+
card.displayName.toLowerCase().includes(searchValue)
199+
)
200+
.map((addon) => {
201+
const isConfigured = isAddonServiceConfigured(addon, configuredAddons);
202+
const configuredAddon = configuredAddons.find(
203+
(config) => config.externalServiceName === addon.externalServiceName
204+
);
205+
206+
return {
207+
addon,
208+
isConfigured,
209+
configuredAddon,
210+
} as AddonCardModel;
211+
});
191212
});
192213

193214
onCategoryChange(value: Primitive): void {

src/app/features/settings/addons/addons.component.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@
6262
/>
6363

6464
@if (!isAuthorizedAddonsLoading()) {
65-
<osf-addon-card-list
66-
[cards]="allAuthorizedAddons()"
67-
[cardButtonLabel]="'settings.addons.form.buttons.reconnect' | translate"
68-
[showDangerButton]="true"
69-
/>
65+
<osf-addon-card-list [cards]="allAuthorizedAddons()" [showDangerButton]="true" />
7066
} @else {
7167
<div class="mt-8">
7268
<osf-loading-spinner />

src/app/shared/components/addons/addon-card-list/addon-card-list.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<section class="grid">
22
@if (cards().length) {
3-
@for (card of cards(); track card.id) {
3+
@for (card of cards(); track $index) {
44
<div class="col-12 sm:col-6 md:col-6 lg:col-4">
5-
<osf-addon-card [cardButtonLabel]="cardButtonLabel()" [card]="card" [showDangerButton]="showDangerButton()" />
5+
<osf-addon-card [card]="card" [showDangerButton]="showDangerButton()" />
66
</div>
77
}
88
} @else {

src/app/shared/components/addons/addon-card-list/addon-card-list.component.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ describe('AddonCardListComponent', () => {
2727
expect(component.cards()).toEqual([]);
2828
});
2929

30-
it('should have default empty string ', () => {
31-
expect(component.cardButtonLabel()).toBe('');
32-
});
33-
3430
it('should have default false value', () => {
3531
expect(component.showDangerButton()).toBe(false);
3632
});

src/app/shared/components/addons/addon-card-list/addon-card-list.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TranslatePipe } from '@ngx-translate/core';
22

33
import { Component, input } from '@angular/core';
44

5-
import { AddonModel, AuthorizedAccountModel, ConfiguredAddonModel } from '@shared/models';
5+
import { AddonCardModel, AddonModel, AuthorizedAccountModel, ConfiguredAddonModel } from '@shared/models';
66

77
import { AddonCardComponent } from '../addon-card/addon-card.component';
88

@@ -13,7 +13,6 @@ import { AddonCardComponent } from '../addon-card/addon-card.component';
1313
styleUrl: './addon-card-list.component.scss',
1414
})
1515
export class AddonCardListComponent {
16-
cards = input<(AddonModel | AuthorizedAccountModel | ConfiguredAddonModel)[]>([]);
17-
cardButtonLabel = input<string>('');
16+
cards = input<(AddonModel | AuthorizedAccountModel | ConfiguredAddonModel | AddonCardModel)[]>([]);
1817
showDangerButton = input<boolean>(false);
1918
}

src/app/shared/components/addons/addon-card/addon-card.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<div class="addon-card flex flex-1 gap-4 flex-column p-5">
22
<div class="max-h-8rem flex justify-content-center align-items-center">
3-
@if (card()!.externalServiceName) {
3+
@if (actualAddon()?.externalServiceName) {
44
<img
55
class="addon-image"
66
alt="Addon card image"
7-
[src]="'assets/icons/addons/' + card()!.externalServiceName + '.svg'"
7+
[src]="'assets/icons/addons/' + actualAddon()!.externalServiceName + '.svg'"
88
data-test-addon-card-logo
99
/>
1010
}
1111
</div>
1212

1313
<div class="flex flex-column gap-3">
14-
<h3 class="text-center" data-test-addon-card-title>{{ card()?.displayName }}</h3>
14+
<h3 class="text-center" data-test-addon-card-title>{{ actualAddon()?.displayName }}</h3>
1515

1616
<div class="flex justify-content-center align-items-center md:gap-5 md:mt-3 btn-container">
1717
@if (showDangerButton()) {
@@ -24,7 +24,7 @@ <h3 class="text-center" data-test-addon-card-title>{{ card()?.displayName }}</h3
2424
}
2525

2626
<p-button
27-
[label]="cardButtonLabel() || ('settings.addons.form.buttons.connect' | translate)"
27+
[label]="buttonLabel() | translate"
2828
severity="secondary"
2929
(onClick)="!isConfiguredAddon() ? onConnectAddon() : onConfigureAddon()"
3030
></p-button>

src/app/shared/components/addons/addon-card/addon-card.component.ts

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Router } from '@angular/router';
99

1010
import { getAddonTypeString, isConfiguredAddon } from '@osf/shared/helpers';
1111
import { CustomConfirmationService, LoaderService } from '@osf/shared/services';
12-
import { AddonModel, AuthorizedAccountModel, ConfiguredAddonModel } from '@shared/models';
12+
import { AddonCardModel, AddonModel, AuthorizedAccountModel, ConfiguredAddonModel } from '@shared/models';
1313
import { DeleteAuthorizedAddon } from '@shared/stores/addons';
1414

1515
@Component({
@@ -24,15 +24,38 @@ export class AddonCardComponent {
2424
private readonly loaderService = inject(LoaderService);
2525
private readonly actions = createDispatchMap({ deleteAuthorizedAddon: DeleteAuthorizedAddon });
2626

27-
readonly card = input<AddonModel | AuthorizedAccountModel | ConfiguredAddonModel | null>(null);
28-
readonly cardButtonLabel = input<string>('');
27+
readonly card = input<AddonModel | AuthorizedAccountModel | ConfiguredAddonModel | AddonCardModel | null>(null);
2928
readonly showDangerButton = input<boolean>(false);
3029

31-
readonly addonTypeString = computed(() => getAddonTypeString(this.card()));
32-
readonly isConfiguredAddon = computed(() => isConfiguredAddon(this.card()));
30+
readonly actualAddon = computed(() => {
31+
const actualCard = this.card();
32+
if (!actualCard) return null;
33+
34+
if ('isConfigured' in actualCard) {
35+
return actualCard.addon;
36+
}
37+
38+
return actualCard;
39+
});
40+
41+
readonly addonTypeString = computed(() => getAddonTypeString(this.actualAddon()));
42+
readonly isConfiguredAddon = computed(() => {
43+
const actualCard = this.card();
44+
if (!actualCard) return false;
45+
46+
if ('isConfigured' in actualCard) {
47+
return actualCard.isConfigured;
48+
}
49+
50+
return isConfiguredAddon(actualCard);
51+
});
52+
53+
readonly buttonLabel = computed(() => {
54+
return this.isConfiguredAddon() ? 'settings.addons.form.buttons.configure' : 'settings.addons.form.buttons.connect';
55+
});
3356

3457
onConnectAddon(): void {
35-
const addon = this.card();
58+
const addon = this.actualAddon();
3659
if (addon) {
3760
const currentUrl = this.router.url;
3861
const baseUrl = currentUrl.split('/addons')[0];
@@ -43,13 +66,24 @@ export class AddonCardComponent {
4366
}
4467

4568
onConfigureAddon(): void {
46-
const addon = this.card();
47-
if (addon) {
69+
const actualCard = this.card();
70+
if (!actualCard) return;
71+
72+
if ('isConfigured' in actualCard && actualCard.configuredAddon) {
4873
const currentUrl = this.router.url;
4974
const baseUrl = currentUrl.split('/addons')[0];
5075
this.router.navigate([`${baseUrl}/addons/configure-addon`], {
51-
state: { addon },
76+
state: { addon: actualCard.configuredAddon },
5277
});
78+
} else {
79+
const addon = this.actualAddon();
80+
if (addon) {
81+
const currentUrl = this.router.url;
82+
const baseUrl = currentUrl.split('/addons')[0];
83+
this.router.navigate([`${baseUrl}/addons/configure-addon`], {
84+
state: { addon },
85+
});
86+
}
5387
}
5488
}
5589

@@ -63,7 +97,8 @@ export class AddonCardComponent {
6397
}
6498

6599
onDisableAddon(): void {
66-
const addonId = this.card()?.id;
100+
const addon = this.actualAddon();
101+
const addonId = addon?.id;
67102

68103
if (addonId) {
69104
this.loaderService.show();

src/app/shared/helpers/addon-type.helper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ export function isConfiguredAddon(addon: AddonModel | AuthorizedAccountModel | C
6262
addon.type === ConfiguredAddonType.LINK
6363
);
6464
}
65+
66+
export function isAddonServiceConfigured(addon: AddonModel | null, configuredAddons: ConfiguredAddonModel[]): boolean {
67+
if (!addon) return false;
68+
69+
return configuredAddons.some((configuredAddon) => configuredAddon.externalServiceName === addon.externalServiceName);
70+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { AddonModel } from './addons.models';
2+
import { ConfiguredAddonModel } from './configured-addon.model';
3+
4+
export interface AddonCardModel {
5+
addon: AddonModel;
6+
isConfigured: boolean;
7+
configuredAddon?: ConfiguredAddonModel;
8+
}

0 commit comments

Comments
 (0)