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

Only allow selecting one license on create dandiset page #1505

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

mvandenburgh
Copy link
Member

Closes #1476

@mvandenburgh mvandenburgh added patch Increment the patch version when merged release Create a release when this pr is merged labels Feb 27, 2023
@mvandenburgh mvandenburgh force-pushed the limit-to-one-license-create-dandiset-view branch from 98c3e7b to 8df943d Compare February 27, 2023 19:58
@mvandenburgh mvandenburgh force-pushed the limit-to-one-license-create-dandiset-view branch from 8df943d to 7f2a040 Compare February 27, 2023 20:24
@mvandenburgh mvandenburgh merged commit 94a5192 into master Feb 27, 2023
@mvandenburgh mvandenburgh deleted the limit-to-one-license-create-dandiset-view branch February 27, 2023 20:35
@dandibot
Copy link
Member

🚀 PR was released in v0.3.20 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Feb 27, 2023
@@ -159,7 +158,14 @@ if (!loggedIn()) {
}

async function registerDandiset() {
const metadata = { name: name.value, description: description.value, license: license.value };
const metadata: Record<string, any> = {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be Record<"name" | "description", string>?

Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing the reason this was done was to prevent the type checker from complaining when the license field is added below.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you do

const metadata: {name: string, description: string, license?: LicenseType} = ...

🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you do

const metadata: {name: string, description: string, license?: LicenseType} = ...

man_shrugging

Yeah, that syntax is much better. And my use of any here also inadvertently hid a bug 😞

Screenshot from 2023-02-27 19-49-06

I thought I tested it on the deploy preview and it worked, but clearly I messed something up

Copy link
Member Author

Choose a reason for hiding this comment

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

Follow up on this - #1510

Copy link
Member

Choose a reason for hiding this comment

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

Typechecking for the win!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

selecting multiple licenses
5 participants