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: technique creation #628

Merged
merged 53 commits into from
Jul 1, 2024
Merged

feat: technique creation #628

merged 53 commits into from
Jul 1, 2024

Conversation

simonfernandes
Copy link
Contributor

@simonfernandes simonfernandes commented Jun 13, 2024

Description

This PR creates "Techniques" which are accessible via a new tab in the User Officer role. You can create/edit/delete them and add a name, short code, description and attach instruments (experimental areas) to them.

Note that this is not hidden behind a feature flag so it is currently visible to all facilities.

Motivation and Context

This is the first part of creating an STFC Xpress system in the software. You can see our plan so far and more discussion in UserOfficeProject/issue-tracker#1032 (comment)

How Has This Been Tested

  • General manual testing
  • e2e tests
  • Backend unit tests
  • Manual graphql endpoint testing for schema validation

Fixes

Closes UserOfficeProject/issue-tracker#1095

Changes

  • Frontend pages for techniques
  • Backend resolver/query/mutation/datasource flows for the various create/edit/update/delete functionality

Depends on

The schema validation has already been merged via UserOfficeProject/user-office-lib#194

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated
GMT20240627-101014_Recording.cutfile.20240627101603583_1920x1200.mp4

@simonfernandes simonfernandes requested review from a team and yoganandaness and removed request for a team June 13, 2024 08:53
@simonfernandes simonfernandes requested a review from a team as a code owner June 13, 2024 08:53
@simonfernandes simonfernandes requested review from mutambaraf and removed request for a team June 13, 2024 08:53
Copy link
Contributor

@yoganandaness yoganandaness left a comment

Choose a reason for hiding this comment

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

Kindly go through my comments and reply if have any concerns. Overall it is a good work and a complete package.

apps/backend/db_patches/0157_AddTechniques.sql Outdated Show resolved Hide resolved
apps/backend/db_patches/0157_AddTechniques.sql Outdated Show resolved Hide resolved
apps/backend/src/models/Technique.ts Show resolved Hide resolved
apps/backend/src/datasources/TechniqueDataSource.ts Outdated Show resolved Hide resolved
apps/frontend/src/components/technique/TechniqueTable.tsx Outdated Show resolved Hide resolved
apps/frontend/src/components/technique/TechniqueTable.tsx Outdated Show resolved Hide resolved
@simonfernandes
Copy link
Contributor Author

@yoganandaness These are some really good comments, thanks Yoganandan. We have addressed most of these now but have left a couple of things with comments to clarify.

Copy link
Contributor

@yoganandaness yoganandaness left a comment

Choose a reason for hiding this comment

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

Thanks for the response. Found some more improvements, when i went through the PR. Could you please take a look.

Kindly let me know in case of any concerns.

apps/backend/db_patches/0157_AddTechniques.sql Outdated Show resolved Hide resolved
apps/backend/src/models/Technique.ts Show resolved Hide resolved
<AssignInstrumentsToTechniques
assignInstrumentsToTechniques={assignInstrumentsToTechniques}
close={(): void => setOpenTechniqueAssignment(false)}
instrumentIds={(selectedTechnique?.instruments || []).map(
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the type definition of TechniqueFragment, the instruments field is always going to be present and i dont think there is a real need for the validation here.

@simonfernandes
Copy link
Contributor Author

@yoganandaness Deepak has now added a video above 🙂

@deepaksftc deepaksftc requested a review from mutambaraf June 27, 2024 15:12
event.loggedInUserId,
event.type,
json,
obj[0].techniqueId,
Copy link
Contributor

Choose a reason for hiding this comment

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

If this id not a string already we must need to convert it to a string.

Copy link
Contributor

@deepaksftc deepaksftc Jun 27, 2024

Choose a reason for hiding this comment

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

Since obj is from JSON.parse(), its of type any. It's getting converted to string type when getting passed to this method call. I think, explicit conversion is not required here right?

Copy link
Contributor

@mutambaraf mutambaraf left a comment

Choose a reason for hiding this comment

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

This looks good to me just , that one comment.

@yoganandaness
Copy link
Contributor

Overall, it looks great. Just a small comment. Thanks.

Copy link
Contributor

@yoganandaness yoganandaness 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.

@simonfernandes simonfernandes merged commit 77e10af into develop Jul 1, 2024
20 checks passed
@simonfernandes simonfernandes deleted the 1095 branch July 1, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Xpress techniques
4 participants