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

Content registration #9

Merged
merged 23 commits into from
Nov 24, 2023
Merged

Content registration #9

merged 23 commits into from
Nov 24, 2023

Conversation

rquazi
Copy link
Member

@rquazi rquazi commented Nov 17, 2023

Schema Registrationa with File or only with metadata is working with the real datamodel api backend. Features working are

  • Existing schema file registartion (CSV,JSON)
  • Metadata registration without a schema file
  • Navigate to schema detail page after successful registration.

@rquazi rquazi requested review from konolak and maariaw November 17, 2023 13:23
Copy link

@maariaw maariaw left a comment

Choose a reason for hiding this comment

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

Very nice that you added some more examples, the ones for the curl command and the schema payload.

tagTypes: ['schemaApi'],
extractRehydrationInfo(action, { reducerPath }) {
if (action.type === HYDRATE) {
return action.payload[reducerPath];
}
},
endpoints: (builder) => ({
putSchema: builder.mutation<SchemaFormType, SchemaFormType>({
putSchema: builder.mutation<any, any>({
Copy link

Choose a reason for hiding this comment

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

Should there maybe be a proper type/interface here instead of any? Seems like a place where you would like to leverage typing checks, to make sure you're sending a valid payload, and getting back data the way you want?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was quick do over to make the put work. I have to think about the correct interface type that the backend accepts.

@@ -73,6 +74,7 @@ export default function UpdateWithFileModal({
if (fileData) {
const formData = new FormData();
formData.append('file', fileData);
console.log('in file modal' + formData);
Copy link

Choose a reason for hiding this comment

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

Should we maybe clean up console logs as well? We don't want them to end up in production, at least.

key={item.pid}
onClick={() => handleClick(item.pid)}
onMouseEnter={() => item.onMouseEnter && item.onMouseEnter()}
onMouseLeave={() => item.onMouseLeave && item.onMouseLeave()}
Copy link

Choose a reason for hiding this comment

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

Are these supposed to do something? Did these not break, since you removed the onMouseLeave and onMouseEnter attributes from the Schema interface?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, I will add the click event on the list component :)

Copy link

Choose a reason for hiding this comment

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

At some point we need to change every 'status' into state, since I think that's the term we have decided to use in MSCR for draft/published etc. Also we need to refactor overlapping interfaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes!

}, [schemaFormInitialData]);

useEffect(() => {
if (userPosted && result.isSuccess) {
if ((userPosted && resultSchema.isSuccess) || resultSchema.isSuccess) {
Copy link

Choose a reason for hiding this comment

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

Is it just my Friday afternoon brain, or does the userPosted not really matter in this condition? If resultSchema.isSuccess is true, this statement is true regardless of userPosted, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was my friday afternoon brain!! good catch. This does not make any sense. I will fix it

@maariaw maariaw merged commit b937c28 into develop Nov 24, 2023
1 of 2 checks passed
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.

2 participants