Browse Source

fix checkbox verbiage when no project is chosen for a give

Trent Larson 5 months ago
parent
commit
4c6c85983c
  1. 43
      src/views/GiftedDetails.vue

43
src/views/GiftedDetails.vue

@ -78,7 +78,7 @@
<div class="h-7 mt-4 flex">
<input
v-if="!givenToUser"
v-if="projectId && !givenToUser"
type="checkbox"
class="h-6 w-6 mr-2"
v-model="givenToProject"
@ -87,11 +87,15 @@
v-else
icon="square"
class="bg-slate-500 text-slate-500 h-5 w-5 px-0.5 py-0.5 mr-2 rounded"
@click="
notifyUser('Cannot be both given to you and also given to a project.')
"
@click="notifyUserOfProject()"
/>
<label class="text-sm mt-1">This was given to {{ projectName }}</label>
<label class="text-sm mt-1">
{{
projectId
? "This was given to " + projectName
: "No project was chosen"
}}
</label>
</div>
<div class="h-7 mt-4 flex">
@ -106,7 +110,7 @@
icon="square"
class="bg-slate-500 text-slate-500 h-5 w-5 px-0.5 py-0.5 mr-2 rounded"
@click="
notifyUser('Cannot be both given to a project and also given to you.')
notifyUser('You cannot assign this both a project and also to you.')
"
/>
<label class="text-sm mt-1">This was given to you</label>
@ -114,7 +118,7 @@
<div class="mt-4 flex">
<input type="checkbox" class="h-6 w-6 mr-2" v-model="isTrade" />
<label class="text-sm mt-1">Trade (not a gift)</label>
<label class="text-sm mt-1">This is a trade (not a gift)</label>
</div>
<p class="text-center mb-2 mt-6 italic">
@ -450,6 +454,31 @@ export default class GiftedDetails extends Vue {
);
}
notifyUserOfProject() {
if (!this.projectId) {
this.$notify(
{
group: "alert",
type: "warning",
title: "Error",
text: "To assign to a project, you must open this dialog through a project.",
},
3000,
);
} else {
// must be because givenToUser is true
this.$notify(
{
group: "alert",
type: "warning",
title: "Error",
text: "You cannot assign both to a project and to yourself.",
},
3000,
);
}
}
/**
*
* @param giverDid may be null

Loading…
Cancel
Save