Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camille #152

Merged
merged 13 commits into from
Dec 3, 2024
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
44 changes: 22 additions & 22 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/bin/bash
#cSpell:disable

echo "!!! ATTENTION !!!"
echo "DO NOT CLOSE THIS TERMINAL WINDOW UNTIL THE SETUP IS COMPLETE"
echo "!!! ATTENTION !!!"
echo ""

sleep 1

corepack use yarn@*
pushd packages/portal
corepack use yarn@*
popd
pushd packages/mobile
corepack use yarn@*
popd
pushd packages/server
corepack use yarn@*
popd
pushd packages/common
corepack use yarn@*
popd

yarn install
# echo "!!! ATTENTION !!!"
# echo "DO NOT CLOSE THIS TERMINAL WINDOW UNTIL THE SETUP IS COMPLETE"
# echo "!!! ATTENTION !!!"
# echo ""

# sleep 1

# corepack use yarn@*
# pushd packages/portal
# corepack use yarn@*
# popd
# pushd packages/mobile
# corepack use yarn@*
# popd
# pushd packages/server
# corepack use yarn@*
# popd
# pushd packages/common
# corepack use yarn@*
# popd

# yarn install

zrok config set apiEndpoint https://tunnel.danceblue.org

Expand Down
68 changes: 65 additions & 3 deletions packages/common/lib/api/resources/Feed.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Field, ObjectType } from "type-graphql";
import { URLResolver } from "graphql-scalars";
import { Field, InterfaceType, ObjectType } from "type-graphql";

import { createNodeClasses, Node } from "../relay.js";
import type { GlobalId } from "../scalars/GlobalId.js";
import { GlobalIdScalar } from "../scalars/GlobalId.js";
import { ImageNode } from "./Image.js";
import { TimestampedResource } from "./Resource.js";

// TODO: Expand this to include more types of feed items
Expand All @@ -16,10 +18,70 @@ import { TimestampedResource } from "./Resource.js";
// description: "Dictates how to interpret the resource link",
// });

@InterfaceType()
export class FeedItem {
@Field(() => GlobalIdScalar)
id!: GlobalId;

@Field(() => String)
title!: string;

@Field(() => String, { nullable: true })
textContent?: string | undefined | null;

@Field(() => ImageNode, { nullable: true })
image?: ImageNode | undefined | null;

@Field(() => URLResolver, { nullable: true })
link?: URL | undefined | null;

@Field(() => Date, { nullable: true })
createdAt!: Date;
}

@ObjectType({
implements: [Node, FeedItem],
})
export class InstagramFeedNode
extends TimestampedResource
implements Node, FeedItem
{
@Field(() => GlobalIdScalar)
id!: GlobalId;

@Field(() => String)
title!: string;

@Field(() => String, { nullable: true })
textContent?: string | undefined | null;

@Field(() => ImageNode, { nullable: true })
image?: ImageNode | undefined | null;

@Field(() => URLResolver, { nullable: true })
link?: URL | undefined | null;

public getUniqueId(): string {
return this.id.id;
}

public static init(init: {
id: string;
title: string;
textContent?: string | undefined | null;
image?: ImageNode | undefined | null;
link?: URL | undefined | null;
createdAt?: Date;
updatedAt?: Date;
}) {
return InstagramFeedNode.createInstance().withValues(init);
}
}

@ObjectType({
implements: [Node],
implements: [Node, FeedItem],
})
export class FeedNode extends TimestampedResource implements Node {
export class FeedNode extends TimestampedResource implements Node, FeedItem {
@Field(() => GlobalIdScalar)
id!: GlobalId;

Expand Down
10 changes: 10 additions & 0 deletions packages/common/lib/error/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ export abstract class ConcreteError {
return undefined;
}
abstract get tag(): ErrorCodeType;

toString() {
return this.message === this.detailedMessage
? this.message
: `${this.message} - ${this.detailedMessage}`;
}

[Symbol.toStringTag]() {
return this.toString();
}
}

export interface GraphQLFormattedErrorExtensions {
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile/src/context/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { ReactNode } from "react";
import { createContext, useContext, useEffect } from "react";
import { useQuery } from "urql";

import { Logger } from "@/common/logger/Logger.js";
import { graphql } from "@/graphql/index.js";
import { Logger } from "@/common/logger/Logger";
import { graphql } from "@/graphql/index";

export interface AuthState {
personUuid: string | null;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { FontAwesome, FontAwesome5 } from "@expo/vector-icons";
import { openURL } from "expo-linking";
import { openBrowserAsync } from "expo-web-browser";
import { Box, Button, HStack, Text, VStack } from "native-base";
import {
PixelRatio,
StatusBar,
TouchableOpacity,
useWindowDimensions,
} from "react-native";
import { PixelRatio, StatusBar, useWindowDimensions } from "react-native";
import { TouchableOpacity } from "react-native-gesture-handler";

import { universalCatch } from "@/common/logging";

Expand Down
Loading
Loading