Skip to content

Commit 07cdb72

Browse files
committed
Changes after code review
1 parent 1d208a6 commit 07cdb72

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

lib/components/form/list.vue

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ except according to the terms contained in the LICENSE file.
4444
<tr v-for="form of forms" :key="form.xmlFormId">
4545
<td>
4646
<div>
47-
<router-link :to="`/forms/${form.xmlFormId}/submissions`" tag="span">
47+
<router-link :to="`/forms/${form.xmlFormId}/submissions`"
48+
class="form-list-form-name">
4849
{{ form.name || form.xmlFormId }}
4950
</router-link>
5051
</div>
51-
<div v-if="form.name != null">{{ form.xmlFormId }}</div>
52+
<div v-if="form.name != null" class="form-list-form-id">
53+
{{ form.xmlFormId }}
54+
</div>
5255
<div>{{ submissions(form) }}</div>
5356
</td>
5457
<td>
@@ -105,8 +108,9 @@ export default {
105108
.catch(() => {});
106109
},
107110
submissions(form) {
111+
const count = form.submissions.toLocaleString();
108112
const s = form.submissions !== 1 ? 's' : '';
109-
return `${form.submissions} submission${s}`;
113+
return `${count} submission${s}`;
110114
},
111115
updatedAt(form) {
112116
const updatedAt = form.updatedAt != null ? form.updatedAt : form.createdAt;
@@ -122,20 +126,17 @@ export default {
122126

123127
<style lang="sass">
124128
#form-list-table {
125-
td {
129+
tbody td {
126130
vertical-align: middle;
127131

128-
&:first-child {
129-
div:first-child {
130-
span {
131-
cursor: pointer;
132-
font-size: 30px;
133-
}
134-
}
132+
.form-list-form-name {
133+
color: unset;
134+
font-size: 30px;
135+
text-decoration: unset;
136+
}
135137

136-
div:nth-child(2):nth-last-child(2) {
137-
font-size: 18px;
138-
}
138+
.form-list-form-id {
139+
font-size: 18px;
139140
}
140141
}
141142
}

lib/components/form/new.vue

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ except according to the terms contained in the LICENSE file.
2121
<doc-link>tools available</doc-link> to help you design your form.
2222
</p>
2323
</div>
24-
<div id="drop-zone" class="text-center" :style="dropZoneStyle"
25-
@dragover.prevent="dragover" @dragleave="dragleave" @drop.prevent="drop">
24+
<div id="drop-zone" :class="dropZoneClass" @dragover.prevent="dragover"
25+
@dragleave="dragleave" @drop.prevent="drop">
2626
<div :style="pointerEvents">
2727
Drop a file here, or
2828
<input type="file" ref="input" class="hidden"
@@ -33,7 +33,7 @@ except according to the terms contained in the LICENSE file.
3333
</button>
3434
to upload.
3535
</div>
36-
<div :style="pointerEvents">{{ filename }}</div>
36+
<div id="form-new-filename" :style="pointerEvents">{{ filename }}</div>
3737
</div>
3838
<div class="modal-actions">
3939
<button type="button" class="btn btn-primary"
@@ -78,11 +78,12 @@ export default {
7878
droppable() {
7979
return !(this.reading || this.awaitingResponse);
8080
},
81-
dropZoneStyle() {
82-
const style = {};
83-
if (this.isOverDropZone || !this.droppable) style.opacity = 0.65;
84-
if (!this.droppable) style.cursor = 'not-allowed';
85-
return style;
81+
dropZoneClass() {
82+
return {
83+
'text-center': true,
84+
droppable: this.droppable,
85+
dragover: this.isOverDropZone
86+
};
8687
},
8788
// Used to prevent child elements of #drop-zone from triggering dragleave
8889
// events upon hover. Does not work for IE9 or 10.
@@ -176,15 +177,24 @@ export default {
176177

177178
#drop-zone {
178179
background-color: $color-input-background;
179-
border: 1px dashed #dcdcdc;
180+
border: 1px dashed $color-subpanel-border;
181+
182+
&.dragover {
183+
opacity: 0.65;
184+
}
185+
186+
&:not(.droppable) {
187+
cursor: not-allowed;
188+
opacity: 0.65;
189+
}
180190

181191
div {
182192
margin-bottom: 5px;
183193
margin-top: 5px;
194+
}
184195

185-
&:last-child {
186-
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
187-
}
196+
#form-new-filename {
197+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
188198
}
189199
}
190200
</style>

lib/components/form/submissions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export default {
7575
return `${this.form.xmlFormId}.zip`;
7676
},
7777
downloadButtonText() {
78-
if (this.submissions.length === 1) return 'Download 1 record';
7978
const count = this.submissions.length.toLocaleString();
80-
return `Download all ${count} records`;
79+
const s = this.submissions.length !== 1 ? 's' : '';
80+
return `Download all ${count} record${s}`;
8181
}
8282
},
8383
watch: {

0 commit comments

Comments
 (0)