Skip to content

Commit 1ace78c

Browse files
authored
Merge pull request #79 from mapswipe/feature/project-instruction
2 parents a9dcecb + 5601898 commit 1ace78c

16 files changed

+76
-18
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "mapswipe-web",
33
"version": "0.2.8",
44
"private": true,
5+
"type": "module",
56
"scripts": {
67
"dev": "vite",
78
"build": "run-p type-check \"build-only {@}\" --",

src/components/CompareProject.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ interface ProjectCompareType {
2828
}
2929
credits: string
3030
lookFor: string
31+
projectInstruction: string
3132
}
3233
3334
const defaultOptions: Option[] = [
@@ -146,7 +147,9 @@ export default defineComponent({
146147
return attribution.join('; ')
147148
},
148149
mission() {
149-
const message = this.$t('projectView.youAreLookingFor', { lookFor: this.project.lookFor })
150+
const message = isDefined(this.project.projectInstruction)
151+
? this.project.projectInstruction
152+
: this.$t('projectView.youAreLookingFor', { lookFor: this.project.lookFor })
150153
return message
151154
},
152155
},

src/components/CompareProjectTutorial.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface Tutorial {
1818
projectId: string
1919
name: string
2020
lookFor?: string
21+
projectInstruction?: string
2122
screens: {
2223
hint: Screen
2324
instructions: Screen
@@ -58,7 +59,9 @@ export default defineComponent({
5859
},
5960
computed: {
6061
mission() {
61-
const message = this.$t('projectView.youAreLookingFor', { lookFor: this.tutorial.lookFor })
62+
const message = isDefined(this.tutorial?.projectInstruction)
63+
? this.tutorial.projectInstruction
64+
: this.$t('projectView.youAreLookingFor', { lookFor: this.tutorial?.lookFor })
6265
return message
6366
},
6467
currentScreen() {

src/components/CompletenessProject.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ const debounceTimeoutRef = shallowRef();
5858
const startTime = shallowRef<string>();
5959
6060
const instruction = computed(
61-
() => t('projectView.youAreLookingFor', { lookFor: props.project.lookFor })
61+
() => isDefined(props.project.projectInstruction)
62+
? props.project.projectInstruction
63+
: t('projectView.youAreLookingFor', { lookFor: props.project.lookFor })
6264
);
6365
6466
const numSelectedTasks = computed(() => Object.values(selectedTasks.value).filter(Boolean).length);

src/components/CompletenessProjectTutorial.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ const optionMap = computed(() => {
4242
});
4343
4444
const instruction = computed(
45-
() => t('projectView.youAreLookingFor', { lookFor: props.tutorial.lookFor })
45+
() => isDefined(props.tutorial.projectInstruction)
46+
? props.tutorial.projectInstruction
47+
: t('projectView.youAreLookingFor', { lookFor: props.tutorial.lookFor })
4648
);
4749
4850
const currentScreen = computed(() => (

src/components/FindProjectTutorial.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface Tutorial {
2727
projectId: string
2828
name: string
2929
lookFor?: string
30+
projectInstruction?: string
3031
screens: {
3132
hint: Screen
3233
instructions: Screen
@@ -86,7 +87,9 @@ export default defineComponent({
8687
)
8788
},
8889
mission() {
89-
const message = this.$t('projectView.youAreLookingFor', { lookFor: this.tutorial.lookFor })
90+
const message = isDefined(this.tutorial?.projectInstruction)
91+
? this.tutorial.projectInstruction
92+
: this.$t('projectView.youAreLookingFor', { lookFor: this.tutorial.lookFor })
9093
return message
9194
},
9295
currentScreen() {

src/components/MediaProject.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import ProjectHeader from './ProjectHeader.vue'
66
import ProjectInfo from './ProjectInfo.vue'
77
import TaskProgress from '@/components/TaskProgress.vue'
88
import MediaProjectInstructions from './MediaProjectInstructions.vue'
9+
import { isDefined } from '@togglecorp/fujs'
910
1011
export default defineComponent({
1112
components: {
@@ -86,7 +87,9 @@ export default defineComponent({
8687
return attribution
8788
},
8889
mission() {
89-
const message = this.project?.lookFor
90+
const message = isDefined(this.project?.projectInstruction)
91+
? this.project.projectInstruction
92+
: this.project?.lookFor
9093
return message
9194
},
9295
isImageTask() {

src/components/StreetProject.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import ProjectInfo from './ProjectInfo.vue'
88
import TaskProgress from '@/components/TaskProgress.vue'
99
import StreetProjectInstructions from './StreetProjectInstructions.vue'
1010
import { defineComponent } from 'vue'
11+
import { isDefined } from '@togglecorp/fujs'
1112
1213
export default defineComponent({
1314
components: {
@@ -94,7 +95,9 @@ export default defineComponent({
9495
},
9596
computed: {
9697
mission() {
97-
const message = this.$t('projectView.youAreLookingFor', { lookFor: this.project.lookFor })
98+
const message = isDefined(this.project.projectInstruction)
99+
? this.project.projectInstruction
100+
: this.$t('projectView.youAreLookingFor', { lookFor: this.project.lookFor })
98101
return message
99102
},
100103
},

src/components/ValidateImageProject.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ const saveResults = inject<(results: Record<string, number>, startTime: string)
6363
const arrowKeys = ref(true);
6464
const startTime = shallowRef<string>();
6565
const instruction = computed(
66-
() => t('validateProject.doesTheShapeOutline', { feature: props.project.lookFor })
66+
() => isDefined(props.project.projectInstruction)
67+
? props.project.projectInstruction
68+
: t('validateProject.doesTheShapeOutline', { feature: props.project.lookFor })
6769
);
6870
6971
const emit = defineEmits<{ created: []}>();

src/components/ValidateImageProjectTutorial.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ const answersRevealed = ref(false);
2525
const results = ref<Record<string, number>>({});
2626
2727
const instruction = computed(
28-
() => t('validateProject.doesTheShapeOutline', { feature: props.tutorial.lookFor })
28+
() => isDefined(props.tutorial.projectInstruction)
29+
? props.tutorial.projectInstruction
30+
: t('validateProject.doesTheShapeOutline', { feature: props.tutorial.lookFor })
2931
);
3032
3133
const hasTasks = computed(() => isDefined(props.tasks) && props.tasks.length !== 0);

0 commit comments

Comments
 (0)