Skip to content

Commit

Permalink
Merge pull request #1142 from TrashMob-eco/main
Browse files Browse the repository at this point in the history
Merged from Main
  • Loading branch information
joebeernink authored Jul 16, 2023
2 parents b80e333 + b5e4413 commit 9ef86e1
Show file tree
Hide file tree
Showing 17 changed files with 193 additions and 82 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release_trashmobmobileapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,16 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: managedcode/MAUIAppVersion@v1
with:
csproj: 'TrashMobMobileApp/TrashMobMobileApp.csproj'
version: ${{ github.run_number }} # to keep value unique
displayVersion: '1.0.0'
printFile: false # optional

- name: Update Build Number
run: |
buildNumber=`/bin/date +%Y%m%d%H%M%S`
echo $buildNumber
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "TrashMobMobileApp/Platforms/iOS/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${{ github.run_number }}" "TrashMobMobileApp/Platforms/iOS/Info.plist"
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v3
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
TrashMob is a website dedicated to organizing groups of people to clean up the world we live in. Users create cleanup events, publicize them, and recruit people to join up, as well as ask for assistance from communities and partners to help haul away the garbage once it is gathered. The idea is to turn what can be an intimidating process for event organizers into a few mouse clicks and simple forms. And once the process is simple, events will spring up all over the world, and the cleanup of the world can begin.

# Where did this idea come from?
Years ago, Scott Hanselman (and others at Microsoft) built out the NerdDinner.com site as a demo of the capabilities of ASP.NET MVC. I actually went to a bunch of the nerd dinners which were fantastic and had a huge roll in my career, including eventually leading me to join Microsoft. This site is based on both that code and the idea that getting people together to do small good things results in larger good things in the long term.
Years ago, Scott Hanselman (and others at Microsoft) built out the NerdDinner.com site as a demo of the capabilities of ASP.NET MVC. I actually went to a bunch of the nerd dinners. They were fantastic and had a huge roll in my career, including eventually leading me to join Microsoft. This site is based on both that code and the idea that getting people together to do small good things results in larger good things in the long term.

My passion is fixing problems we have on the planet with pollution and climate change. I've been thinking about what technology can do to help in these areas, without creating more problems. And I keep coming back to the thought that a lot of this is a human problem. People want to help and they want to fix things, but they don't know where to start. Other people have ideas on where to start, but not enough help to get started.

Expand All @@ -29,7 +29,7 @@ As of 5/15/2022, we are now in full production launch. The site is up and runnin

## Are you looking for contributors?

ABSOLUTELY! Ping [Joe Beernink](https://www.twitter.com/joebeernink) or [[email protected]](mailto:[email protected]) if you want to get involved. All kinds of skills needed, from reactjs to website design, to aspnet core, to .NET MAUI, to PowerBI, to deployment / github skills. If you have a couple of hours a week, and want to contribute, let us know!
ABSOLUTELY! Ping [[email protected]](mailto:[email protected]) if you want to get involved. All kinds of skills needed, from reactjs to website design, to aspnet core, to .NET MAUI, to PowerBI, to deployment / github skills. If you have a couple of hours a week, and want to contribute, let us know!

## I have an idea for a TrashMob feature!

Expand Down Expand Up @@ -60,7 +60,7 @@ If you are not doing any database changes (i.e. design work, error handling, etc
```

### To set up your own environment to test in:
You must use this if you are making database changes to ensure you do not break the back end for everyone else:
You must use this if you are making database changes to ensure you do not break the backend for everyone else:

1. Follow the Infrastructure Deployment Steps (here)[.\Deploy\readme.md].
1. Run the following script on your machine from the TrashMob folder in the project to set up your dev machine to run the project locally. You must be logged into Azure in your PowerShell window in the correct subscription
Expand Down Expand Up @@ -284,4 +284,8 @@ We currently use Microsoft App Center for building and distributing the Mobile a
5. You can either download the latest package at that point, or wait for the next build to be completed. You will be notified when a new version is available.

## How do I get a production distribution of the Mobile App?
The mobile app is not yet in production, but when it is, it will be available in Google Play and the Apple Store.
The production mobile app can be downloaded here:

[Android](https://play.google.com/store/apps/details?id=eco.trashmob.trashmobmobileapp)

[iOS](https://apps.apple.com/us/app/trashmob/id1599996743)
18 changes: 0 additions & 18 deletions TrashMob/client-app/src/components/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import DarylBarber from './assets/boardOfDirectors/darylbarber.jpg';
import JakeDiliberto from './assets/boardOfDirectors/JakeDiliberto.svg';
import KevinGleason from './assets/boardOfDirectors/KevinGleason.svg';
import SandraMau from './assets/boardOfDirectors/SandraMau.png';
import AviSharoni from './assets/boardOfDirectors/AviSharoni.jpg';
import ValerieWilden from './assets/boardOfDirectors/ValerieWilden.svg';

export const Board: React.FC = () => {
Expand Down Expand Up @@ -161,23 +160,6 @@ export const Board: React.FC = () => {
</Col>
</Row>
</div>
<div className='p-4 directorCard'>
<Row>
<Col md={5}>
<Image src={AviSharoni} alt="Avi Sharoni" className="h-100 mt-0 object-fit-cover rounded" />
</Col>
<Col md={7}>
<div className='d-flex justify-content-between align-items-center'>
<h2 className='m-0 fw-500 font-size-xl color-primary '>Avi Sharoni</h2>
<a href="https://www.linkedin.com/in/avi-sharoni-a626293/"><Image src={linkedIn} alt="linkedIn icon" className="h-100 mt-0 object-fit-cover" /></a>
</div>
<h5 className='my-3 fw-500 color-grey'>Member at large</h5>
<p className='font-size-sm color-grey'>Avi Sharoni is a graduate of Babson College for his B.S. degree and NYU Stern School of Business for his M.B.A., both with concentrations in Finance.</p>
<p className='font-size-sm color-grey'>He began his career in real estate with two REITS: Brixmor Property Group and Gramercy Property Trust. At both organizations he worked on the Investment Management teams, preparing portfolio level analytics. After Gramercy, he worked for a high-net worth family office and in private equity with Wharton Equity Partners.</p>
<p className='font-size-sm color-grey'>More recently, Avi has transitioned to the non-profit industry. At both the Brooklyn Navy Yard Development Co. where he served as AVP Finance and ICSC as Director, he worked directly with the CFO's of both organizations. Avi is passionate about giving back and helping others and is excited to join the Board of TrashMob.</p>
</Col>
</Row>
</div>
</Container>
</>
);
Expand Down
15 changes: 7 additions & 8 deletions TrashMob/client-app/src/components/Pages/EventDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import moment from 'moment';
import { Calendar, Facebook, GeoAlt, Link, Share, Stopwatch, Twitter } from 'react-bootstrap-icons';
import { RegisterBtn } from '../RegisterBtn';
import globes from '../assets/gettingStarted/globes.png';
import { getTwitterUrl, getFacebookUrl } from '../../store/ShareUrl';

export interface DetailsMatchParams {
eventId: string;
Expand Down Expand Up @@ -54,6 +55,7 @@ export const EventDetails: FC<EventDetailsProps> = ({ match, currentUser, isUser
const [isAttending, setIsAttending] = useState<string>("No");
const [myAttendanceList, setMyAttendanceList] = useState<EventData[]>([]);
const [isUserEventDataLoaded, setIsUserEventDataLoaded] = useState(false);
const [isEventCompleted, setIsEventCompleted] = useState<boolean>();

const startDateTime = moment(eventDate);
const endDateTime = moment(startDateTime).add(durationHours, 'hours').add(durationMinutes, 'minutes');
Expand Down Expand Up @@ -81,9 +83,6 @@ export const EventDetails: FC<EventDetailsProps> = ({ match, currentUser, isUser
});

if (eventId != null) {
var host = window.location.host;
var eventUrl = "https://" + host + "/eventdetails/" + eventId;

fetch('/api/eventattendees/' + eventId, {
method: 'GET',
headers: headers,
Expand Down Expand Up @@ -114,12 +113,12 @@ export const EventDetails: FC<EventDetailsProps> = ({ match, currentUser, isUser
setLatitude(eventData.latitude);
setLongitude(eventData.longitude);
setCreatedById(eventData.createdByUserId);
const shareMessage = "Help clean up Planet Earth! Sign up for this TrashMob.eco event in " + eventData.city + ", " + eventData.region + " on " + (new Date(eventData.eventDate)).toLocaleDateString() + "! via @TrashMobEco " + eventUrl;
setTwitterUrl("https://twitter.com/intent/tweet?text=" + encodeURI(shareMessage) + "&ref_src=twsrc%5Etfw");
setFacebookUrl("https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.trashmob.eco%2Feventdetails%2" + eventId + "&amp;src=sdkpreparse");
setTwitterUrl(getTwitterUrl(eventData));
setFacebookUrl(getFacebookUrl(eventData.id));
setMaxNumberOfParticipants(eventData.maxNumberOfParticipants);
setCenter(new data.Position(eventData.longitude, eventData.latitude));
setIsDataLoaded(true);
setIsEventCompleted(new Date(eventData.eventDate) < new Date());
})
.then(() => {
if (!isUserLoaded || !currentUser) {
Expand Down Expand Up @@ -282,8 +281,8 @@ export const EventDetails: FC<EventDetailsProps> = ({ match, currentUser, isUser
<Dropdown.Toggle id="share-toggle" variant="outline" className="h-100 p-18"><Share className="mr-2" aria-hidden="true" />Share</Dropdown.Toggle>
<Dropdown.Menu id="share-menu">
<Dropdown.Item className="share-link" onClick={handleCopyLink}><Link className="mr-2 p-18" aria-hidden="true" />{!copied ? "Copy link" : "Copied!"}</Dropdown.Item>
<Dropdown.Item className="share-link" href={facebookUrl}><Facebook className="mr-2 p-18" aria-hidden="true" />Share to Facebook</Dropdown.Item>
<Dropdown.Item className="share-link" href={twitterUrl}><Twitter className="mr-2 p-18" aria-hidden="true" />Share to Twitter</Dropdown.Item>
<Dropdown.Item className="share-link" href={facebookUrl} hidden={isEventCompleted}><Facebook className="mr-2 p-18" aria-hidden="true" />Share to Facebook</Dropdown.Item>
<Dropdown.Item className="share-link" href={twitterUrl} hidden={isEventCompleted}><Twitter className="mr-2 p-18" aria-hidden="true" />Share to Twitter</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
<RegisterBtn eventId={eventId} isAttending={isAttending} currentUser={currentUser} onAttendanceChanged={handleAttendanceChanged} isUserLoaded={isUserLoaded} history={history} location={location} match={match}></RegisterBtn>
Expand Down
36 changes: 25 additions & 11 deletions TrashMob/client-app/src/components/Pages/MyDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Table } from '../Table';
import twofigure from '../assets/card/twofigure.svg';
import calendarclock from '../assets/card/calendarclock.svg';
import bucketplus from '../assets/card/bucketplus.svg';
import { Eye, PersonX, Link as LinkIcon, Pencil, FileEarmarkCheck, CheckSquare, XSquare, ArrowRightSquare } from 'react-bootstrap-icons';
import { Eye, PersonX, Link as LinkIcon, Pencil, FileEarmarkCheck, CheckSquare, XSquare, ArrowRightSquare, Facebook, Twitter } from 'react-bootstrap-icons';
import StatsData from '../Models/StatsData';
import { PartnerStatusActive } from '../Models/Constants';
import DisplayPartnershipData from '../Models/DisplayPartnershipData';
Expand All @@ -24,6 +24,7 @@ import DisplayPartnerAdminInvitationData from '../Models/DisplayPartnerAdminInvi
import { PartnerLocationEventRequests } from '../Partners/PartnerLocationEventRequests';
import { Guid } from 'guid-typescript';
import PickupLocationData from '../Models/PickupLocationData';
import { getTwitterUrl, getFacebookUrl } from '../../store/ShareUrl';

interface MyDashboardProps extends RouteComponentProps<any> {
isUserLoaded: boolean;
Expand Down Expand Up @@ -405,28 +406,41 @@ const MyDashboard: FC<MyDashboardProps> = (props) => {
});
}

const attendeeActionDropdownList = (eventId: string) => {
const attendeeActionDropdownList = (event: EventData) => {
return (
<>
<Dropdown.Item href={'/eventdetails/' + eventId}><Eye />View event</Dropdown.Item>
<Dropdown.Item onClick={() => handleUnregisterEvent(eventId, props.currentUser.userName)}><PersonX />Unregister for event</Dropdown.Item>
<Dropdown.Item onClick={() => handleCopyLink(eventId)}><LinkIcon />{copied ? 'Copied!' : 'Copy event link'}</Dropdown.Item>
<Dropdown.Item href={'/eventdetails/' + event.id}><Eye />View event</Dropdown.Item>
<Dropdown.Item onClick={() => handleUnregisterEvent(event.id, props.currentUser.userName)}><PersonX />Unregister for event</Dropdown.Item>
<Dropdown.Item onClick={() => handleCopyLink(event.id)}><LinkIcon />{copied ? 'Copied!' : 'Copy event link'}</Dropdown.Item>
<Dropdown.Item href={getFacebookUrl(event.id)}><Facebook />Share to Facebook</Dropdown.Item>
<Dropdown.Item href={getTwitterUrl(event)}><Twitter />Share to Twitter</Dropdown.Item>
</>
)
}

const eventOwnerActionDropdownList = (eventId: string) => {
const eventOwnerActionDropdownList = (event: EventData) => {
return (
<>
<Dropdown.Item href={'/manageeventdashboard/' + event.id}><Pencil />Manage event</Dropdown.Item>
<Dropdown.Item href={'/eventdetails/' + event.id}><Eye />View event</Dropdown.Item>
<Dropdown.Item onClick={() => handleCopyLink(event.id)}><LinkIcon />{copied ? 'Copied!' : 'Copy event link'}</Dropdown.Item>
<Dropdown.Item href={getFacebookUrl(event.id)}><Facebook />Share to Facebook</Dropdown.Item>
<Dropdown.Item href={getTwitterUrl(event)}><Twitter />Share to Twitter</Dropdown.Item>
<Dropdown.Item href={'/cancelevent/' + event.id}><XSquare />Cancel event</Dropdown.Item>
</>
)
}

const completedAttendeeActionDropdownList = (eventId: string) => {
return (
<>
<Dropdown.Item href={'/manageeventdashboard/' + eventId}><Pencil />Manage event</Dropdown.Item>
<Dropdown.Item href={'/eventdetails/' + eventId}><Eye />View event</Dropdown.Item>
<Dropdown.Item onClick={() => handleCopyLink(eventId)}><LinkIcon />{copied ? 'Copied!' : 'Copy event link'}</Dropdown.Item>
<Dropdown.Item href={'/cancelevent/' + eventId}><XSquare />Cancel event</Dropdown.Item>
</>
)
}

const eventCompletedOwnerActionDropdownList = (eventId: string) => {
const completedEventOwnerActionDropdownList = (eventId: string) => {
return (
<>
<Dropdown.Item href={'/eventsummary/' + eventId}><FileEarmarkCheck />Event Summary</Dropdown.Item>
Expand Down Expand Up @@ -501,7 +515,7 @@ const MyDashboard: FC<MyDashboardProps> = (props) => {
<Dropdown role="menuitem">
<Dropdown.Toggle id="share-toggle" variant="outline" className="h-100 border-0">...</Dropdown.Toggle>
<Dropdown.Menu id="share-menu">
{event.createdByUserId === props.currentUser.id ? eventOwnerActionDropdownList(event.id) : attendeeActionDropdownList(event.id)}
{event.createdByUserId === props.currentUser.id ? eventOwnerActionDropdownList(event) : attendeeActionDropdownList(event)}
</Dropdown.Menu>
</Dropdown>
</td>
Expand Down Expand Up @@ -543,7 +557,7 @@ const MyDashboard: FC<MyDashboardProps> = (props) => {
<Dropdown role="menuitem">
<Dropdown.Toggle id="share-toggle" variant="outline" className="h-100 border-0">...</Dropdown.Toggle>
<Dropdown.Menu id="share-menu">
{event.createdByUserId === props.currentUser.id ? eventCompletedOwnerActionDropdownList(event.id) : attendeeActionDropdownList(event.id)}
{event.createdByUserId === props.currentUser.id ? completedEventOwnerActionDropdownList(event.id) : completedAttendeeActionDropdownList(event.id)}
</Dropdown.Menu>
</Dropdown>
</td>
Expand Down
Binary file not shown.
12 changes: 12 additions & 0 deletions TrashMob/client-app/src/store/ShareUrl.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import EventData from "../components/Models/EventData";

export function getTwitterUrl(eventData: EventData): string {
var host = window.location.host;
const eventUrl = "https://" + host + "/eventdetails/" + eventData.id;
const shareMessage = "Help clean up Planet Earth! Sign up for this TrashMob.eco event in " + eventData.city + ", " + eventData.region + " on " + (new Date(eventData.eventDate)).toLocaleDateString() + "! via @TrashMobEco " + eventUrl;
return "https://twitter.com/intent/tweet?text=" + encodeURI(shareMessage) + "&ref_src=twsrc%5Etfw";
}

export function getFacebookUrl(eventId: string): string {
return "https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.trashmob.eco%2Feventdetails%2" + eventId + "&amp;src=sdkpreparse";
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
using Microsoft.AspNetCore.Components;
using MudBlazor;
using TrashMob.Models;
using TrashMobMobileApp.Authentication;
using TrashMobMobileApp.Data;
using TrashMobMobileApp.Extensions;
using TrashMobMobileApp.Features.Map;
using TrashMobMobileApp.Shared;
using TrashMobMobileApp.StateContainers;

public partial class ActiveEventList
{
Expand All @@ -26,6 +28,9 @@ public partial class ActiveEventList
[Inject]
public IWaiverManager WaiverManager { get; set; }

[Inject]
public UserStateInformation StateInformation { get; set; }

protected override async Task OnInitializedAsync()
{
_user = App.CurrentUser;
Expand All @@ -48,7 +53,13 @@ private void OnViewEventDetails(Event mobEvent)

private async void OnViewMapAllEvents(IEnumerable<Event> mobEvents)
{
await App.Current.MainPage.Navigation.PushModalAsync(new MauiMapPageMultipleEvent(MobEventManager, mobEvents));
await App.Current.MainPage.Navigation.PushModalAsync(new MauiMapPageMultipleEvent(MobEventManager, WaiverManager, StateInformation, mobEvents));

if (StateInformation.HasToSignWaiver)
{
Navigator.NavigateTo(Routes.Waiver);
}

await ReInitializeAsync();
}

Expand Down
Loading

0 comments on commit 9ef86e1

Please sign in to comment.