Skip to content

Commit

Permalink
Merge branch 'main' into route-planning
Browse files Browse the repository at this point in the history
  • Loading branch information
bwees authored Jul 29, 2024
2 parents c0f31ef + 76054c1 commit 1b98d40
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 35 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Reveille Rides
[![API Canary](https://github.com/Reveille-Rides/canary/actions/workflows/canary.yml/badge.svg)](https://github.com/Reveille-Rides/canary/actions/workflows/canary.yml)
# Maroon Rides
[![API Canary](https://github.com/Maroon-Rides/canary/actions/workflows/canary.yml/badge.svg)](https://github.com/Maroon-Rides/canary/actions/workflows/canary.yml)

We are building the best native mobile app for the Texas A&M University bus system.

![image](https://github.com/Reveille-Rides/ReveilleRides/assets/12686250/24bd445d-4f89-4fab-9e70-fd90d7d352c7)
![header image](https://github.com/Maroon-Rides/MaroonRides/assets/12686250/b51a0437-7fe2-4780-ae4e-4fb76f90aae0)

26 changes: 23 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"expo": {
"name": "Reveille Rides",
"slug": "reveillerides",
"version": "1.3.1",
"name": "Maroon Rides",
"slug": "Maroon Rides",
"version": "1.4.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "automatic",
Expand All @@ -20,6 +20,26 @@
"resizeMode": "cover",
"backgroundColor": "#191919"
}
},
"privacyManifests": {
"NSPrivacyAccessedAPITypes": [
{
"NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategorySystemBootTime",
"NSPrivacyAccessedAPITypeReasons": ["35F9.1"]
},
{
"NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategoryDiskSpace",
"NSPrivacyAccessedAPITypeReasons": ["85F4.1"]
},
{
"NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategoryFileTimestamp",
"NSPrivacyAccessedAPITypeReasons": ["DDA9.1"]
},
{
"NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategoryUserDefaults",
"NSPrivacyAccessedAPITypeReasons": ["CA92.1"]
}
]
}
},
"android": {
Expand Down
2 changes: 1 addition & 1 deletion app/components/map/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ const Map: React.FC = () => {
tintColor={selectedRoute?.directionList[0]?.lineColor ?? "#FFFF"}
active={patternPath.directionKey === selectedRouteDirection}
route={selectedRoute}
direction={selectedRoute?.directionList[0]!.direction}
direction={patternPath.directionKey}
isCalloutShown={poppedUpStopCallout?.stopCode === stop.stopCode}
/>
);
Expand Down
14 changes: 7 additions & 7 deletions app/components/map/StopCallout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { memo } from 'react'
import { View, Text, ActivityIndicator, TouchableOpacity } from 'react-native'
import { Callout } from 'react-native-maps'
import BusIcon from '../ui/BusIcon'
import { IDirection, IMapRoute, IStop } from '../../../utils/interfaces'
import { IMapRoute, IStop } from '../../../utils/interfaces'
import { useStopEstimate } from 'app/data/api_query'
import moment from 'moment'
import CalloutTimeBubble from '../ui/CalloutTimeBubble'
Expand All @@ -14,23 +14,23 @@ interface Props {
stop: IStop
tintColor: string
route: IMapRoute
direction: IDirection
direction: string
}

// Stop callout with time bubbles
const StopCallout: React.FC<Props> = ({ stop, tintColor, route, direction }) => {

const scrollToStop = useAppStore(state => state.scrollToStop);

const { data: estimate, isLoading } = useStopEstimate(route.key, direction.key, stop.stopCode);
const { data: estimate, isLoading } = useStopEstimate(route.key, direction, stop.stopCode);

return (
<Callout
style={{
alignItems: 'center',
justifyContent: 'center',
width: 215,
height: 50,
height: 60,
zIndex: 1000,
elevation: 1000
}}
Expand All @@ -50,7 +50,9 @@ const StopCallout: React.FC<Props> = ({ stop, tintColor, route, direction }) =>
<AmenityRow amenities={estimate?.amenities || []} color={lightMode.subtitle} size={18}/>
</TouchableOpacity>

{ estimate?.routeDirectionTimes[0]?.nextDeparts.length !== 0 ?
{ isLoading ?
<ActivityIndicator style={{ marginTop: 8 }} />
: ( estimate?.routeDirectionTimes[0]?.nextDeparts.length !== 0 ?
<View style={{
flexDirection: "row",
justifyContent: "center",
Expand All @@ -74,8 +76,6 @@ const StopCallout: React.FC<Props> = ({ stop, tintColor, route, direction }) =>
})}
<View style={{flex: 1}} />
</View>
: ( isLoading ?
<ActivityIndicator style={{ marginTop: 8 }} />
:
<Text style={{ marginTop: 8, alignSelf: "center", color: lightMode.subtitle, fontSize: 12 }}>No upcoming departures</Text>
)
Expand Down
7 changes: 3 additions & 4 deletions app/components/map/markers/BusMarker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ const BusMarker: React.FC<Props> = ({ bus, tintColor, routeName }) => {

//if direction is not selected and route is inactive, then call setSelectedDirection w/ parameter bus.directionKey
const busDefaultDirection = () => {
if (selectedRouteDirection !== bus.directionKey)
{
setSelectedDirection(bus.directionKey);
}
if (selectedRouteDirection !== bus.directionKey) {
setSelectedDirection(bus.directionKey);
}
}


Expand Down
6 changes: 3 additions & 3 deletions app/components/map/markers/StopMarker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { memo, useEffect } from 'react';
import { MapMarker, Marker } from 'react-native-maps';
import { IDirection, IMapRoute, IPatternPoint } from 'utils/interfaces';
import { IMapRoute, IPatternPoint } from 'utils/interfaces';
import StopCallout from '../StopCallout';
import { View } from 'react-native';
import { getLighterColor } from 'app/utils';
Expand All @@ -11,7 +11,7 @@ interface Props {
point: IPatternPoint
tintColor: string
route: IMapRoute
direction: IDirection
direction: string
isCalloutShown?: boolean
active: boolean
}
Expand All @@ -30,7 +30,7 @@ const StopMarker: React.FC<Props> = ({ point, tintColor, route, direction, isCal

const defaultDirection = () => {
if (active == false) {
setSelectedDirection(direction.key);
setSelectedDirection(direction);
}
}

Expand Down
10 changes: 10 additions & 0 deletions app/components/sheets/AlertDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import Ionicons from '@expo/vector-icons/Ionicons';
import useAppStore from "../../data/app_state";
import SheetHeader from "../ui/SheetHeader";
import RenderHtml from 'react-native-render-html';
import { useRoutes } from "app/data/api_query";


const AlertDetails: React.FC<{ sheetRef: React.RefObject<BottomSheetModal> }> = ({ sheetRef }) => {
const snapPoints = ['25%', '45%', '85%'];
const alert = useAppStore((state) => state.selectedAlert);
const theme = useAppStore((state) => state.theme);
const setDrawnRoutes = useAppStore((state) => state.setDrawnRoutes);
const { data: routes } = useRoutes();

const tagStyles = {
h3: { fontSize: 32, fontWeight: "bold", marginTop: 24, marginBottom: 8, color: theme.text },
Expand All @@ -26,6 +29,13 @@ const AlertDetails: React.FC<{ sheetRef: React.RefObject<BottomSheetModal> }> =
index={1}
backgroundStyle={{backgroundColor: theme.background}}
handleIndicatorStyle={{backgroundColor: theme.divider}}
onAnimate={(_, to) => {
if (to === 1) {
const affectedRoutes = routes?.filter(route => route.directionList.flatMap(direction => direction.serviceInterruptionKeys).includes(Number(alert?.key)));
setDrawnRoutes(affectedRoutes ?? [])
console.log(affectedRoutes?.length)
}
}}
>
<BottomSheetView>
<SheetHeader
Expand Down
13 changes: 12 additions & 1 deletion app/components/sheets/AlertList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Ionicons from '@expo/vector-icons/Ionicons';
import useAppStore from "../../data/app_state";
import SheetHeader from "../ui/SheetHeader";
import { IMapServiceInterruption } from "utils/interfaces";
import { useServiceInterruptions } from "app/data/api_query";
import { useRoutes, useServiceInterruptions } from "app/data/api_query";

interface SheetProps {
sheetRef: React.RefObject<BottomSheetModal>
Expand All @@ -21,8 +21,10 @@ const AlertList: React.FC<SheetProps> = ({ sheetRef }) => {
const selectedRoute = useAppStore((state) => state.selectedRoute);
const presentSheet = useAppStore((state) => state.presentSheet);
const setSelectedAlert = useAppStore((state) => state.setSelectedAlert);
const setDrawnRoutes = useAppStore((state) => state.setDrawnRoutes);
const [shownAlerts, setShownAlerts] = useState<IMapServiceInterruption[]>([]);

const { data: routes } = useRoutes();
const { data: alerts, isError } = useServiceInterruptions()

// If no route is selected, we're looking at all routes, therefore show all alerts
Expand All @@ -35,6 +37,7 @@ const AlertList: React.FC<SheetProps> = ({ sheetRef }) => {

if (!selectedRoute) {
setShownAlerts(alerts);

return;
}

Expand All @@ -55,6 +58,14 @@ const AlertList: React.FC<SheetProps> = ({ sheetRef }) => {
index={1}
backgroundStyle={{backgroundColor: theme.background}}
handleIndicatorStyle={{backgroundColor: theme.divider}}
onAnimate={(_, to) => {
if (!selectedRoute && to == 1) {
const affectedRoutes = routes?.filter(route => route.directionList.flatMap(direction => direction.serviceInterruptionKeys).length > 0)
setDrawnRoutes(affectedRoutes ?? [])

return;
}
}}
>
<BottomSheetView>
{/* header */}
Expand Down
Binary file modified assets/adaptive-icon.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 modified assets/icon.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 modified assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ platform :ios do


update_project_team(
path: "ios/ReveilleRides.xcodeproj",
path: "ios/MaroonRides.xcodeproj",
teamid: TEAM_ID
)

update_project_provisioning(
xcodeproj: "ios/ReveilleRides.xcodeproj",
xcodeproj: "ios/MaroonRides.xcodeproj",
profile: ENV["sigh_com.bwees.reveille-rides_appstore_profile-path"],
build_configuration: "Release",
target_filter: "ReveilleRides",
target_filter: "MaroonRides",
)

update_code_signing_settings(
use_automatic_signing: false,
path: "ios/ReveilleRides.xcodeproj",
path: "ios/MaroonRides.xcodeproj",
team_id: TEAM_ID,
bundle_identifier: "com.bwees.reveille-rides",
code_sign_identity: "iPhone Distribution",
Expand All @@ -85,7 +85,7 @@ platform :ios do

# set ITSAppUsesNonExemptEncryption to false, prevents Missing Compliance error in TF
set_info_plist_value(
path: "ios/ReveilleRides/Info.plist",
path: "ios/MaroonRides/Info.plist",
key: "ITSAppUsesNonExemptEncryption",
value: false
)
Expand All @@ -96,9 +96,9 @@ platform :ios do
prebuild

# get current build number app_store_build_number and increment it
increment_build_number(xcodeproj: "ios/ReveilleRides.xcodeproj", build_number: app_store_build_number() + 1)
increment_build_number(xcodeproj: "ios/MaroonRides.xcodeproj", build_number: app_store_build_number() + 1)

build_app(workspace: "ios/ReveilleRides.xcworkspace", scheme: "ReveilleRides")
build_app(workspace: "ios/MaroonRides.xcworkspace", scheme: "MaroonRides")

upload_to_app_store(skip_metadata: true, skip_screenshots: true)
end
Expand All @@ -107,9 +107,9 @@ platform :ios do
lane :beta do
prebuild

increment_build_number(xcodeproj: "ios/ReveilleRides.xcodeproj", build_number: app_store_build_number(live: false) + 1)
increment_build_number(xcodeproj: "ios/MaroonRides.xcodeproj", build_number: app_store_build_number(live: false) + 1)

build_app(workspace: "ios/ReveilleRides.xcworkspace", scheme: "ReveilleRides")
build_app(workspace: "ios/MaroonRides.xcworkspace", scheme: "MaroonRides")

upload_to_testflight(
notify_external_testers: true,
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Matchfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
git_url("https://github.com/Reveille-Rides/credentials")
git_url("https://github.com/Maroon-Rides/credentials")

storage_mode("git")

Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b98d40

Please sign in to comment.