Skip to content

Commit

Permalink
Merge pull request activist-org#889 from Robot8lover/add-event-creati…
Browse files Browse the repository at this point in the history
…on-flow

Add event creation flow
  • Loading branch information
andrewtavis authored Jul 2, 2024
2 parents a2a115a + 94a6ded commit 68b0361
Show file tree
Hide file tree
Showing 13 changed files with 479 additions and 57 deletions.
7 changes: 5 additions & 2 deletions frontend/components/card/CardConnect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
<script setup lang="ts">
import { Popover, PopoverButton, PopoverPanel } from "@headlessui/vue";
import type { Organization } from "~/types/entities/organization";
import type { Event } from "~/types/events/event";
import { IconMap } from "~/types/icon-map";
const props = defineProps<{
Expand All @@ -129,15 +130,17 @@ const idGroup = typeof paramsIDGroup === "string" ? paramsIDGroup : undefined;
const organizationStore = useOrganizationStore();
let organization: Organization;
const group = useGroupStore();
const event = useEventStore();
const eventStore = useEventStore();
let event: Event;
if (props.pageType == "organization") {
await organizationStore.fetchByID(id);
organization = organizationStore.organization;
} else if (props.pageType == "group") {
await group.fetchByID(idGroup);
} else if (props.pageType == "event") {
await event.fetchByID(id);
await eventStore.fetchByID(id);
event = eventStore.event;
}
const editModeEnabled = ref(false);
Expand Down
6 changes: 4 additions & 2 deletions frontend/components/card/about/CardAboutEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ import CardAbout from "./CardAbout.vue";
const idParam = useRoute().params.id;
const id = typeof idParam === "string" ? idParam : undefined;
const event = useEventStore();
await event.fetchByID(id);
const eventStore = useEventStore();
await eventStore.fetchByID(id);
const { event } = eventStore;
const description = ref();
const descriptionExpandable = ref(false);
Expand Down
7 changes: 5 additions & 2 deletions frontend/components/header/HeaderAppPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

<script setup lang="ts">
import type { Organization } from "~/types/entities/organization";
import type { Event } from "~/types/events/event";
import { IconMap } from "~/types/icon-map";
const props = defineProps<{
Expand All @@ -90,15 +91,17 @@ const id = typeof idParam === "string" ? idParam : undefined;
const organizationStore = useOrganizationStore();
let organization: Organization;
const group = useGroupStore();
const event = useEventStore();
const eventStore = useEventStore();
let event: Event;
if (props.pageType === "organization") {
await organizationStore.fetchByID(id);
organization = organizationStore.organization;
} else if (props.pageType === "group") {
await group.fetchByID(id);
} else if (props.pageType === "event") {
await event.fetchByID(id);
await eventStore.fetchByID(id);
event = eventStore.event;
}
const headerName = computed<string>(() => {
Expand Down
6 changes: 4 additions & 2 deletions frontend/components/modal/edit/about/ModalEditAboutEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ const props = defineProps<{
const idParam = useRoute().params.id;
const id = typeof idParam === "string" ? idParam : undefined;
const event = useEventStore();
await event.fetchByID(id);
const eventStore = useEventStore();
await eventStore.fetchByID(id);
const { event } = eventStore;
const formData = ref({
description: event.description,
Expand Down
11 changes: 8 additions & 3 deletions frontend/components/page/PageBreadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<script setup lang="ts">
import { validate as isValidUUID } from "uuid";
import type { Organization } from "~/types/entities/organization";
import type { Event } from "~/types/events/event";
const url = window.location.href;
let pageType = "";
Expand All @@ -92,7 +93,8 @@ const idGroup = typeof paramsIDGroup === "string" ? paramsIDGroup : undefined;
const organizationStore = useOrganizationStore();
let organization: Organization;
const group = useGroupStore();
const event = useEventStore();
const eventStore = useEventStore();
let event: Event;
if (
url.includes("/organizations/") &&
Expand All @@ -109,10 +111,13 @@ if (
} else if (
url.includes("/events/") &&
!url.includes("/organizations/") &&
!url.includes("/groups/")
!url.includes("/groups/") &&
!url.includes("/events/create") &&
!url.includes("/events/search")
) {
pageType = "event";
await event.fetchByID(id);
await eventStore.fetchByID(id);
event = eventStore.event;
}
const breadcrumbs = ref<string[]>([]);
Expand Down
28 changes: 26 additions & 2 deletions frontend/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"_global.documentation": "Documentation",
"_global.enter-username-mail": "Enter your username or email",
"_global.events": "Events",
"_global.events-name": "Event Name",
"_global.events_lower": "events",
"_global.faq": "FAQ",
"_global.get-active": "Get active",
Expand Down Expand Up @@ -422,11 +423,13 @@
"pages._global.become-supporter": "Become a supporter",
"pages._global.contact-page": "contact page",
"pages._global.create.tagline": "Tagline",
"pages._global.description": "Description",
"pages._global.faq-img-alt-text": "A question mark within a square.",
"pages._global.get-active-img-alt-text": "Drawing of a fist raised.",
"pages._global.get-organized-img-alt-text": "Drawing of fists in a circle pointed at the center.",
"pages._global.grow-organization-img-alt-text": "Drawing of fists raised upwards in a group.",
"pages._global.information": "Information",
"pages._global.link": "Link",
"pages._global.location": "Location",
"pages._global.our-network": "Our network",
"pages._global.our-supporters": "Our supporters",
Expand Down Expand Up @@ -514,6 +517,29 @@
"pages.docs.index.subheader": "Learn more about activist",
"pages.error.message": "Oops, something went wrong:",
"pages.error.title": "Error \u2022 activist",
"pages.events.create.button-left": "Back",
"pages.events.create.button-right": "Next",
"pages.events.create.description-placeholder": "Please provide a description of the event for the community so that we can learn more about it",
"pages.events.create.event-type": "Type",
"pages.events.create.events-name-placeholder": "The name of the event",
"pages.events.create.format": "Format",
"pages.events.create.format-placeholder": "The format of the event (e.g. Protest, Seminar)",
"pages.events.create.go-to-previous-page": "Go to previous form page",
"pages.events.create.header-1": "Event type and roles",
"pages.events.create.header-2": "Location and time",
"pages.events.create.link-placeholder": "https://example.com",
"pages.events.create.location-placeholder": "Where the event is taking place",
"pages.events.create.organizer": "Organizer",
"pages.events.create.organizer-instructions": "You can select from all organizations you're an admin of and invite others to join later in the process.",
"pages.events.create.organizer-placeholder": "The organizer of the event",
"pages.events.create.roles": "Roles",
"pages.events.create.setting": "Setting",
"pages.events.create.submit": "Submit",
"pages.events.create.submit-aria-label": "Submit your event to save and share it with others.",
"pages.events.create.subtext-0": "Thanks for creating your event on activist! Please provide all information for the event below, and note that some fields are required (*). First add a name and choose an optional tagline to let people know what the main goal is efore selecting the host organization(s). Then add important social media accounts and provide a description to set the stage and tell people what to expect.",
"pages.events.create.subtext-1": "What kind of an event is this? Tell people if your event is for taking action or for learning what to do next, and add a format and topics to make it easy to find. Afterwards, tell people exactly what they'll be doing at your event by listing roles that will be available for potential joiners. Don't forget to add a description in the (i) field if it could be confusing!",
"pages.events.create.subtext-2": "In this section, you can define the time and place of your event. Is it in-person or online? Is this a regular meeting or a one time action? Set the time for your event so that joiners know when they can participate. Location type can be offline, online, or both. For location, let attendees know where to meet for the event.",
"pages.events.create.tagline-placeholder": "A short tagline for the event (optional)",
"pages.events.discussion.tagline": "Planning and review for this event",
"pages.events.index.header-title": "Events home",
"pages.events.index.subheader": "Upcoming events near you",
Expand Down Expand Up @@ -641,7 +667,6 @@
"pages.legal.trademark-policy.section-5-subheader": "Contact Us",
"pages.legal.trademark-policy.title": "Trademark",
"pages.organizations.create.complete-application": "Complete application",
"pages.organizations.create.description": "Description",
"pages.organizations.create.description-placeholder": "Please provide a description of the organization for the community so that we can learn more about its goals and composition",
"pages.organizations.create.header": "Application information",
"pages.organizations.create.location-placeholder": "Where the organization is based or active",
Expand All @@ -661,7 +686,6 @@
"pages.resources.create.complete-application-aria-label": "Link the resource to save and share it with others",
"pages.resources.create.description": "Short description",
"pages.resources.create.description-placeholder": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",
"pages.resources.create.link": "Link",
"pages.resources.create.link-placeholder": "A URL to the resource",
"pages.resources.create.location-placeholder": "A location if the resource is for a given place",
"pages.resources.create.organization-placeholder": "Select an organization if the resource should be linked to it",
Expand Down
Loading

0 comments on commit 68b0361

Please sign in to comment.