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

356 publish dataset #423

Open
wants to merge 69 commits into
base: develop
Choose a base branch
from
Open

356 publish dataset #423

wants to merge 69 commits into from

Conversation

ekraffmiller
Copy link
Contributor

@ekraffmiller ekraffmiller commented Jun 29, 2024

What this PR does / why we need it:

Which issue(s) this PR closes:

Closes #356

Special notes for your reviewer:
I wasn't able to add the major and minor version numbers to the popup, because they aren't currently part of the Dataset model. I added an issue for this: #428

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

@coveralls
Copy link

Coverage Status

coverage: 98.403% (+0.8%) from 97.581%
when pulling b9ccab8 on 356-publish-dataset
into 107aaca on develop.

@coveralls
Copy link

Coverage Status

coverage: 98.403% (+0.8%) from 97.581%
when pulling 5918c3c on 356-publish-dataset
into 107aaca on develop.

@coveralls
Copy link

Coverage Status

coverage: 98.403% (+0.8%) from 97.581%
when pulling 68ed323 on 356-publish-dataset
into 107aaca on develop.

@coveralls
Copy link

Coverage Status

coverage: 98.403% (+0.8%) from 97.581%
when pulling 68ed323 on 356-publish-dataset
into 107aaca on develop.

@coveralls
Copy link

coveralls commented Jul 8, 2024

Coverage Status

coverage: 98.403% (+0.8%) from 97.581%
when pulling 587675c on 356-publish-dataset
into 107aaca on develop.

@GermanSaracca
Copy link
Contributor

@ekraffmiller should we move this to Ready for Review?

onChange?: (event: React.MouseEvent<HTMLInputElement>) => void
}

export function FormRadioGroup({
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not a fan of cloning nested elements as they may lead to hard debugging in the future.
Nor to limit that a radio group must be forced to be seen in a line with two columns from a specific windows size (sm=3).
But still, I think it serves as a reusable element for most occasions, and in case you want something more customized, you can always compose a radio group in different ways manually without this component.
In my opinion, it is not to my liking, but I think it can be useful for several cases. 👍🏼

Copy link
Contributor

Choose a reason for hiding this comment

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

Please describe this new elements in the CHANGELOG under # Non Published Changes

@@ -0,0 +1,9 @@
{
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 locales are only used in the Dataset page and not in a reusable componente across the application I think we should keep this locales inside the dataset.json file maybe?

jsVersionUpdateType = JSVersionUpdateType.MINOR
} else {
jsVersionUpdateType = JSVersionUpdateType.MAJOR
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a suggestion (I know that this logic is very simple and will be removed in the future.) for safer and cleaner flow control, something like this:

if (versionUpdateType === VersionUpdateType.UPDATE_CURRENT) {
  throw new Error('update current version type not supported yet')
}

if (versionUpdateType === VersionUpdateType.MINOR) {
  jsVersionUpdateType = JSVersionUpdateType.MINOR
}

if (versionUpdateType === VersionUpdateType.MAJOR) {
  jsVersionUpdateType = JSVersionUpdateType.MAJOR
}

}
}
}
}, [publishCompleted, dataset])
Copy link
Contributor

Choose a reason for hiding this comment

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

eslint warning in useEffect dependency array.
React Hook useEffect has missing dependencies: 'addDatasetAlert', 'created', 'datasetAlerts', 'navigate', 'publishInProgress', 'removeDatasetAlert', and 'setDatasetAlerts'. Either include them or remove the dependency array

addDatasetAlert({ messageKey: AlertMessageKey.DATASET_CREATED, variant: 'success' })
}
if (dataset) {
if (publishInProgress) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion also, maybe a safer control flow would be:

if (publishInProgress && !publishCompleted) {
  // Code here for when a publication is in progress and has not yet been completed.
  return statement here to stop the flow
}
if (publishInProgress && publishCompleted) {
  // Code here for when a publication is in progress and has been completed.
}

defaultChecked
onClick={handleVersionUpdateTypeChange}
name="update-type"
label="Minor Version"
Copy link
Contributor

Choose a reason for hiding this comment

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

Labels like "Minor Version", "Major Version" and "Update Current Version" could be in translation file perhaps.

}
}
void pollLocks()
}, 2000)
Copy link
Contributor

Choose a reason for hiding this comment

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

The interval timing could be stored in this component in a POLL_LOCKS_INTERVAL_TIME exported constant to reuse for testing purposes.

let intervalId: NodeJS.Timeout | null = null

if (publishInProgress && dataset) {
const gotoReleasedPageAfterPublish = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the name gotoReleasedPageAfterPublish is outdated for what the function does.

}
}
}, [publishInProgress, dataset, datasetRepository])
return publishCompleted
Copy link
Contributor

Choose a reason for hiding this comment

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

An space between the useEffect and the return statement could bring better readability

@@ -0,0 +1,75 @@
/// <reference types="cypress" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious on what type completions does this give us, these are really useful sometimes, I didn't know this one.

@ekraffmiller ekraffmiller marked this pull request as ready for review July 12, 2024 14:12
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.

Add Publish Dataset Version feature
3 participants