Skip to content

Commit

Permalink
[Temp] Better handle private events not working
Browse files Browse the repository at this point in the history
  • Loading branch information
brunolemos committed May 26, 2019
1 parent 2228aa6 commit 099b844
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
24 changes: 24 additions & 0 deletions packages/components/src/components/cards/EventCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { FlatList, FlatListProps } from '../../libs/flatlist'
import { Platform } from '../../libs/platform'
import * as actions from '../../redux/actions'
import { Button } from '../common/Button'
import { ButtonLink } from '../common/ButtonLink'
import { fabSize } from '../common/FAB'
import { RefreshControl } from '../common/RefreshControl'
import { Spacer } from '../common/Spacer'
Expand All @@ -29,6 +30,7 @@ import { useTheme } from '../context/ThemeContext'
import { fabSpacing, shouldRenderFAB } from '../layout/FABRenderer'
import { EmptyCards, EmptyCardsProps } from './EmptyCards'
import { EventCard, EventCardProps } from './EventCard'
import { GenericMessageWithButtonView } from './GenericMessageWithButtonView'
import {
CardItemSeparator,
getCardItemSeparatorThemeColor,
Expand Down Expand Up @@ -313,6 +315,28 @@ export const EventCards = React.memo((props: EventCardsProps) => {
}

if (!(items && items.length)) {
if (errorMessage === 'Resource not accessible by integration') {
return (
<GenericMessageWithButtonView
buttonView={
!!refresh && (
<ButtonLink
analyticsLabel="open_private_issue"
children="Open GitHub Issue To Upvote"
disabled={loadState !== 'error'}
href="https://github.com/devhubapp/devhub/issues/140"
loading={loadState === 'loading'}
/>
)
}
emoji="confused"
fullCenter
title="Private access temporarily disabled"
subtitle="GitHub has temporarily disabled private access for GitHub Apps on their API. Please upvote the issue below to show your interest on a fix."
/>
)
}

return (
<EmptyCards
clearedAt={column.filters && column.filters.clearedAt}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ import { ThemedText } from '../themed/ThemedText'
export interface GenericMessageWithButtonViewProps {
buttonView: React.ReactNode
emoji: GitHubEmoji | null
fullCenter?: boolean
style?: ViewProps['style']
subtitle: string | undefined | null
title: string | undefined | null
style?: ViewProps['style']
}

export const GenericMessageWithButtonView = React.memo(
(props: GenericMessageWithButtonViewProps) => {
const { buttonView, emoji, style, subtitle, title } = props
const { buttonView, emoji, fullCenter, style, subtitle, title } = props

const emojiImageURL = emoji ? getEmojiImageURL(emoji) : null

return (
<View
style={[
fullCenter && {
flex: 1,
alignContent: 'center',
alignItems: 'center',
justifyContent: 'center',
},
{
width: '100%',
padding: contentPadding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const columnTypes: Array<{
subtype: 'REPO_EVENTS',
},
paramList: ['owner', 'repo'],
isPrivateSupported: true,
isPrivateSupported: false, // https://github.com/devhubapp/devhub/issues/140
},
},
{
Expand Down

0 comments on commit 099b844

Please sign in to comment.