Skip to content

Commit

Permalink
Merge branch 'main' into 1006.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mattburnett-repo authored Dec 7, 2024
2 parents 84ed051 + 7de5f52 commit 9bf2b37
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 50 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ git remote add upstream https://github.com/activist-org/activist.git
docker compose --env-file .env.dev up --build
# And to stop the containers when you're done working:
# docker compose --env-file .env.dev down
docker compose --env-file .env.dev down
```

6. You can visit <http://localhost:3000/> to see the development frontend once the container is up and running. From there click `View organizations` or `View events` to explore the platform.
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ coverage[toml]==7.4.4
# via pytest-cov
distlib==0.3.8
# via virtualenv
django==5.0.9
django==5.0.10
# via
# -r requirements.txt
# django-cors-headers
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ certifi==2024.7.4
# via requests
charset-normalizer==3.3.2
# via requests
django==5.0.9
django==5.0.10
# via
# -r requirements.in
# django-cors-headers
Expand Down
31 changes: 7 additions & 24 deletions frontend/components/card/CardConnect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
}"
>
<Popover v-slot="{ close }" class="relative">
<!-- Mark: 'New Account' button -->
<PopoverButton as="div">
<BtnAction
:cta="true"
Expand All @@ -80,12 +79,9 @@
leave-to-class="opacity-0 translate-y-1"
>
<PopoverPanel class="absolute bottom-0 mb-12">
<!-- popup/PopupNewField.vue -->
<PopupNewField
@add-clicked="
(payload: AddPayload) => handlePopupAddClick(payload, close)
"
@on-close-clicked="close"
@on-cta-clicked="emit('on-new-account')"
@on-close-clicked="onClose(close)"
:title="$t('components.card_connect.app_account_popup_title')"
:fieldNamePrompt="
$t(
Expand Down Expand Up @@ -117,7 +113,6 @@ import { Popover, PopoverButton, PopoverPanel } from "@headlessui/vue";
import type { Group } from "~/types/entities/group";
import type { Organization } from "~/types/entities/organization";
import type { Event } from "~/types/events/event";
import type { AddPayload } from "~/types/social-links-payload";
import { IconMap } from "~/types/icon-map";
const props = defineProps<{
Expand All @@ -127,6 +122,7 @@ const props = defineProps<{
// TODO: restore after 1006 is resolved.
// const { userIsSignedIn } = useUser();
const userIsSignedIn = true;
const paramsId = useRoute().params.id;
const paramsIdGroup = useRoute().params.groupId;
Expand Down Expand Up @@ -165,26 +161,13 @@ const socialLinksRef = computed<string[]>(() => {
}
});
const handlePopupAddClick = async (payload: AddPayload, close: () => void) => {
// Put the social links payload in the database.
// TODO: Needs more robust handling (ie try/catch + error trapping/handling)
const response = await organizationStore.addSocialLinks(
organization,
payload
);
if (response) {
console.log("org store addSocialLinks response: " + response);
console.log(
"CardConnect addSocialLinks payload: " + JSON.stringify(payload)
);
}
close();
};
const toggleEditMode = () => {
editModeEnabled.value = !editModeEnabled.value;
};
const onClose = (close: (ref?: HTMLElement) => void) => {
close();
};
const emit = defineEmits(["on-new-account", "on-account-removed"]);
</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- Test comment, to check pre-commit hook -->
<template>
<ModalBase :modalName="modalName">
<div class="flex flex-col space-y-7">
Expand Down
18 changes: 11 additions & 7 deletions frontend/components/popup/PopupNewField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
id="popup-input"
class="focus-brand h-8 w-52 rounded-sm border border-primary-text bg-transparent p-2"
type="text"
required
:placeholder="fieldNamePrompt"
/>
<input
Expand All @@ -32,7 +31,6 @@
id="popup-input"
class="focus-brand h-8 w-52 rounded-sm border border-primary-text bg-transparent p-2"
type="text"
required
:placeholder="fieldLabelPrompt"
/>
<label for="popup-textarea" class="sr-only"> {{ descriptionPrompt }}</label>
Expand All @@ -45,11 +43,14 @@
cols="10"
:placeholder="descriptionPrompt"
></textarea>
<div role="button" tabindex="0" class="mt-1">
<!-- Mark: 'Add' button -->
<div
@click="emit('on-cta-clicked', inputValue)"
@keypress.enter="emit('on-cta-clicked', inputValue)"
role="button"
tabindex="0"
class="mt-1"
>
<BtnAction
@click="handleAddClick"
@keypress.enter="handleAddClick"
:cta="true"
linkTo="placeholder-link"
:label="ctaBtnLabel"
Expand All @@ -74,7 +75,8 @@ defineProps<{
ctaBtnAriaLabel: string;
}>();
const emit = defineEmits(["add-clicked", "on-close-clicked"]);
const inputValue = ref<HTMLInputElement | null>(null);
const inputLabel = ref<HTMLInputElement | null>(null);
const inputValue = ref("");
const inputLabel = ref("");
Expand Down Expand Up @@ -108,4 +110,6 @@ const handleAddClick = () => {
label: inputLabel.value,
});
};
const emit = defineEmits(["on-cta-clicked", "on-close-clicked"]);
</script>
2 changes: 1 addition & 1 deletion frontend/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@
"pages._global.settings.save_settings": "Einstellungen speichern",
"pages._global.settings.save_settings_aria_label": "Aktualisieren der Einstellungen",
"pages._global.settings.settings_lower": "Einstellungen",
"pages.organizations.groups.about.share_group": "Gruppe teilen",
"pages._global.tasks.new_task": "Neue Aufgabe",
"pages._global.tasks.new_task_aria_label": "Hinzufügen einer neuen Aufgabe zum Board",
"pages._global.tasks.tasks_lower": "Aufgaben",
Expand Down Expand Up @@ -502,6 +501,7 @@
"pages.organizations.faq.new_faq": "Neuer FAQ-Eintrag",
"pages.organizations.faq.new_faq_aria_label": "Eine neue Frage und Antwort hinzufügen",
"pages.organizations.groups._global.support_group_aria_label": "Diese Gruppe unterstützen",
"pages.organizations.groups.about.share_group": "Gruppe teilen",
"pages.organizations.groups.about.share_group_aria_label": "Optionen zum Teilen dieser Gruppe mit anderen anzeigen",
"pages.organizations.groups.index.groups_lower": "Gruppen",
"pages.organizations.groups.index.new_group_aria_label": "Neue Gruppe erstellen",
Expand Down
2 changes: 1 addition & 1 deletion frontend/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@
"pages._global.settings.save_settings": "Save settings",
"pages._global.settings.save_settings_aria_label": "Update the settings",
"pages._global.settings.settings_lower": "settings",
"pages.organizations.groups.about.share_group": "Share group",
"pages._global.tasks.new_task": "New task",
"pages._global.tasks.new_task_aria_label": "Add a new task to the board",
"pages._global.tasks.tasks_lower": "tasks",
Expand Down Expand Up @@ -503,6 +502,7 @@
"pages.organizations.faq.new_faq": "New FAQ entry",
"pages.organizations.faq.new_faq_aria_label": "Add a new question and answer",
"pages.organizations.groups._global.support_group_aria_label": "Support this group",
"pages.organizations.groups.about.share_group": "Share group",
"pages.organizations.groups.about.share_group_aria_label": "View options to share this group with others",
"pages.organizations.groups.index.groups_lower": "groups",
"pages.organizations.groups.index.new_group_aria_label": "Make a new group",
Expand Down
12 changes: 7 additions & 5 deletions frontend/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"_global.about": "À propos",
"_global.activist_icon_img_alt_text": "L’icône d'Activist : une lettre a minuscule avec un demi-cercle pointant vers le bas et à gauche au centre.",
"_global.auth.reset_password": "Réinitialiser mot de passe",
"_global.auth.sign_in_aria_label": "Vous connecter à votre compte",
"_global.auth.sign_up_aria_label": "Créer un nouveau compte",
"_global.auth.sign_in_aria_label": "Accéder à la page de connexion",
"_global.auth.sign_up_aria_label": "Accéder à la page d'inscription",
"_global.contact": "Contact",
"_global.create_group": "Créer groupe",
"_global.discussion": "Discussion",
Expand Down Expand Up @@ -42,7 +42,7 @@
"_global.share_organization": "Partager l’organisation",
"_global.share_organization_aria_label": "Afficher les options pour partager cette organisation avec d’autres",
"_global.sign_in": "Vous connecter",
"_global.sign_in_aria_label": "Vous connecter à votre compte",
"_global.sign_in_aria_label": "Connectez-vous à votre compte",
"_global.sign_up": "S'inscrire",
"_global.sign_up_aria_label": "Créer un nouveau compte",
"_global.support": "Soutenir",
Expand All @@ -60,7 +60,7 @@
"components._global.join": "Joindre",
"components._global.join_group_link": "Lien vers le groupe à joindre",
"components._global.join_group_subtext": "Cliquer sur « Joindre le groupe » ci-dessus pour participer à {entity_name}",
"components._global.join_organization_subtext": "Cliquer sur « Joindre l’organisation » ci-dessus pour participer à {entity_name}",
"components._global.join_organization_subtext": "Cliquer sur \"Joindre l’organisation\" ci-dessus pour participer à {entity_name}.",
"components._global.matrix": "Matrix",
"components._global.navigate_to_group_aria_label": "Accéder à la page de ce groupe",
"components._global.navigate_to_start": "Aller à la page d’accueil",
Expand Down Expand Up @@ -220,6 +220,7 @@
"components.grid_app_shields.f_droid": "F-Droid",
"components.grid_app_shields.get_it_on": "L'obtenir sur",
"components.grid_app_shields.google_play": "Google Play",
"components.grid_git_hub_shields.fork": "Fourchette",
"components.grid_git_hub_shields.visit_us": "Nous visiter sur",
"components.grid_supporters.impact_hub_belgrade_logo_aria_label": "Lien vers le site web d’Impact Hub Belgrade",
"components.grid_supporters.wikimedia_de_logo_aria_label": "Lien vers le site web de Wikimedia Deutschland",
Expand Down Expand Up @@ -302,6 +303,7 @@
"components.modal_upload_images.upload_an_image": "Téléverser une image",
"components.modal_upload_images.upload_image": "Téléverser image",
"components.modal_upload_images.upload_images": "Téléverser images",
"components.page_breadcrumbs.aria_label": "Navigation dans le fil d'Ariane des pages",
"components.page_community_footer.invite_text_1": "Partagez-vous nos objectifs ? Rejoignez notre communauté !",
"components.page_community_footer.invite_text_2_1": "Nous rendre visite",
"components.page_community_footer.invite_text_2_3": "contribuer au code ou demander une fonctionnalité",
Expand Down Expand Up @@ -363,7 +365,6 @@
"pages._global.settings.save_settings": "Enregistrer les paramètres",
"pages._global.settings.save_settings_aria_label": "Mettre à jour les paramètres",
"pages._global.settings.settings_lower": "paramètres",
"pages.organizations.groups.about.share_group": "Partager groupe",
"pages._global.tasks.new_task": "Nouvelle tâche",
"pages._global.tasks.new_task_aria_label": "Ajouter une nouvelle tâche au tableau",
"pages._global.tasks.tasks_lower": "tâches",
Expand Down Expand Up @@ -501,6 +502,7 @@
"pages.organizations.faq.new_faq": "Nouvelle entrée FAQ",
"pages.organizations.faq.new_faq_aria_label": "Ajouter une nouvelle question et réponse",
"pages.organizations.groups._global.support_group_aria_label": "Soutenir ce groupe",
"pages.organizations.groups.about.share_group": "Partager groupe",
"pages.organizations.groups.about.share_group_aria_label": "Afficher les options pour partager ce groupe avec d’autres",
"pages.organizations.groups.index.groups_lower": "groupes",
"pages.organizations.groups.index.new_group_aria_label": "Faire un nouveau groupe",
Expand Down
7 changes: 3 additions & 4 deletions frontend/stores/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type {
PiniaResOrganization,
PiniaResOrganizations,
} from "~/types/entities/organization";
import type { AddPayload } from "~/types/social-links-payload";

interface OrganizationStore {
loading: boolean;
Expand Down Expand Up @@ -57,7 +56,7 @@ export const useOrganizationStore = defineStore("organization", {
const token = localStorage.getItem("accessToken");

const responseOrg = await useFetch(
`${BASE_BACKEND_URL as string}/entities/organizations/`,
`${BASE_BACKEND_URL}/entities/organizations/`,
{
method: "POST",
body: JSON.stringify({
Expand Down Expand Up @@ -171,7 +170,7 @@ export const useOrganizationStore = defineStore("organization", {
const token = localStorage.getItem("accessToken");

const responseOrg = await $fetch(
(BASE_BACKEND_URL as string) + `/entities/organizations/${org.id}/`,
BASE_BACKEND_URL + `/entities/organizations/${org.id}/`,
{
method: "PUT",
body: {
Expand All @@ -185,7 +184,7 @@ export const useOrganizationStore = defineStore("organization", {
);

const responseOrgTexts = await $fetch(
(BASE_BACKEND_URL as string) +
BASE_BACKEND_URL +
`/entities/organization_texts/${org.organizationTextId}/`,
{
method: "PUT",
Expand Down
4 changes: 0 additions & 4 deletions frontend/types/social-links-payload.ts

This file was deleted.

0 comments on commit 9bf2b37

Please sign in to comment.