feat: release asset upload, transfer, Actions secrets/variables/artifacts, admin, teams/projects, file search, reactions, attachments, package version delete
- client: multipart postForm; expo-document-picker + react-native-webview deps - release assets: upload (DocumentPicker) and delete; run artifacts list - repository transfer; Actions secrets + variables management screen - admin (users/orgs/repos) screen gated on is_admin - org teams, repo projects (read-only); find-file via recursive git tree - issue reactions toggle and attachments list; package version delete - endpoint tests (126 total)
This commit is contained in:
1 parent
b2b44bca73
commit
587bf732b5
31 files changed
+1919
-46
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { Linking, Pressable, StyleSheet, View } from 'react-native';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { CommentItem } from '@/components/git/comment';
|
||||
@@ -12,6 +12,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { Icon } from '@/components/ui/icon';
|
||||
import { LabelChip } from '@/components/ui/label-chip';
|
||||
import { ListItem } from '@/components/ui/list-item';
|
||||
import { ErrorState, LoadingView } from '@/components/ui/state-views';
|
||||
import { apiErrorMessage } from '@/core/api/error-text';
|
||||
import { safeHost } from '@/core/api/instance-url';
|
||||
@@ -22,7 +23,10 @@ import {
|
||||
useCreateIssueComment,
|
||||
useDeleteIssueComment,
|
||||
useIssue,
|
||||
useIssueAttachments,
|
||||
useIssueComments,
|
||||
useIssueReactions,
|
||||
useToggleIssueReaction,
|
||||
useUpdateIssue,
|
||||
useUpdateIssueComment,
|
||||
} from '@/features/issues/queries';
|
||||
@@ -34,6 +38,17 @@ import type { ScreenProps } from '@/navigation/typing';
|
||||
|
||||
type Props = ScreenProps<RepositoryStackParamList, 'IssueDetail'>;
|
||||
|
||||
const REACTION_EMOJI: Record<string, string> = {
|
||||
'+1': '👍',
|
||||
'-1': '👎',
|
||||
laugh: '😄',
|
||||
hooray: '🎉',
|
||||
confused: '😕',
|
||||
heart: '❤️',
|
||||
rocket: '🚀',
|
||||
eyes: '👀',
|
||||
};
|
||||
|
||||
/** Full issue view: state, author, labels, milestone, body, comments and composer. */
|
||||
export function IssueDetailScreen({ navigation, route }: Props) {
|
||||
const { t } = useTranslation();
|
||||
@@ -48,6 +63,9 @@ export function IssueDetailScreen({ navigation, route }: Props) {
|
||||
const createComment = useCreateIssueComment(owner, name, index);
|
||||
const updateComment = useUpdateIssueComment(owner, name, index);
|
||||
const deleteComment = useDeleteIssueComment(owner, name, index);
|
||||
const reactionsQuery = useIssueReactions(owner, name, index);
|
||||
const toggleReaction = useToggleIssueReaction(owner, name, index);
|
||||
const attachmentsQuery = useIssueAttachments(owner, name, index);
|
||||
|
||||
if (query.isPending) return <LoadingView />;
|
||||
if (query.isError) {
|
||||
@@ -153,11 +171,59 @@ export function IssueDetailScreen({ navigation, route }: Props) {
|
||||
/>
|
||||
</View>
|
||||
|
||||
{/* Reactions */}
|
||||
<View style={styles.reactions}>
|
||||
{Object.entries(REACTION_EMOJI).map(([content, emoji]) => {
|
||||
const list = (reactionsQuery.data ?? []).filter((reaction) => reaction.content === content);
|
||||
const mine = list.some((reaction) => reaction.user?.login === account?.login);
|
||||
return (
|
||||
<Pressable
|
||||
key={content}
|
||||
onPress={() => toggleReaction.mutate({ content, mine })}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={content}
|
||||
style={[
|
||||
styles.reactionChip,
|
||||
{
|
||||
borderColor: mine ? colors.primary : colors.border,
|
||||
backgroundColor: mine ? colors.primaryMuted : colors.surface,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<AppText variant="caption">{emoji}</AppText>
|
||||
{list.length > 0 ? (
|
||||
<AppText variant="caption" tone={mine ? 'primary' : 'tertiary'}>
|
||||
{list.length}
|
||||
</AppText>
|
||||
) : null}
|
||||
</Pressable>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
|
||||
{/* Attachments */}
|
||||
{attachmentsQuery.data && attachmentsQuery.data.length > 0 ? (
|
||||
<Card padded={false} variant="flat">
|
||||
{attachmentsQuery.data.map((attachment, attachmentIndex) => (
|
||||
<ListItem
|
||||
key={attachment.id ?? attachment.name ?? attachmentIndex}
|
||||
leadingIcon="file"
|
||||
title={attachment.name ?? ''}
|
||||
onPress={() =>
|
||||
attachment.browser_download_url
|
||||
? void Linking.openURL(attachment.browser_download_url).catch(() => undefined)
|
||||
: undefined
|
||||
}
|
||||
divider={attachmentIndex < (attachmentsQuery.data?.length ?? 0) - 1}
|
||||
/>
|
||||
))}
|
||||
</Card>
|
||||
) : null}
|
||||
|
||||
{/* Comments */}
|
||||
<AppText variant="subheading" style={styles.sectionTitle}>
|
||||
{t('comments.title')}
|
||||
</AppText>
|
||||
|
||||
{commentsQuery.isPending ? (
|
||||
<LoadingView label={t('comments.loading')} />
|
||||
) : commentsQuery.isError ? (
|
||||
@@ -234,5 +300,16 @@ const styles = StyleSheet.create({
|
||||
bodyCard: { minHeight: 80 },
|
||||
metaGrid: { gap: spacing.sm },
|
||||
metaRow: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm },
|
||||
reactions: { flexDirection: 'row', flexWrap: 'wrap', gap: spacing.sm },
|
||||
reactionChip: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
gap: spacing.xs,
|
||||
borderWidth: 1,
|
||||
borderRadius: 999,
|
||||
paddingHorizontal: spacing.sm,
|
||||
paddingVertical: 2,
|
||||
minHeight: 32,
|
||||
},
|
||||
sectionTitle: { marginTop: spacing.md },
|
||||
});
|
||||
Reference in new issue
Block a user