Skip to content

Commit

Permalink
#851 search results full functionality + types + test entities
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Apr 29, 2024
1 parent 66ca943 commit d8bd2b0
Show file tree
Hide file tree
Showing 78 changed files with 1,408 additions and 1,454 deletions.
1 change: 1 addition & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FRONTEND_PORT="3000"
VITE_FRONTEND_URL="http://localhost:3000"
VITE_API_URL="http://localhost:8000/v1"

ADMIN_PATH="admin/"
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ export interface Props {
expanded?: boolean;
}
const { isMacOS } = useDevice();
withDefaults(defineProps<Props>(), {
expanded: false,
});
const sidebar = useSidebar();
const { isMacOS } = useDevice();
const input = ref();
const hotkeyIndicators = ref();
const isInputFocused = ref(false);
Expand Down
67 changes: 54 additions & 13 deletions frontend/components/card/CardAbout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@
@closeModal="handleCloseModal"
:sectionsToEdit="[
$t('_global.about'),
// $t('components._global.get-involved'),
$t('components._global.get-involved'),
]"
:textsToEdit="[organization.description]"
:textsToEdit="[descriptionText, getInvolvedText]"
:isOpen="modalIsOpen"
/>
<ModalEditPageText
v-if="group"
@closeModal="handleCloseModal"
:sectionsToEdit="[
$t('_global.about'),
$t('components._global.get-involved'),
]"
:textsToEdit="[descriptionText, getInvolvedText]"
:isOpen="modalIsOpen"
/>
<ModalEditPageText
Expand All @@ -40,18 +50,21 @@
$t('_global.about'),
$t('components._global.participate'),
]"
:textsToEdit="[event.description, event.getInvolvedDescription]"
:textsToEdit="[descriptionText, getInvolvedText]"
:isOpen="modalIsOpen"
/>
</div>
<div v-if="organization" class="flex-col space-y-3">
<ShieldTopic :topic="organization.topic" />
<!-- <div class="flex items-center gap-3">
<ShieldTopic v-for="(t, i) in organization.topics" :key="i" :topic="t" />
</div> -->
<!-- <ShieldTopic :topic="organization.topic" /> -->
<div class="flex items-center gap-3">
<MetaTagLocation :location="organization.location" />
<MetaTagMembers
:members="organization.members"
<!-- <MetaTagMembers
:members="organization.members.length"
:label="$t('components._global.members_lower')"
/>
/> -->
</div>
<div>
<p
Expand Down Expand Up @@ -89,13 +102,15 @@
</div>
</div>
<div v-else-if="group" class="flex-col space-y-3">
<ShieldTopic :topic="group.topic" />
<!-- <div class="flex items-center gap-3">
<ShieldTopic v-for="(t, i) in group.topics" :key="i" :topic="t" />
</div> -->
<div class="flex items-center gap-3">
<MetaTagLocation :location="group.location" />
<MetaTagMembers
:members="group.members"
<!-- <MetaTagMembers
:members="group.members.length"
:label="$t('components._global.members_lower')"
/>
/> -->
</div>
<div>
<p
Expand Down Expand Up @@ -133,7 +148,9 @@
</div>
</div>
<div v-else-if="event" class="flex-col space-y-3">
<ShieldTopic :topic="event.topic" />
<!-- <div class="flex items-center gap-3">
<ShieldTopic v-for="(t, i) in event.topics" :key="i" :topic="t" />
</div> -->
<div>
<p
ref="description"
Expand Down Expand Up @@ -180,12 +197,36 @@ import type { Group } from "~/types/group";
import type { Organization } from "~/types/organization";
import ModalEditPageText from "../modal/ModalEditPageText.vue";
defineProps<{
const props = defineProps<{
organization?: Organization;
group?: Group;
event?: Event;
}>();
const descriptionText = computed<string>(() => {
if (props.organization && props.organization.description) {
return props.organization.description;
} else if (props.group && props.group.description) {
return props.group.description;
} else if (props.event && props.event.description) {
return props.event.description;
} else {
return "";
}
});
const getInvolvedText = computed<string>(() => {
if (props.organization && props.organization.getInvolved) {
return props.organization.getInvolved;
} else if (props.group && props.group.getInvolved) {
return props.group.getInvolved;
} else if (props.event && props.event.getInvolved) {
return props.event.getInvolved;
} else {
return "";
}
});
const description = ref();
const descriptionExpandable = ref(false);
Expand Down
21 changes: 11 additions & 10 deletions frontend/components/card/CardDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@
<div v-if="event" class="flex-col space-y-6 py-2">
<div class="flex items-center gap-3">
<MetaTagOrganization
:organizations="event.organizations"
></MetaTagOrganization>
v-for="(o, i) in event.organizations"
:key="i"
:organization="o"
/>
</div>
<MetaTagAttendance
:numAttending="event.attending ? event.attending : 0"
label="attending"
/>
<!-- <MetaTagAttendance
:numAttending="event.attendees ? event.attendees.length : 0"
:label="$t('components.card-details.attending')"
/> -->
<MetaTagLocation
v-if="event.inPersonLocation"
:location="event.inPersonLocation"
v-if="event.offlineLocation"
:location="event.offlineLocation"
/>
<MetaTagDate :date="event.date" />
<MetaTagDate :date="event.startTime" />
</div>
</div>
</div>
Expand All @@ -32,7 +34,6 @@

<script setup lang="ts">
import type { Event } from "~/types/event";
import MetaTagAttendance from "../meta-tag/MetaTagAttendance.vue";
defineProps<{
event?: Event;
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/card/CardFAQEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

<script setup lang="ts">
import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
import type { FaqEntry } from "~/types/card-faq-entry";
import type { FaqEntry } from "~/types/faq-entry";
import ModalEditPageText from "../modal/ModalEditPageText.vue";
defineProps<{
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/card/CardGetInvolved.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>
<div class="flex space-x-2 pt-2 lg:absolute lg:right-0 lg:pt-0">
<BtnRouteInternal
v-if="organization && organization.workingGroups"
v-if="organization && organization.groups"
:cta="true"
:linkTo="'/organizations/' + id + '/groups'"
label="components.btn-route-internal.view-all-groups"
Expand Down Expand Up @@ -45,14 +45,14 @@
</div>
</div>
<div v-if="organization" class="mt-4">
<div v-if="organization.workingGroups">
<div v-if="organization.groups">
<p>
{{ $t("components.card-get-involved.working-groups-subtext") }}
{{ organization.name }}:
</p>
<Feed
:feedItemNames="organization.workingGroups"
:feedItemURLs="organization.workingGroups"
:feedItemNames="organization.groups"
:feedItemURLs="organization.groups"
/>
</div>
<div v-else>
Expand All @@ -70,7 +70,7 @@
</div>
<div v-else-if="event" class="space-y-3 pt-3">
<p>
{{ event.getInvolvedDescription }}
{{ event.getInvolved }}
</p>
<p>
{{ $t("components.card-get-involved.legal-disclaimer-subtext") }}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/card/CardOrgApplicationVote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class="mr-5 fill-light-text dark:fill-dark-text"
>
<Icon
v-if="organization.imageURL === undefined"
v-if="organization.iconURL === undefined"
name="IconOrganization"
size="3em"
/>
Expand All @@ -16,7 +16,7 @@
class="rounded border border-light-section-div dark:border-dark-section-div"
>
<img
:src="organization.imageURL"
:src="organization.iconURL"
class="h-full w-12"
:alt="
$t('components._global.entity-logo', {
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/card/discussion/CardDiscussion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<BtnAction
class="mt-1 hidden h-min md:flex"
:cta="true"
:counter="discussion.upVoters"
:counter="discussion.upVoters.length"
fontSize="sm"
leftIcon="bi:arrow-up"
iconSize="1.25em"
Expand All @@ -19,7 +19,7 @@
{{ discussion.title }}
</h2>
<div class="flex items-center space-x-3 md:hidden md:w-fit">
<MetaTagMembers :members="discussion.participants" />
<MetaTagMembers :members="discussion.participants.length" />
<MetaTag
iconName="bi:chat-left"
:value="String(discussion.messages)"
Expand Down Expand Up @@ -49,7 +49,7 @@
<div
class="hidden w-full items-center space-x-3 md:flex md:w-fit lg:space-x-5"
>
<MetaTagMembers :members="discussion.participants" />
<MetaTagMembers :members="discussion.participants.length" />
<MetaTag
iconName="bi:chat-left"
:value="String(discussion.messages)"
Expand All @@ -66,7 +66,7 @@
>
<Icon name="bi:person" size="1.5em" />
</div>
<p class="ml-2">{{ discussion.author }}</p>
<p class="ml-2">{{ discussion.createdBy }}</p>
</a>
<div class="ml-2 flex items-center">
<MetaTagDate :date="new Date().toISOString().slice(0, 10)" />
Expand All @@ -78,7 +78,7 @@
</template>

<script setup lang="ts">
import type { Discussion } from "~/types/card-discussion";
import type { Discussion } from "~/types/discussion";
defineProps<{
isPrivate?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</template>

<script setup lang="ts">
import type { DiscussionEntry } from "~/types/card-discussion-entry";
import type { DiscussionEntry } from "~/types/discussion-entry";
defineProps<{
isPrivate?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
</template>

<script setup lang="ts">
import type { DiscussionInput } from "~/types/card-discussion-input";
import type { DiscussionInput } from "~/types/discussion-input";
const showTooltip = ref(false);
defineProps<{
Expand Down
Loading

0 comments on commit d8bd2b0

Please sign in to comment.