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

[C-2926] Implement selected values for upload contextual menu fields - #3848

Merged
dylanjeffers merged 10 commits into
mainfrom
dj-c-2926-selected-value
Aug 10, 2023
Merged

dylanjeffers merged 10 commits into
mainfrom
dj-c-2926-selected-value

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Description

Adds selected values for each of the upload contextual menu fields.

@dylanjeffers
dylanjeffers requested review from a team, Kyle-Shanks and amendelsohn and removed request for a team August 3, 2023 15:24
@audius-infra

Copy link
Copy Markdown
Collaborator

Preview this change https://demo.audius.co/dj-c-2926-selected-value

@amendelsohn amendelsohn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really nice! Love the renderValue pattern!

? {
...styleProp,
'--icon-color': toCSSVariableName(color)
'--icon-color': `var(${toCSSVariableName(color)})`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

omg is that why it wasn't working?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah fairly tragic, lol

@@ -1,5 +1,5 @@
.root {
gap: var(--unit-2);
gap: var(--unit-4);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We do have cn(layoutStyles.col, layoutStyles.gap4) for this. Unsure if it's worth doing when we also have custom styling. Though we could also include padding if we do a Box or similar. No need to change here, but just gathering use cases for layout patterns.

Comment on lines +99 to +105
<div className={styles.advancedOptions}>
<ReleaseDateField />
<RemixSettingsField />
<SourceFilesField />
<AccessAndSaleField />
<AttributionField />
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! I like pulling them straight in here. The name advancedOptions doesn't resonate but I don't think I have a better one

@dylanjeffers dylanjeffers Aug 10, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah agreed id like a better name, something we can consider with product team during our qa runthroughs imo, make sure we understand each section and what its intent is, maybe additionalOptions?

export const TrackAvailabilityModalForm = () => {
export const AccessAndSaleField = () => {
// Fields from the outer form
const [{ value: isUnlistedValue }, , { setValue: setIsUnlistedValue }] =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah that's more readable. Ty!

<Text className={styles.title} variant='title' size='large'>
{messages.title}
</Text>
const renderValue = useCallback(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dang so many cases

Comment on lines +51 to +54
/**
* This is a subform that expects to exist within a parent TrackEdit form.
* The useField calls reference the outer form's fields which much match the name constants.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we update this now that we have ContextualMenu? Maybe now the comment goes on the fields component?

Comment on lines +2 to +4
display: flex;
flex-direction: column;
gap: var(--unit-6);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

layoutStyles

<Text>{messages.description}</Text>
</div>
)
const renderValue = () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems like there are multiple values a lot of the time.
Should this be renderValues or do we consider the whole ContextualMenu to be one 'Field' with a single composite 'value' per the name of this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah defintely agree with thoughts here. "value" was chosen cause each field has a value like you said, but could see using language like "renderSelectedLabels" which would be in line with what the mockups are saying. That would require changing a bunch of the component names too which im totally down. for also. ill make a tech-debt story to start collecting these great ideas.

Comment on lines 8 to +10
display: flex;
flex-direction: column;
gap: var(--unit-2);
gap: var(--unit-4);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

layoutStyles

import { moodMap } from 'utils/Moods'

import { getTrackFieldName } from '../forms/utils'
import { getTrackFieldName } from '../hooks'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know I did this, but feels weird to import a regular function from a hooks file 🤔

@gitguardian

gitguardian Bot commented Aug 10, 2023 •

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
1606949 Generic High Entropy Secret d826b16 packages/web/.env/.env.prod View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@dylanjeffers
dylanjeffers merged commit 4c0b25f into main Aug 10, 2023
@dylanjeffers
dylanjeffers deleted the dj-c-2926-selected-value branch August 10, 2023 06:13
schottra added a commit that referenced this pull request Aug 10, 2023
* origin/main:
  [C-2926] Implement selected values for upload contextual menu fields (#3848)
  Preserve CIDs for track and collection cover arts (#3866)
audius-infra pushed a commit that referenced this pull request Aug 12, 2023
[3436c20] [PAY-1701] Fix "Share to DMs" to work through InboxUnavailableModal (#3874) Marcus Pasell
[a740243] Add sdk:update-hotfix (#3875) Dylan Jeffers
[a25fd19] [C-2759] Make donation link external (#3872) Dylan Jeffers
[15f056c] [PAY-1630] Wire up purchase content sagas (#3834) Randy Schott
[998d44b] Fix mobile crash on drawer dismiss (#3871) Reed
[7d0e0b3] [PAY-1430] "Leaving Audius" Warning for External Links (and createModal helper) (#3860) Marcus Pasell
[bee8bd1] Remove .only on upload cypress test (#3869) Raymond Jacobson
[4c0b25f] [C-2926] Implement selected values for upload contextual menu fields (#3848) Dylan Jeffers
[5773578] Preserve CIDs for track and collection cover arts (#3866) Marcus Pasell
[be0d278] [C-2930] Fix extra space after username in tip to unlock modal (#3845) nicoback2
[f5320be] QA-588 Fix collection card profile link  (#3853) nicoback2
[360416e] Fix broken playlist fetch via resolve (#3863) Raymond Jacobson
[2dc2c29] [PAY-1695] DMs: Entrypoint Analytics (#3862) Marcus Pasell
[f80d366] Minor improvements to SEO flow merged in #3859 (#3861) Raymond Jacobson
[b99d62f] Add nodes to env for SEO support (#3859) Raymond Jacobson
[20476ee] [C-2941] Modify cloudflare worker to pull in SEO data from discovery nodes (#3858) Raymond Jacobson
[7f79830] [C-2879] Add validation to single track upload flow (#3855) Kyle Shanks
[6f4fc89] [C-2940] Update google analytics tags and fix embed build (#3856) Raymond Jacobson
[3469c89] [C-2852 PLAT-1094 PLAT-1093] Add fetch collection by permalink (#3751) Dylan Jeffers
@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