Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Remove Blossoms from Frontend #1297

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Syntax: `- short text describing the change _(Your Name)_`

- Added Meeting Agenda&Notes for 15.04.2024 9:00 _(Markus Raab, Daniel)_
- _()_
- _()_
- Removed Blossoms from Frontend (Text from guided tour, awarding Blossoms at the end of the tour) _(Andrei Dinu)_
- _()_
- _()_
- _()_
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/config/i18n/de/blossoms.json

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/config/i18n/de/guidedTour.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"base_layer_title": "Basis-Ebene",
"plants_layer_title": "Pflanzen-Ebene",
"congratulations_title": "Einführungstour abgeschlossen",
"welcome_text": "<p><strong>Herzlich willkommen, PermaplanTer*in!</strong></p><p>&nbsp;</p><p>Das ist der Map Editor, wo du deine Karte planen und verwalten wirst. PermaplanT belohnt nachhaltiges Gärtnern mit Blossoms.<p>&nbsp;</p><p>Mit Abschluss dieser Einführungstour kannst du dir dein erstes <strong>Blossom</strong> verdienen.</p>",
"welcome_text": "<p><strong>Herzlich willkommen, PermaplanTer*in!</strong></p><p>&nbsp;</p><p>Das ist der Map Editor, wo du deine Karte planen und verwalten wirst.</p>",
"toolbox_intro_text": "Die Toolbox bietet dir eine Reihe von <strong>nützlichen Werkzeugen</strong> für die Arbeit an deiner Karte.",
"layers_intro_text": "Hier kannst du deine <strong>aktive Ebene</strong> auswählen, eine Ebene verstecken oder ihre Transparenz anpassen.",
"timeline_intro_text": "Nutze die <strong>Zeitleiste</strong>, um dir für einen bestimmten Tag die Planung der Karte anzeigen zu lassen.<p>Alle Änderungen, die du vornimmst, bekommen ihre Gültigkeit mit dem gewählten Tag.</p>",
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/config/i18n/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import auth from './auth.json';
import baseLayer from './baseLayer.json';
import baseLayerForm from './baseLayerForm.json';
import blog from './blog.json';
import blossoms from './blossoms.json';
import common from './common.json';
import contact from './contact.json';
import drawings from './drawings.json';
Expand Down Expand Up @@ -70,7 +69,6 @@ export default {
plantings,
drawings,
guidedTour,
blossoms,
readOnly,
toolboxTooltips,
polygon,
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/config/i18n/en/blossoms.json

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/config/i18n/en/guidedTour.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"base_layer_title": "Base Layer",
"plants_layer_title": "Plants Layer",
"congratulations_title": "Congratulations",
"welcome_text": "Welcome to your first map, PermaplanTer. This is the Map Editor, where you will design and manage your map. PermaplanT rewards sustainable gardening with blossoms. With completion of this tour you will gain your first blossom.",
"welcome_text": "Welcome to your first map, PermaplanTer. This is the Map Editor, where you will design and manage your map.",
"toolbox_intro_text": "The toolbox provides you with a variety of handy tools for your work on your map. Here you can undo and redo your actions. You can also toggle the grid from here.",
"layers_intro_text": "The layers panel in the top right corner of the Map Editor lets you select your active layer, hide a specific layer or change its opacity with the blue slider.",
"timeline_intro_text": "Use the timeline to change the current map date. It allows you to see the map at a certain date. Actions will refer to this date.",
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/config/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import auth from './auth.json';
import baseLayer from './baseLayer.json';
import baseLayerForm from './baseLayerForm.json';
import blog from './blog.json';
import blossoms from './blossoms.json';
import common from './common.json';
import contact from './contact.json';
import drawings from './drawings.json';
Expand Down Expand Up @@ -70,7 +69,6 @@ export default {
plantings,
drawings,
guidedTour,
blossoms,
readOnly,
toolboxTooltips,
polygon,
Expand Down
13 changes: 0 additions & 13 deletions frontend/src/features/map_planning/api/gainBlossom.ts

This file was deleted.

19 changes: 2 additions & 17 deletions frontend/src/features/map_planning/components/EditorMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import Konva from 'konva';
import { useCallback, useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ShepherdTourContext } from 'react-shepherd';
import { toast } from 'react-toastify';
import { GainedBlossomsDto, LayerDto, LayerType } from '@/api_types/definitions';
import { LayerDto, LayerType } from '@/api_types/definitions';
import IconButton from '@/components/Button/IconButton';
import CancelConfirmationModal from '@/components/Modals/ExtendedModal';
import {
Expand All @@ -23,7 +22,6 @@ import GridIcon from '@/svg/icons/grid-dots.svg?react';
import RedoIcon from '@/svg/icons/redo.svg?react';
import TagsIcon from '@/svg/icons/tags.svg?react';
import UndoIcon from '@/svg/icons/undo.svg?react';
import { gainBlossom } from '../api/gainBlossom';
import { useCompleteTour, useReenableTour } from '../hooks/tourHookApi';
import BaseLayer from '../layers/base/BaseLayer';
import BaseLayerRightToolbar from '../layers/base/components/BaseLayerRightToolbar';
Expand Down Expand Up @@ -71,7 +69,7 @@ export const EditorMap = ({ layers }: MapProps) => {
const timelineDate = useMapStore((state) => state.untrackedState.timelineDate);
const updateTimelineDate = useMapStore((state) => state.updateTimelineDate);
const tour = useContext(ShepherdTourContext);
const { t } = useTranslation(['timeline', 'blossoms', 'common', 'guidedTour', 'toolboxTooltips']);
const { t } = useTranslation(['timeline', 'common', 'guidedTour', 'toolboxTooltips']);
const isReadOnlyMode = useIsReadOnlyMode();
const [show, setShow] = useState(false);
const [timeLineState, setTimeLineState] = useState<'loading' | 'idle'>('idle');
Expand Down Expand Up @@ -167,25 +165,12 @@ export const EditorMap = ({ layers }: MapProps) => {
}

useEffect(() => {
const _tourCompletionBlossom = async () => {
const blossom: GainedBlossomsDto = {
blossom: 'graduation_day',
times_gained: 1,
gained_date: new Date().toISOString().split('T')[0],
};
await gainBlossom(blossom);
toast.success(`${t('blossoms:blossom_gained')} ${t('blossoms:types.graduation_day')}`, {
icon: '\u{1F338}',
});
};

tour?.start();
if (tour && tour.steps.length > 0) {
tour?.on('cancel', () => {
setShow(true);
});
tour?.on('complete', () => {
_tourCompletionBlossom();
completeTour();
});
}
Expand Down