Skip to content

Conversation

@dylanjeffers
Copy link
Contributor

Description

Revamps mobile edit collection up to spec
Adds relelase_date field to advanced field for web

@changeset-bot
Copy link

changeset-bot bot commented Jul 23, 2024

⚠️ No Changeset found

Latest commit: 8f9257f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/c-4853-fix-edit-collection

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/c-4853-fix-edit-collection

@dylanjeffers dylanjeffers requested a review from sddioulde July 23, 2024 04:40
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.

Phew! @dylanjeffers what an effort ‼️

export const AlbumPriceField = () => {
return (
<BoxedTextField
title={messages.title}
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 I prefer how this reads as is, but just occurred to me you could spread {...messages} into props for this

Comment on lines 15 to 20
padding: spacing(4),
gap: spacing(4),
borderRadius: spacing(2),
borderWidth: 1,
borderColor: palette.neutralLight7,
backgroundColor: palette.neutralLight10
Copy link
Contributor

Choose a reason for hiding this comment

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

is this just a harmony/Paper?

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 likely is! will take a look after this :)

const { is_unlisted, is_scheduled_release, release_date, isUpload } = values
const isAlreadyPublic = !isUpload && !initialValues.is_unlisted
const { entityType } = values
const hiddenKey = entityType === 'track' ? 'is_unlisted' : 'is_private'
Copy link
Contributor

Choose a reason for hiding this comment

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

so sad these are not the same key 🤦

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 wild right?

} = values

const initiallyPublic = !isUpload && !initialValues[hiddenKey]
const hidePaidScheduled = !isPaidScheduledEnabled && entityType === 'album'
Copy link
Contributor

Choose a reason for hiding this comment

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

should this not apply regardless of entity type?

I think the flag is meant to cover hidden paid tracks as well. That was also net new in this project

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah youre right, updating

const [{ value: isHidden }] = useField('is_private')
const [{ value: releaseDate, onChange }] = useField('release_date')

const error = !upc || /^\d{12}$/.test(upc) ? null : messages.upcInputError
Copy link
Contributor

Choose a reason for hiding this comment

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

nbd, I'd probably wrap this and the below into a UPCField component which handles live validation and separates the concern from future Advanced field siblings, leaving the form layer on this component.

Something like:

<FormScreen>
	<UPCField />
	{ !isHidden && <ReleaseDateField /> }
</FormScreen>

Copy link
Contributor

Choose a reason for hiding this comment

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

you'd have to disable submit via validation instead of disableSubmit though

all super optional imo

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 the reason i kept this here is that i didnt want to have to do another formik wrap since that's not a pattern on mobile 🗡️ . let me add a ticket for this so we dont loose it though, the move might be to update upc in schema to have this validation, and then we can just rely on it.

const { data: collection } = useGetPlaylistById({ playlistId, currentUserId })
const collectionType = collection?.is_album ? 'album' : 'playlist'
const messages = getMessages(collectionType)
const [{ value: entityType }] = useField('entityType')
Copy link
Contributor

Choose a reason for hiding this comment

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

this is nice 👍

Comment on lines 3 to 4
export * from '../../../components/edit/PriceAndAudienceField/SpecialAccessRadioField'
export * from '../../../components/edit/PriceAndAudienceField/GollectibleGatedRadioField'
Copy link
Contributor

Choose a reason for hiding this comment

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

seems a bit unusual to export from two layers up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah good point, these are not needed, just in renames this carried over, removing!

styles={{ root: styles.textInput }}
{...other}
/>
{textField ?? (
Copy link
Contributor

Choose a reason for hiding this comment

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

this confuses me. We're passing in a node but if truthy we're not rendering it, and instead rendering our own text field?

should this be:

// textField: TextFieldProp

TextFieldProp
	? <TextFieldProp {...other} />
	: <TextField {...other} />

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 spot!! this was a holdover from when i wanted to make it a ReactNode, then realized it should be an element, but didnt remove this defininition

export * from './AdvancedOptionsScreen'
export * from './PriceAndAudienceScreen'
export * from './AdvancedScreen'
export * from '../../../components/edit/PriceAndAudienceField/PriceAndAudienceScreen'
Copy link
Contributor

Choose a reason for hiding this comment

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

again, feels far away?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same issue, nice catch

trackArtwork?: string
bpm?: string
isUpload?: boolean
is_private?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be is_unlisted? or can this thing be a CollectionMetadata also?
Wondering since the type is based on Omit<TrackMetadataForUpload, 'bpm'>

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 this is a hack-alert to make FormValues quickly work with collections also, will add it to that clean up ticket. great spots dude.

@dylanjeffers dylanjeffers merged commit df91fca into main Jul 23, 2024
@dylanjeffers dylanjeffers deleted the c-4853-fix-edit-collection branch July 23, 2024 16:21
schottra added a commit that referenced this pull request Jul 23, 2024
* main:
  Fix type error from SDK update (#9245)
  Fix same day scheduled release on web (#9240)
  [PAY-3190] Improve profile page pull to refresh (#9241)
  [C-4841] Fix search v2 navigation on mobile (#9233)
  [C-4853] Mobile Edit Collection (#9237)
audius-infra pushed a commit that referenced this pull request Jul 27, 2024
[bea9c85] Fix previously scheduled edit flow (#9278) Dylan Jeffers
[9468507] Improve mobile inner-form revert (#9277) Dylan Jeffers
[15ce2a7] [C-3251] Fix initial state for hidden price-audience field (#9276) Dylan Jeffers
[51a67b4] Fix runtime issue with advanced field (#9275) Dylan Jeffers
[09acfe3] [PAY-3265, PAY-3241] Disallow scheduled playlists in upload/edit; Fix mood placeholder (#9272) Andrew Mendelsohn
[65c886a] [C-4690] Wire up advanced search deep links (#9271) Sebastian Klingler
[deebd52] [C-4874] Update time to 11:59 when scheduling for same day (#9266) Andrew Mendelsohn
[cc407c6] Fix missing refactor bug (#9270) Saliou Diallo
[42e8d11] [PAY-3232] Fix hidden visibility bug when setting price and audience fields (#9268) Saliou Diallo
[523c341] Revert "Update models used in DN reposts endpoints" (#9269) Randy Schott
[89d1e76] [C-4840] Update search screen to auto focus the input (#9263) Kyle Shanks
[9e72dba] [C-4867] Fix collection release date timezone (#9267) Dylan Jeffers
[f5abafe] [C-4866] Fix edit collection form submit (#9262) Dylan Jeffers
[a834436] [PAY-3187] Fix messed up back button form state for payment settings (#9260) Raymond Jacobson
[c3c5b45] [PAY-3196][PAY-3230] Fix miscellaneous editable access issues on mobile (#9258) Saliou Diallo
[823bc63] [C-4793, C-4791] Don't favorite hidden album tracks on purchase (#9254) Andrew Mendelsohn
[6055711] [C-4863] Fix cascading publish on edit collection (#9249) Andrew Mendelsohn
[7500e91] [C-4634] Add popularity sort to users and collections (#9250) Dylan Jeffers
[cd24c79] [C-4843] [C-4846] More advanced search UI fixes (#9252) Sebastian Klingler
[d05de85] [C-4865] Make metadata links visible (#9248) Sebastian Klingler
[8ebbb9d] [C-4847] Reset search filters scroll position (#9242) Sebastian Klingler
[d43760d] PAY-3186 Fixes issue preventing edit screen from opening twice (#9247) Marcus Pasell
[7ffc65c] [C-4834] Animate clear search button for search v2 (#9246) Sebastian Klingler
[24ed1c6] [C-4860] Add waitlist hint for premium album (#9243) Dylan Jeffers
[b336657] Fix type error from SDK update (#9245) Randy Schott
[4fb3d7d] Fix same day scheduled release on web (#9240) Dylan Jeffers
[305a9ef] [PAY-3190] Improve profile page pull to refresh (#9241) Raymond Jacobson
[73a7131] [C-4841] Fix search v2 navigation on mobile (#9233) Sebastian Klingler
[df91fca] [C-4853] Mobile Edit Collection (#9237) Dylan Jeffers
[6473ab1] Update models used in DN reposts endpoints (#9228) Randy Schott
[2c09b40] [C-4792] Disallow Add To Playlist for hidden tracks (#9236) Andrew Mendelsohn
[11f5325] [PAY-3176][PAY-3188][PAY-3193] Include premium tracks in DN playlists for owner (#9234) Saliou Diallo
[f495382] Remove use_sdk_purchase_track and use_sdk_purchase_album feature flags (#9192) Marcus Pasell
[e45bdae] Remove use_sdk_tips feature flag (and fix indexing check) (#9193) Marcus Pasell
[8174034] [C-4832] Fix missing play counts on track tiles (#9230) Kyle Shanks
[20e739c] [QA-1442] Add offline indicator to collection card (#9227) Dylan Jeffers
[fc3648e] [QA-1463] Change order of mobile action buttons (#9229) Reed
[b7ea2fc] [C-4837] Fix links for the searching by electronic subgenre from track page (#9225) Kyle Shanks
[3bd33d4] [QA-1452] Fix edit playlist issues (#9226) Dylan Jeffers
[cedf459] [C-4848] Remove search v2 responsiveness and fix padding on mobile web (#9224) Sebastian Klingler
[e60706c] [C-4842] Fix tag press on mobile for search v2 (#9223) Kyle Shanks
[9e455f2] [C-4829] Fix mobile web drawer overflow (#9220) Dylan Jeffers
[e0af62a] [QA-1458] Fix artwork image loading (#9219) Dylan Jeffers
[4355378] Update dapp-store build artifacts audius-infra
[1aa1dd2] [QA-1455] Fix disappearing playlists in sidebar (#9216) Dylan Jeffers
[9a7ddbf] [C-4643] Feature flag scheduled premium album release (#9215) Dylan Jeffers
[dff2b2d] Bump mobile versions to 107 (#9218) Dylan Jeffers
[42611cb] [PAY-3177][PAY-3185] Fix mobile track publish button (#9213) Saliou Diallo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants