mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 22:16:26 +00:00
chore(tours): format the ski and winter files
This commit is contained in:
@@ -136,11 +136,7 @@ export function useGpxConversion(planner: TourPlannerController) {
|
||||
* discipline is offered too, and the planner asks for the discipline before it saves.
|
||||
* A ride (HOR-01) never: no router plans one, and walking it again on foot would be no ride.
|
||||
*/
|
||||
available:
|
||||
tour !== null &&
|
||||
tour.tour_type !== 'horse' &&
|
||||
(track?.length ?? 0) >= 2 &&
|
||||
planner.canEdit,
|
||||
available: tour !== null && tour.tour_type !== 'horse' && (track?.length ?? 0) >= 2 && planner.canEdit,
|
||||
difficulty,
|
||||
/** The import is a paddle or a ski tour: its version is drawn with straight legs, not routed. */
|
||||
paddle: drawn,
|
||||
|
||||
@@ -69,13 +69,7 @@ export function useTourStageLayers(
|
||||
() => toggleMapOverlay(PISTE_OVERLAY.id, pistesShown),
|
||||
[toggleMapOverlay, pistesShown]
|
||||
);
|
||||
const pistes = useTourRasterOverlay(
|
||||
PISTE_OVERLAY,
|
||||
offersPistes,
|
||||
pistesShown,
|
||||
togglePistes,
|
||||
mapZoom
|
||||
);
|
||||
const pistes = useTourRasterOverlay(PISTE_OVERLAY, offersPistes, pistesShown, togglePistes, mapZoom);
|
||||
const overlays = useMemo(
|
||||
() => [...(offersSeamarks ? [seamarks] : []), ...(offersPistes ? [pistes] : [])],
|
||||
[offersSeamarks, seamarks, offersPistes, pistes]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { EntityRepositoryType, type Opt, type Ref, defineEntity, p } from '@mikro-orm/core';
|
||||
import { CollectionToursRepository } from '../repositories/CollectionTours.repository';
|
||||
import { DbTimestampType } from '../types';
|
||||
import { Collections } from './Collections.entity';
|
||||
import { TourTypes } from './TourTypes.entity';
|
||||
import { Users } from './Users.entity';
|
||||
import { EntityRepositoryType, type Opt, type Ref, defineEntity, p } from '@mikro-orm/core';
|
||||
|
||||
export class CollectionTours {
|
||||
[EntityRepositoryType]?: CollectionToursRepository;
|
||||
@@ -55,7 +55,8 @@ export const CollectionToursSchema = defineEntity({
|
||||
repository: () => CollectionToursRepository,
|
||||
properties: {
|
||||
id: p.integer().primary(),
|
||||
collection: () => p.manyToOne(Collections).ref().deleteRule('cascade').hidden().index('idx_collection_tours_collection'),
|
||||
collection: () =>
|
||||
p.manyToOne(Collections).ref().deleteRule('cascade').hidden().index('idx_collection_tours_collection'),
|
||||
collection_id: p.integer().persist(false).index('idx_collection_tours_collection'),
|
||||
saved_by: p.integer().nullable().persist(false).index('idx_collection_tours_saved_by'),
|
||||
name: p.text(),
|
||||
@@ -93,7 +94,9 @@ export const CollectionToursSchema = defineEntity({
|
||||
source_trip_title: p.text(),
|
||||
source_tour_name: p.text(),
|
||||
created_at: p.type(DbTimestampType).defaultRaw(`CURRENT_TIMESTAMP`),
|
||||
tourTypeRef: () => p.manyToOne(TourTypes).ref().joinColumn('tour_type').hidden().index('idx_collection_tours_tour_type'),
|
||||
savedByRef: () => p.manyToOne(Users).ref().joinColumn('saved_by').nullable().hidden().index('idx_collection_tours_saved_by'),
|
||||
tourTypeRef: () =>
|
||||
p.manyToOne(TourTypes).ref().joinColumn('tour_type').hidden().index('idx_collection_tours_tour_type'),
|
||||
savedByRef: () =>
|
||||
p.manyToOne(Users).ref().joinColumn('saved_by').nullable().hidden().index('idx_collection_tours_saved_by'),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Collection, EntityRepositoryType, type Opt, PrimaryKeyProp, type Ref, defineEntity, p } from '@mikro-orm/core';
|
||||
import { ToursRepository } from '../repositories/Tours.repository';
|
||||
import { DbTimestampType } from '../types';
|
||||
import { Places } from './Places.entity';
|
||||
@@ -10,6 +9,7 @@ import { TourPackingLinks } from './TourPackingLinks.entity';
|
||||
import { TourSources } from './TourSources.entity';
|
||||
import { TourTypes } from './TourTypes.entity';
|
||||
import { TourWaypoints } from './TourWaypoints.entity';
|
||||
import { Collection, EntityRepositoryType, type Opt, PrimaryKeyProp, type Ref, defineEntity, p } from '@mikro-orm/core';
|
||||
|
||||
export class Tours {
|
||||
[EntityRepositoryType]?: ToursRepository;
|
||||
@@ -140,7 +140,8 @@ export const ToursSchema = defineEntity({
|
||||
checks: [
|
||||
{
|
||||
name: 'tours_run_pace_seconds_per_km_check',
|
||||
expression: 'run_pace_seconds_per_km IS NULL OR (run_pace_seconds_per_km >= 120 AND run_pace_seconds_per_km <= 1200)',
|
||||
expression:
|
||||
'run_pace_seconds_per_km IS NULL OR (run_pace_seconds_per_km >= 120 AND run_pace_seconds_per_km <= 1200)',
|
||||
},
|
||||
{ name: 'tours_revision_check', expression: 'revision >= 1' },
|
||||
],
|
||||
|
||||
@@ -91,7 +91,7 @@ describe('collection tour helpers (LIB-03)', () => {
|
||||
it('LIB3-HLP-007: a kept tour carries what the trip list shows of its type, and its stages', () => {
|
||||
expect(keptTourItem(row)).toMatchObject({
|
||||
bike_profile: 'gravel',
|
||||
ski_discipline: null,
|
||||
ski_discipline: null,
|
||||
run_pace_seconds_per_km: null,
|
||||
stage_count: null,
|
||||
});
|
||||
|
||||
@@ -410,7 +410,8 @@ const tours: TranslationStrings = {
|
||||
'tours.ski.time': 'スキー時間',
|
||||
'tours.ski.timeUnknown': '計算なし',
|
||||
'tours.ski.timeInfoLabel': 'スキー時間がない理由',
|
||||
'tours.ski.timeInfo': 'TREK はスキー時間を計算しません。区間は直線で描かれ、コース、リフト、トレイルに沿って計画されていません。必要なら予定の合計時間をご自身で入力してください。',
|
||||
'tours.ski.timeInfo':
|
||||
'TREK はスキー時間を計算しません。区間は直線で描かれ、コース、リフト、トレイルに沿って計画されていません。必要なら予定の合計時間をご自身で入力してください。',
|
||||
'tours.ski.classifyTitle': 'スキーのトラックを分類',
|
||||
'tours.ski.saved': '分類を保存しました',
|
||||
'tours.ski.saveFailed': '分類を保存できませんでした。',
|
||||
|
||||
@@ -408,7 +408,8 @@ const tours: TranslationStrings = {
|
||||
'tours.ski.time': '스키 시간',
|
||||
'tours.ski.timeUnknown': '계산 안 함',
|
||||
'tours.ski.timeInfoLabel': '스키 시간이 없는 이유',
|
||||
'tours.ski.timeInfo': 'TREK은 스키 시간을 계산하지 않습니다. 구간은 직선으로 그려지며 슬로프, 리프트, 트레일을 따라 계획되지 않습니다. 원하면 예정 총 시간을 직접 입력하세요.',
|
||||
'tours.ski.timeInfo':
|
||||
'TREK은 스키 시간을 계산하지 않습니다. 구간은 직선으로 그려지며 슬로프, 리프트, 트레일을 따라 계획되지 않습니다. 원하면 예정 총 시간을 직접 입력하세요.',
|
||||
'tours.ski.classifyTitle': '스키 트랙 분류',
|
||||
'tours.ski.saved': '분류를 저장했습니다',
|
||||
'tours.ski.saveFailed': '분류를 저장하지 못했습니다.',
|
||||
|
||||
@@ -384,7 +384,8 @@ const tours: TranslationStrings = {
|
||||
'tours.ski.time': '滑雪時間',
|
||||
'tours.ski.timeUnknown': '未計算',
|
||||
'tours.ski.timeInfoLabel': '為什麼沒有滑雪時間',
|
||||
'tours.ski.timeInfo': 'TREK 不計算滑雪時間:各段以直線繪製,並未沿雪道、纜車或步道規劃。如有需要,請自行填寫計畫總時長。',
|
||||
'tours.ski.timeInfo':
|
||||
'TREK 不計算滑雪時間:各段以直線繪製,並未沿雪道、纜車或步道規劃。如有需要,請自行填寫計畫總時長。',
|
||||
'tours.ski.classifyTitle': '為滑雪軌跡分類',
|
||||
'tours.ski.saved': '分類已儲存',
|
||||
'tours.ski.saveFailed': '無法儲存分類。',
|
||||
@@ -736,7 +737,8 @@ const tours: TranslationStrings = {
|
||||
'tours.import.previewConfirm': '匯入 {count} 條路線',
|
||||
'tours.conversion.introPaddle':
|
||||
'匯入的是一條記錄的軌跡。規劃一條可編輯的划槳行程:TREK 從中取出控制點,像繪製划槳行程那樣以直線相連,並顯示兩者有多接近。在你選擇之前不會有任何變更。',
|
||||
'tours.conversion.introSki': '匯入的是一條記錄的軌跡。規劃一條可編輯的滑雪行程:TREK 從中取出控制點,像繪製滑雪行程那樣以直線相連,並顯示兩者有多接近。在你選擇之前不會有任何變更。',
|
||||
'tours.conversion.introSki':
|
||||
'匯入的是一條記錄的軌跡。規劃一條可編輯的滑雪行程:TREK 從中取出控制點,像繪製滑雪行程那樣以直線相連,並顯示兩者有多接近。在你選擇之前不會有任何變更。',
|
||||
'tours.conversion.closePaddle': '建議緊貼軌跡。其各點以直線相連,因此並不是同一條線。',
|
||||
'tours.planner.moreActions': '更多操作',
|
||||
'tours.paddle.role.put_in': '下水點',
|
||||
|
||||
@@ -385,7 +385,8 @@ const tours: TranslationStrings = {
|
||||
'tours.ski.time': '滑雪用时',
|
||||
'tours.ski.timeUnknown': '未计算',
|
||||
'tours.ski.timeInfoLabel': '为什么没有滑雪用时',
|
||||
'tours.ski.timeInfo': 'TREK 不计算滑雪用时:各段以直线绘制,并未沿雪道、缆车或小径规划。如有需要,请自行填写计划总时长。',
|
||||
'tours.ski.timeInfo':
|
||||
'TREK 不计算滑雪用时:各段以直线绘制,并未沿雪道、缆车或小径规划。如有需要,请自行填写计划总时长。',
|
||||
'tours.ski.classifyTitle': '为滑雪轨迹分类',
|
||||
'tours.ski.saved': '分类已保存',
|
||||
'tours.ski.saveFailed': '无法保存分类。',
|
||||
@@ -737,7 +738,8 @@ const tours: TranslationStrings = {
|
||||
'tours.import.previewConfirm': '导入 {count} 条路线',
|
||||
'tours.conversion.introPaddle':
|
||||
'导入的是一条记录的轨迹。规划一条可编辑的划桨路线:TREK 从中提取控制点,像绘制划桨路线那样用直线相连,并显示两者有多接近。在你选择之前不会有任何更改。',
|
||||
'tours.conversion.introSki': '导入的是一条记录的轨迹。规划一条可编辑的滑雪路线:TREK 从中提取控制点,像绘制滑雪路线那样用直线相连,并显示两者有多接近。在你选择之前不会有任何更改。',
|
||||
'tours.conversion.introSki':
|
||||
'导入的是一条记录的轨迹。规划一条可编辑的滑雪路线:TREK 从中提取控制点,像绘制滑雪路线那样用直线相连,并显示两者有多接近。在你选择之前不会有任何更改。',
|
||||
'tours.conversion.closePaddle': '建议紧贴轨迹。其各点以直线相连,因此并不是同一条线。',
|
||||
'tours.planner.moreActions': '更多操作',
|
||||
'tours.paddle.role.put_in': '下水点',
|
||||
|
||||
Reference in New Issue
Block a user