Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

Commit 8d1becb

Browse files
authored
Merge pull request #360 from Catatomik/dev
🐛 Stop area add
2 parents e99a382 + 382cc3d commit 8d1becb

12 files changed

+203
-152
lines changed

package-lock.json

+33-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"devDependencies": {
3131
"@capacitor/assets": "^3.0.4",
32-
"@capacitor/cli": "^5.5.1",
32+
"@capacitor/cli": "^5.6.0",
3333
"@rushstack/eslint-patch": "^1.7.2",
3434
"@types/node": "^18",
3535
"@vitejs/plugin-vue": "^5.0.3",

src/components/BaseModal.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface Modal {
1111
const props = withDefaults(defineProps<Modal>(), { initShown: false, bgColor: "bg-slate-100" });
1212
1313
const emit = defineEmits<{
14-
(e: "update:shown", shown: boolean): void;
14+
"update:shown": [shown: boolean];
1515
}>();
1616
1717
const focusDiv = ref<HTMLDivElement | null>(null);

src/components/BaseSettings.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ interface Props {
1212
const props = withDefaults(defineProps<Props>(), { initShown: false });
1313
1414
const emit = defineEmits<{
15-
(e: "update:shown", shown: boolean): void;
16-
(e: "update:modelValue", settings: Settings): void;
15+
"update:shown": [shown: boolean];
16+
"update:modelValue": [settings: Settings];
1717
}>();
1818
1919
fetchSettings().then((r) => {

src/components/JourneyModal.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface Modal {
1515
defineProps<Modal>();
1616
1717
const emit = defineEmits<{
18-
(e: "update:shown", shown: boolean): void;
18+
"update:shown": [shown: boolean];
1919
}>();
2020
2121
const focusDiv = ref<HTMLDivElement | null>(null);

src/components/RouteHeader.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const checked = ref<Checked>(
1818
);
1919
2020
const emit = defineEmits<{
21-
(e: "update:checked", checked: Checked): void;
21+
"update:checked": [checked: Checked];
2222
}>();
2323
2424
emit("update:checked", checked.value);

src/components/StopArea.vue

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ import {
1818
removeStopPoint,
1919
removeStopArea,
2020
getWantedStops,
21-
selectedStops,
21+
selectedStopAreas,
2222
excludedStopPoints,
2323
} from "@/store/StopsManager";
2424
import {
2525
extractLineCode,
2626
fetchLineDetails,
2727
fetchStopPointDetails,
2828
type FullyDescribedRoute,
29-
type FullyDescribedStopArea,
29+
type StopAreaDetails,
3030
type lineType,
3131
type StopPoint,
3232
type TBMLineType,
@@ -36,7 +36,7 @@ import { mapAsync } from "@/store";
3636
import RouteName from "./RouteName.vue";
3737
3838
interface Props {
39-
stopArea: FullyDescribedStopArea;
39+
stopArea: StopAreaDetails;
4040
}
4141
4242
const props = defineProps<Props>();
@@ -50,13 +50,13 @@ const restoreStopComp = ref<InstanceType<typeof BaseModal> | null>(null);
5050
5151
const excludedStopPointsToRestore = ref<(StopPoint & { routes: FullyDescribedRoute[] })[]>([]);
5252
53-
async function getExcludedStopPoints() {
53+
async function getExcludedStopPointsToRestore() {
5454
excludedStopPointsToRestore.value = await mapAsync(
5555
excludedStopPoints.value
5656
.filter(([stopAreaId]) => stopAreaId === props.stopArea.id)
5757
.map<StopPoint | undefined>(([_, stopPointId]) =>
58-
selectedStops.value
59-
.flatMap((stopArea) => stopArea.details.stopPoints)
58+
selectedStopAreas.value
59+
.flatMap((stopArea) => stopArea.stopPoints)
6060
.find((stopPoint) => stopPoint.id === stopPointId),
6161
)
6262
.filter((sp): sp is StopPoint => sp !== undefined),
@@ -89,7 +89,7 @@ async function getExcludedStopPoints() {
8989
restoreStopComp.value.show(false);
9090
}
9191
92-
watch(excludedStopPoints, getExcludedStopPoints);
92+
watch(excludedStopPoints, getExcludedStopPointsToRestore);
9393
9494
fetchMinimized();
9595
</script>
@@ -159,7 +159,7 @@ fetchMinimized();
159159
class="mx-2 my-3 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 overflow-hidden transition-margin"
160160
>
161161
<StopPointComp
162-
v-for="stopPoint of getWantedStops(selectedStops).filter(
162+
v-for="stopPoint of getWantedStops(selectedStopAreas).filter(
163163
(stopPoint) => stopPoint.stopAreaId === stopArea.id,
164164
)"
165165
:key="stopPoint.id"
@@ -176,7 +176,7 @@ fetchMinimized();
176176
ref="restoreStopComp"
177177
@update:shown="
178178
(s) => {
179-
if (s) getExcludedStopPoints();
179+
if (s) getExcludedStopPointsToRestore();
180180
}
181181
"
182182
>

src/components/StopPoint.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Props {
3030
const props = defineProps<Props>();
3131
3232
const emit = defineEmits<{
33-
(e: "delete"): void;
33+
delete: [];
3434
}>();
3535
3636
const realtimeRoutesSchedules = ref<{

src/router/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ router.beforeResolve(async (to, from) => {
2424
try {
2525
const { value } = await Preferences.get({ key: preferencesKeys.location });
2626
return value && value !== "/" ? value : true;
27-
} catch (_) {
27+
} catch {
2828
return true;
2929
}
3030

3131
try {
3232
await Preferences.set({ key: preferencesKeys.location, value: to.fullPath });
33-
} catch (_) {}
33+
} catch {}
3434
});
3535

3636
App.addListener("appUrlOpen", function (event: URLOpenListenerEvent) {

0 commit comments

Comments
 (0)