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

OAuth and Developer Apps QA C-2816 C-2815 C-2794 C-2793 C-2795 C-2797 #3681

Merged
merged 3 commits into from
Jul 1, 2023
Merged
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
7 changes: 4 additions & 3 deletions packages/common/src/api/developerApps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { createApi } from 'audius-query'
import { ID } from 'models/Identifiers'
import { encodeHashId } from 'utils/hashIds'

const descriptionMaxLength = 128
export const DEVELOPER_APP_DESCRIPTION_MAX_LENGTH = 128
export const DEVELOPER_APP_NAME_MAX_LENGTH = 50

export const developerAppSchema = z.object({
userId: z.number(),
name: z.string(),
description: z.string().max(descriptionMaxLength).optional()
name: z.string().max(DEVELOPER_APP_NAME_MAX_LENGTH),
description: z.string().max(DEVELOPER_APP_DESCRIPTION_MAX_LENGTH).optional()
})

export type DeveloperApp = {
Expand Down
Binary file modified packages/embed/src/assets/img/Horizontal-Logo-Full-Color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/web/src/components/public-site/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@audius/stems'
import cn from 'classnames'

import horizontalLogo from 'assets/img/publicSite/Horizontal-Logo-Full-Color-Deprecated@2x.png'
import horizontalLogo from 'assets/img/Horizontal-Logo-Full-Color.png'
import {
AUDIUS_HOME_LINK,
AUDIUS_TWITTER_LINK,
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/public-site/NavBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@audius/stems'
import cn from 'classnames'

import HorizontalLogo from 'assets/img/publicSite/Horizontal-Logo-Full-Color-Deprecated@2x.png'
import HorizontalLogo from 'assets/img/Horizontal-Logo-Full-Color.png'
import {
AUDIUS_LISTENING_LINK,
AUDIUS_HOT_AND_NEW,
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/public-site/NavOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
import cn from 'classnames'
import ReactDOM from 'react-dom'

import HorizontalLogo from 'assets/img/Horizontal-Logo-Full-Color.png'
import HeroBackground from 'assets/img/publicSite/Hero-BG@2x.jpg'
import HorizontalLogo from 'assets/img/publicSite/Horizontal-Logo-Full-Color-Deprecated@2x.png'
import {
AUDIUS_BLOG_LINK,
AUDIUS_DISCORD_LINK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.titleContainer {
margin-top: var(--unit-8);
margin-top: var(--unit-4);
text-align: center;
}

Expand All @@ -21,6 +21,9 @@
font-size: var(--font-l);
font-weight: var(--font-bold);
line-height: 140%;
width: 100%;
overflow: hidden;
Copy link
Contributor

Choose a reason for hiding this comment

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

Great call

text-overflow: ellipsis;
}

.loadingStateContainer {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/pages/oauth-login-page/OAuthLoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import cn from 'classnames'
import { useDispatch, useSelector } from 'react-redux'
import { useHistory } from 'react-router-dom'

import HorizontalLogo from 'assets/img/publicSite/Horizontal-Logo-Full-Color-Deprecated@2x.png'
import HorizontalLogo from 'assets/img/Horizontal-Logo-Full-Color.png'
import { make, useRecord } from 'common/store/analytics/actions'
import Input from 'components/data-entry/Input'
import LoadingSpinner from 'components/loading-spinner/LoadingSpinner'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
font-size: var(--font-l);
font-weight: var(--font-bold);
line-height: 20px;
overflow: hidden;
text-overflow: ellipsis;
}

.descriptionLabel {
Expand All @@ -66,6 +68,7 @@
font-size: var(--font-m);
font-weight: var(--font-medium);
line-height: 1.3;
word-wrap: break-word;
}

.keyRoot {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,19 @@
stroke: var(--white);
}

.footer {
.actionsContainer {
display: flex;
gap: var(--unit-2);
}

.errorContainer {
text-align: center;
}

.errorText {
text-align: center;
font-weight: var(--font-bold);
color: var(--accent-red);
font-size: var(--font-m);
line-height: 120%;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { useCallback, useEffect } from 'react'
import { useCallback, useEffect, useState } from 'react'

import {
Status,
accountSelectors,
developerAppSchema,
useAddDeveloperApp,
Name
Name,
DEVELOPER_APP_DESCRIPTION_MAX_LENGTH,
DEVELOPER_APP_NAME_MAX_LENGTH
} from '@audius/common'
import { Button, ButtonType } from '@audius/stems'
import { Form, Formik } from 'formik'
Expand All @@ -30,7 +32,8 @@ const messages = {
descriptionLabel: 'Short Description',
cancel: 'Cancel',
create: 'Create Key',
creating: 'Creating Key'
creating: 'Creating Key',
miscError: 'Sorry, something went wrong. Please try again later.'
}

type CreateNewAppPageProps = CreateAppPageProps
Expand All @@ -41,6 +44,7 @@ export const CreateNewAppPage = (props: CreateNewAppPageProps) => {
const record = useRecord()

const [addDeveloperApp, result] = useAddDeveloperApp()
const [submitError, setSubmitError] = useState<string | null>(null)

const { status, data, errorMessage } = result

Expand All @@ -58,6 +62,7 @@ export const CreateNewAppPage = (props: CreateNewAppPageProps) => {

useEffect(() => {
if (status === Status.ERROR) {
setSubmitError(messages.miscError)
record(
make(Name.DEVELOPER_APP_CREATE_ERROR, {
error: errorMessage
Expand All @@ -68,6 +73,7 @@ export const CreateNewAppPage = (props: CreateNewAppPageProps) => {

const handleSubmit = useCallback(
(values: DeveloperAppValues) => {
setSubmitError(null)
record(
make(Name.DEVELOPER_APP_CREATE_SUBMIT, {
name: values.name,
Expand All @@ -85,8 +91,7 @@ export const CreateNewAppPage = (props: CreateNewAppPageProps) => {
description: ''
}

const isSubmitting = status !== Status.IDLE

const isSubmitting = status !== Status.IDLE && status !== Status.ERROR
return (
<Formik
initialValues={initialValues}
Expand All @@ -99,15 +104,19 @@ export const CreateNewAppPage = (props: CreateNewAppPageProps) => {
name='name'
variant={InputV2Variant.ELEVATED_PLACEHOLDER}
label={messages.appNameLabel}
disabled={isSubmitting}
maxLength={DEVELOPER_APP_NAME_MAX_LENGTH}
/>
<TextAreaField
name='description'
placeholder={messages.descriptionLabel}
showMaxLength
maxLength={developerAppSchema.shape.description.unwrap().maxLength!}
maxLength={DEVELOPER_APP_DESCRIPTION_MAX_LENGTH}
disabled={isSubmitting}
/>
<div className={styles.footer}>
<div className={styles.actionsContainer}>
<Button
buttonType='button'
text={messages.cancel}
fullWidth
type={ButtonType.COMMON_ALT}
Expand All @@ -126,6 +135,11 @@ export const CreateNewAppPage = (props: CreateNewAppPageProps) => {
disabled={isSubmitting}
/>
</div>
{submitError == null ? null : (
<div className={styles.errorContainer}>
<span className={styles.errorText}>{messages.miscError}</span>
</div>
)}
</Form>
)}
</Formik>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
font-size: var(--font-m);
font-weight: var(--font-medium);
color: var(--neutral);
overflow: hidden;
text-overflow: ellipsis;
}

.listItemActions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@

.spinner {
margin: 0 auto;
width: 80px;
height: 80px;
width: 40px;
height: 40px;
}

.divider {
margin: var(--unit-2) 0;
}

.appList {
row-gap: 8px;
display: flex;
flex-direction: column;
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export const YourAppsPage = (props: YourAppsPageProps) => {
<h4 className={styles.appsHeaderText}>{messages.yourAppsTitle}</h4>
{createAppButton}
</div>
<Divider />
<Divider className={styles.divider} />
{status !== Status.SUCCESS ? (
<LoadingSpinner className={styles.spinner} />
) : data?.apps.length === 0 ? (
<p className={styles.noApps}>{messages.noApps}</p>
) : (
<ol>
<ol className={styles.appList}>
{data?.apps.map((app, index) => (
<DeveloperAppListItem
key={app.apiKey}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import cn from 'classnames'
import { Spring } from 'react-spring/renderprops'

import djBackgroundImage from 'assets/img/2-DJ-4-3.jpg'
import audiusLogoHorizontal from 'assets/img/Horizontal-Logo-Full-Color-Deprecated.png'
import audiusLogoHorizontal from 'assets/img/Horizontal-Logo-Full-Color.png'
import signupCtaImage from 'assets/img/signUpCTA.png'
import { RouterContext } from 'components/animated-switch/RouterContextProvider'
import Input from 'components/data-entry/Input'
Expand Down