Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

[C-1461] Implement license-type/isrc upload flow #2248

Merged
merged 9 commits into from
Nov 11, 2022

Conversation

dylanjeffers
Copy link
Contributor

@dylanjeffers dylanjeffers commented Nov 11, 2022

Description

  • Implements isrc/iswc field
  • Implements license-type field
  • migrates license helpers to typescript
RPReplay_Final1668131810.mov

@dylanjeffers dylanjeffers requested review from a team and amendelsohn and removed request for a team November 11, 2022 02:03
@audius-infra
Copy link
Collaborator

Copy link
Contributor

@amendelsohn amendelsohn left a comment

Choose a reason for hiding this comment

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

Awesome!

Should we disallow wrapping on hyphen in the license type? I feel like it'll be easier to read as long as we're not hitting a third line

@@ -10,23 +10,23 @@ import { makeStyles } from 'app/styles'
// Note, offset is the inner padding of the container div
const offset = 3

export type Option = {
key: string
export type Option<Value> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Brain snagged on this one for a sec. Reminded me of https://en.wikipedia.org/wiki/Option_type, though the name collision is probably fine here

@@ -99,7 +99,9 @@ const useStyles = makeStyles(({ palette, typography, spacing }) => ({
}
}))

export const SegmentedControl = (props: SegmentedControlProps) => {
export const SegmentedControl = <Value,>(
Copy link
Contributor

Choose a reason for hiding this comment

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

is the , required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's this annoying issue with generic types and anonymous functions, we need it sadly

@@ -242,6 +243,7 @@ export const TextInput = forwardRef<RNTextInput, TextInputProps>(
value={value}
onFocus={handleFocus}
onBlur={handleBlur}
placeholder={label && !isFocused ? undefined : placeholder}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need !isFocused? Does RNTextInput not hide the placeholder while you're typing by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good q so for cases when there is a label, that's in the placeholder spot till you click into it, the label animates up, and then a placeholder text can appear. Otherwise there is a collision between the two

) : null
}, [allowAttribution, commercialUse, derivativeWorks, styles, neutral])

console.log('license', license)
Copy link
Contributor

Choose a reason for hiding this comment

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

console log

@@ -0,0 +1,148 @@
import { useCallback, useMemo, useState } from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming #2246 and this one have the same changes on purpose. This builds on that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah there were merge conflicts otherwise, but after that one is merged and this is rebased, it should go away

>
<View style={styles.content}>
<View style={styles.licenseSection}>
<Text {...labelProps}>{messages.allowAttribution}?</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to keep the ? outside messages? That might not be appropriate for all localizations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great callout, I was using messages in multiple spots so I should probably just duplicate them

derivativeWorks: Nullable<boolean>
) => {
if (!allowAttribution) return null
const icons: [ComponentType<SvgProps>, string][] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

neat!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

realized i could have made this more clear with

  const icons: [Icon: ComponentType<SvgProps>, key: string][] = [

updated!

@dylanjeffers
Copy link
Contributor Author

Awesome!

Should we disallow wrapping on hyphen in the license type? I feel like it'll be easier to read as long as we're not hitting a third line

so apparently this is not possible with react-native and ios, since ios defines it's own textBreakStrategy? there is an android specific option though looks like: https://reactnative.dev/docs/text#textbreakstrategy-android

@dylanjeffers dylanjeffers merged commit decabd2 into main Nov 11, 2022
@dylanjeffers dylanjeffers deleted the dj-c-1461-license-type-upload-flow branch November 11, 2022 06:14
audius-infra pushed a commit that referenced this pull request Nov 12, 2022
[ad230d1] v1.4.0 (#2242) Sebastian Klingler
[dc11096] Stop propagation on repost button click in tracks tables (#2249) Kyle Shanks
[5964998] Update push notification types, update notif navigation hook, and remove userInteraction check in onNotification method (#2247) Kyle Shanks
[decabd2] [C-1461] Implement license-type/isrc upload flow (#2248) Dylan Jeffers
[9e84248] [C-1452] Implement release-date field (#2246) Dylan Jeffers
[8a0c7a8] Fix race condition checking stream_mp3 feature flag (#2244) Andrew Mendelsohn
[36d53b0] Don't delete sourcemaps on sync to s3 (#2243) Sebastian Klingler
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants