Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/common/src/services/remote-config/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ export enum FeatureFlags {
PAID_SCHEDULED = 'paid_scheduled',
NETWORK_CUT_ENABLED = 'network_cut_enabled',
SOCIAL_SIGNUP = 'social_signup',
RIGHTS_AND_COVERS = 'rights_and_covers',
GUEST_CHECKOUT = 'guest_checkout',
TRACK_AUDIO_REPLACE = 'track_audio_replace',
OWN_YOUR_FANS = 'own_your_fans',
FAST_REFERRAL = 'fast_referral',
REACT_QUERY_SYNC = 'react_query_sync',
TRACK_REPLACE_DOWNLOADS = 'track_replace_downloads',
Expand Down Expand Up @@ -63,9 +61,7 @@ export const flagDefaults: FlagDefaults = {
[FeatureFlags.GUEST_CHECKOUT]: false,
[FeatureFlags.NETWORK_CUT_ENABLED]: false,
[FeatureFlags.SOCIAL_SIGNUP]: false,
[FeatureFlags.RIGHTS_AND_COVERS]: false,
[FeatureFlags.TRACK_AUDIO_REPLACE]: false,
[FeatureFlags.OWN_YOUR_FANS]: false,
[FeatureFlags.FAST_REFERRAL]: false,
[FeatureFlags.REACT_QUERY_SYNC]: false,
[FeatureFlags.TRACK_REPLACE_DOWNLOADS]: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useFeatureFlag } from '@audius/common/hooks'
import { FeatureFlags } from '@audius/common/services'
import { useField } from 'formik'

import { Box, Flex } from '@audius/harmony-native'
Expand Down Expand Up @@ -32,10 +30,6 @@ export const TrackPriceField = () => {
const [{ value: isOwnedByUser }, _ignored, { setValue: setIsOwnedByUser }] =
useField<boolean>(IS_OWNED_BY_USER)

const { isEnabled: isRightsAndCoversEnabled } = useFeatureFlag(
FeatureFlags.RIGHTS_AND_COVERS
)

return (
<BoxedTextField
title={messages.title}
Expand All @@ -50,33 +44,31 @@ export const TrackPriceField = () => {
</Text>
}
>
{isRightsAndCoversEnabled ? (
<Box>
<Flex
direction='row'
justifyContent='space-between'
alignItems='center'
mb='s'
gap='xs'
>
<Text weight='bold'>{messages.publishingRights.checkboxLabel}</Text>
<Switch
value={isOwnedByUser}
onValueChange={(value) => {
setIsOwnedByUser(value)
}}
/>
</Flex>
<Text>{messages.publishingRights.confirmationText}</Text>
<Box as='ul' mt='s'>
{messages.publishingRights.bulletPoints.map((point) => (
<Box key={point} mb='s'>
<Text bulleted>{point}</Text>
</Box>
))}
</Box>
<Box>
<Flex
direction='row'
justifyContent='space-between'
alignItems='center'
mb='s'
gap='xs'
>
<Text weight='bold'>{messages.publishingRights.checkboxLabel}</Text>
<Switch
value={isOwnedByUser}
onValueChange={(value) => {
setIsOwnedByUser(value)
}}
/>
</Flex>
<Text>{messages.publishingRights.confirmationText}</Text>
<Box as='ul' mt='s'>
{messages.publishingRights.bulletPoints.map((point) => (
<Box key={point} mb='s'>
<Text bulleted>{point}</Text>
</Box>
))}
</Box>
) : null}
</Box>
</BoxedTextField>
)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from 'react'

import { useFeatureFlag } from '@audius/common/hooks'
import { advancedTrackMessages as messages } from '@audius/common/messages'
import { FeatureFlags } from '@audius/common/services'
Expand All @@ -22,9 +24,6 @@ export const AdvancedScreen = () => {
const { isEnabled: isCommentsEnabled } = useFeatureFlag(
FeatureFlags.COMMENTS_ENABLED
)
const { isEnabled: isRightsAndCoversEnabled } = useFeatureFlag(
FeatureFlags.RIGHTS_AND_COVERS
)

return (
<FormScreen
Expand All @@ -47,7 +46,7 @@ export const AdvancedScreen = () => {
)}
<LicenseTypeField />
<IsrcField />
{isRightsAndCoversEnabled ? <CoverAttributionField /> : <></>}
<CoverAttributionField />
</SubmenuList>
</FormScreen>
)
Expand Down
105 changes: 49 additions & 56 deletions packages/web/src/components/edit/fields/AdvancedField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ export const AdvancedField = ({ isUpload }: AdvancedFieldProps) => {
}

const AdvancedModalFields = ({ isUpload }: { isUpload?: boolean }) => {
const { isEnabled: isRightsAndCoversEnabled } = useFeatureFlag(
FeatureFlags.RIGHTS_AND_COVERS
)
const [aiUserIdField, aiUserHelperFields, { setValue: setAiUserId }] =
useField({
name: AI_USER_ID,
Expand Down Expand Up @@ -583,62 +580,58 @@ const AdvancedModalFields = ({ isUpload }: { isUpload?: boolean }) => {
</span>
</div>
<Divider />
{isRightsAndCoversEnabled ? (
<>
<SwitchRowField
name={IS_COVER}
header={messages.coverAttribution.toggle.header}
description={messages.coverAttribution.toggle.description}

<>
<SwitchRowField
name={IS_COVER}
header={messages.coverAttribution.toggle.header}
description={messages.coverAttribution.toggle.description}
>
<Box
mt='m'
p='l'
w='100%'
borderRadius='m'
backgroundColor='surface1'
border='default'
>
<Box
mt='m'
p='l'
w='100%'
borderRadius='m'
backgroundColor='surface1'
border='default'
>
<Text variant='title' size='m'>
{messages.coverAttribution.attribution.header}
<Text variant='title' size='m'>
{messages.coverAttribution.attribution.header}
</Text>
<Box mb='m'>
<Text variant='body'>
{messages.coverAttribution.attribution.description}
</Text>
<Box mb='m'>
<Text variant='body'>
{messages.coverAttribution.attribution.description}
</Text>
</Box>
<Flex gap='m'>
<TextField
name={COVER_ORIGINAL_SONG_TITLE}
label={
messages.coverAttribution.attribution.originalSongTitle
}
placeholder={
messages.coverAttribution.attribution.originalSongTitle
}
value={coverOriginalSongTitle || ''}
onChange={(e) => {
setCoverOriginalSongTitle(e.target.value)
}}
/>
<TextField
name={COVER_ORIGINAL_ARTIST}
label={
messages.coverAttribution.attribution.originalSongArtist
}
placeholder={
messages.coverAttribution.attribution.originalSongArtist
}
value={coverOriginalArtist || ''}
onChange={(e) => {
setCoverOriginalArtist(e.target.value)
}}
/>
</Flex>
</Box>
</SwitchRowField>
<Divider />
</>
) : null}
<Flex gap='m'>
<TextField
name={COVER_ORIGINAL_SONG_TITLE}
label={messages.coverAttribution.attribution.originalSongTitle}
placeholder={
messages.coverAttribution.attribution.originalSongTitle
}
value={coverOriginalSongTitle || ''}
onChange={(e) => {
setCoverOriginalSongTitle(e.target.value)
}}
/>
<TextField
name={COVER_ORIGINAL_ARTIST}
label={messages.coverAttribution.attribution.originalSongArtist}
placeholder={
messages.coverAttribution.attribution.originalSongArtist
}
value={coverOriginalArtist || ''}
onChange={(e) => {
setCoverOriginalArtist(e.target.value)
}}
/>
</Flex>
</Box>
</SwitchRowField>
<Divider />
</>

<SwitchRowField
name={IS_AI_ATTRIBUTED}
header={messages.aiGenerated.header}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useCallback } from 'react'

import { useFeatureFlag } from '@audius/common/hooks'
import { FeatureFlags } from '@audius/common/services'
import { Box, Checkbox, Flex, Text } from '@audius/harmony'
import { css } from '@emotion/react'
import { useField } from 'formik'
Expand All @@ -21,9 +19,6 @@ const messages = {
}

export const RightsDeclaration = () => {
const { isEnabled: isRightsAndCoversEnabled } = useFeatureFlag(
FeatureFlags.RIGHTS_AND_COVERS
)
const [
{ value: isFullyOwnedByUser },
_ignored1,
Expand All @@ -34,10 +29,6 @@ export const RightsDeclaration = () => {
setIsFullyOwnedByUser(!isFullyOwnedByUser)
}, [isFullyOwnedByUser, setIsFullyOwnedByUser])

if (!isRightsAndCoversEnabled) {
return null
}

return (
<Box onClick={handleBoxClick}>
<Flex alignItems='center' justifyContent='flex-start' mb='s' gap='xs'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useCallback, useEffect, useState } from 'react'

import { useFeatureFlag } from '@audius/common/hooks'
import { FeatureFlags } from '@audius/common/services'
import { accountSelectors } from '@audius/common/store'
import { route } from '@audius/common/utils'
import {
Expand Down Expand Up @@ -60,10 +58,6 @@ export const PayAndEarnPage = ({ tableView }: PayAndEarnPageProps) => {
}
}, [accountHasTracks, setSelectedTable, tableView, setTableOptions, isGuest])

const { isEnabled: isOwnYourFansEnabled } = useFeatureFlag(
FeatureFlags.OWN_YOUR_FANS
)

const {
count: salesCount,
data: sales,
Expand All @@ -72,7 +66,6 @@ export const PayAndEarnPage = ({ tableView }: PayAndEarnPageProps) => {
onClickRow: onSalesClickRow,
isEmpty: isSalesEmpty,
isLoading: isSalesLoading,
downloadCSV: downloadSalesCSV,
downloadSalesAsCSVFromJSON
} = useSales()
const {
Expand Down Expand Up @@ -101,9 +94,7 @@ export const PayAndEarnPage = ({ tableView }: PayAndEarnPageProps) => {
const tables: Record<TableType, TableMetadata> = {
[TableType.SALES]: {
label: messages.sales,
downloadCSV: isOwnYourFansEnabled
? downloadSalesAsCSVFromJSON
: downloadSalesCSV,
downloadCSV: downloadSalesAsCSVFromJSON,
isDownloadCSVButtonDisabled: isSalesLoading || isSalesEmpty
},
[TableType.PURCHASES]: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useCallback, useState } from 'react'

import { useFeatureFlag } from '@audius/common/hooks'
import { FeatureFlags } from '@audius/common/services'
import { accountSelectors } from '@audius/common/store'
import { route } from '@audius/common/utils'
import {
Expand Down Expand Up @@ -65,10 +63,6 @@ export const TransactionHistoryPage = ({
}
})

const { isEnabled: isOwnYourFansEnabled } = useFeatureFlag(
FeatureFlags.OWN_YOUR_FANS
)

const {
count: salesCount,
data: sales,
Expand All @@ -77,7 +71,6 @@ export const TransactionHistoryPage = ({
onClickRow: onSalesClickRow,
isEmpty: isSalesEmpty,
isLoading: isSalesLoading,
downloadCSV: downloadSalesCSV,
downloadSalesAsCSVFromJSON
} = useSales()
const {
Expand Down Expand Up @@ -106,9 +99,7 @@ export const TransactionHistoryPage = ({
const tables: Record<TableType, TableMetadata> = {
[TableType.SALES]: {
label: messages.sales,
downloadCSV: isOwnYourFansEnabled
? downloadSalesAsCSVFromJSON
: downloadSalesCSV,
downloadCSV: downloadSalesAsCSVFromJSON,
isDownloadCSVButtonDisabled: isSalesLoading || isSalesEmpty
},
[TableType.PURCHASES]: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useCallback, useState } from 'react'

import { useFeatureFlag } from '@audius/common/hooks'
import { FeatureFlags } from '@audius/common/services'
import { accountSelectors } from '@audius/common/store'
import { route } from '@audius/common/utils'
import {
Expand Down Expand Up @@ -64,10 +62,6 @@ export const TransactionHistoryPage = ({
}
})

const { isEnabled: isOwnYourFansEnabled } = useFeatureFlag(
FeatureFlags.OWN_YOUR_FANS
)

const {
count: salesCount,
data: sales,
Expand All @@ -76,7 +70,6 @@ export const TransactionHistoryPage = ({
onClickRow: onSalesClickRow,
isEmpty: isSalesEmpty,
isLoading: isSalesLoading,
downloadCSV: downloadSalesCSV,
downloadSalesAsCSVFromJSON
} = useSales()
const {
Expand All @@ -103,9 +96,7 @@ export const TransactionHistoryPage = ({
const tables: Record<TableType, TableMetadata> = {
[TableType.SALES]: {
label: messages.sales,
downloadCSV: isOwnYourFansEnabled
? downloadSalesAsCSVFromJSON
: downloadSalesCSV,
downloadCSV: downloadSalesAsCSVFromJSON,
isDownloadCSVButtonDisabled: isSalesLoading || isSalesEmpty
},
[TableType.PURCHASES]: {
Expand Down