Skip to content
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

feat: enable filters config and scientific conditions on the backend #1337

Merged
merged 15 commits into from
Aug 21, 2024

Conversation

Ingvord
Copy link
Contributor

@Ingvord Ingvord commented Jul 29, 2024

This one is to resolve #604

  • extend UserSettings document schema: add filters and conditions
  • add tests
  • add default endpoints

@Ingvord Ingvord self-assigned this Jul 29, 2024
@Ingvord Ingvord added enhancement New feature or request Release Search UI Improve Search UI FE-updates Fixes for frontend changes labels Jul 29, 2024
Copy link
Contributor

@bpedersen2 bpedersen2 left a comment

Choose a reason for hiding this comment

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

Looks fine.

Copy link
Contributor

@Junjiequan Junjiequan left a comment

Choose a reason for hiding this comment

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

Looks good to me overall.
Just commented few minor things.

PS: merge with master branch will fix the docker-compose error in the test

Comment on lines +317 to +326
@UseGuards(
class ByPassAuthenticatedPoliciesGuard
extends PoliciesGuard
implements CanActivate
{
async canActivate(): Promise<boolean> {
return Promise.resolve(true);
}
},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the endpoint should open to unauthenticated users, we can just use PoliciesGuard or remove UseGuards at all I suppose. Since we are not checking policies here

operator: string;
}

export const kDefaultFilters: FilterConfig[] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

k stands for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, old habit - roots from my C++ experience to follow Google code styling standards

k - prefix for a static const

I used to maintain JavaScriptMVC (pre-Angular SPA vanilla JS framework), together with the folks we adopted that standard also for JS

If that makes any sense

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally it would be more appreciated if the naming is consistent with existing naming convention within the application scope.

Copy link
Contributor

@Junjiequan Junjiequan Aug 7, 2024

Choose a reason for hiding this comment

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

#Sure, what is the current convention?

We don't have a strict naming convention in this project yet, but we should have one documented in the future.
Google also has a code styling standard for typescript as well, which, generally speaking is like unspoken standard for most of the typescript applications

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I will check that out!

@Ingvord
Copy link
Contributor Author

Ingvord commented Aug 7, 2024 via email

@Ingvord Ingvord marked this pull request as ready for review August 20, 2024 14:39
@Ingvord Ingvord enabled auto-merge August 20, 2024 14:42
@Ingvord
Copy link
Contributor Author

Ingvord commented Aug 20, 2024

@Junjiequan how can I fix that PR title check? Thanks

@Junjiequan
Copy link
Contributor

@Ingvord
feat: enable filters config and scientific conditions on the backend

The rules for PR title can be found in https://github.com/SciCatProject/scicat-backend-next/blob/master/.github/pr-title-checker-config.json

@Ingvord Ingvord changed the title Enable FiltersConfig and ScientificConditions on the BE feat: Enable FiltersConfig and ScientificConditions on the BE Aug 21, 2024
@Ingvord Ingvord changed the title feat: Enable FiltersConfig and ScientificConditions on the BE feat: enable filters config and scientific conditions on the backend Aug 21, 2024
@Ingvord Ingvord merged commit 9216dea into master Aug 21, 2024
8 of 10 checks passed
@Ingvord Ingvord deleted the UI-604 branch August 21, 2024 08:49
@Ingvord
Copy link
Contributor Author

Ingvord commented Aug 21, 2024

Cool! That worked. Thanks!

Also the whole thing looks a bit encryptic to me. Why do we need this? Is it possible to provide more descriptive error message?

Thanks again for the help

@Junjiequan
Copy link
Contributor

@Ingvord
It helps with mainly two things:

  1. PR title prefix makes it easy to understand what kind of changes will be included in the PR.
  2. Helps with complete & well organized release notes.

I believe the error messages won't matter too much, it just takes a little time to accommodate the title rules.

@Ingvord
Copy link
Contributor Author

Ingvord commented Aug 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request FE-updates Fixes for frontend changes Release Search UI Improve Search UI
Projects
Development

Successfully merging this pull request may close these issues.

Backend development to enable table for user configuration of Facets and columns.
3 participants