Skip to content

Commit

Permalink
Merge pull request #334 from TaiBIF/feature/show-more-error-message
Browse files Browse the repository at this point in the history
Feature/show more error message
  • Loading branch information
moogoo78 authored Oct 9, 2019
2 parents 404666f + e2cf4d5 commit eed4830
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 28 deletions.
33 changes: 20 additions & 13 deletions src/components/StudyAreaSidebar/StudyAreaSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
type="text"
:id="`addArea_${studyArea.id}`"
placeholder="新增子樣區"
@keydown="addNewArea"
v-model="newSubStudyArea"
@keydown.enter="addNewSubStudyArea"
:data-parent-id="studyArea.id"
/>
</div>
Expand All @@ -62,8 +63,8 @@
type="text"
id="addParentArea"
placeholder="新增樣區"
v-model="newArea"
@keydown.enter="addNewArea"
v-model="newStudyArea"
@keydown.enter="addNewStudyArea"
/>
</div>
</div>
Expand Down Expand Up @@ -102,7 +103,8 @@ export default {
data() {
return {
expandId: null,
newArea: '',
newStudyArea: '',
newSubStudyArea: '',
};
},
methods: {
Expand All @@ -126,19 +128,24 @@ export default {
}
return `/project/${this.projectId}/study-areas/${studyArea.id}`;
},
addNewArea({ target }) {
if (!this.newArea) {
addNewSubStudyArea() {
const value = this.newSubStudyArea;
if (!value) {
return;
}
const value = this.newArea;
const parentId = target.getAttribute('data-parent-id');
const parentId = event.target.getAttribute('data-parent-id');
this.$emit('addArea', value, parentId);
this.$emit('handleSubmitBtnState', true);
// reset new area value
this.newArea = '';
this.newSubStudyArea = '';
},
addNewStudyArea() {
const value = this.newStudyArea;
if (!value) {
return;
}
this.$emit('addArea', value);
this.$emit('handleSubmitBtnState', true);
this.newStudyArea = '';
},
editArea(name, id) {
this.$emit('editArea', name, id);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Project/ProjectInfo/ProjectInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
projectId,
},
}"
class="float-right btn btn-green-border btn-sm"
class="float-right btn btn-green-border"
>
<i class="fa fa-pencil-alt mr-2"></i>
<span class="text" style="white-space: nowrap;"
Expand Down
12 changes: 6 additions & 6 deletions src/pages/Project/ProjectStudyAreas/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- Overview mode -->
<div v-else class="search-content">
<a
class="btn btn-green-border btn-sm float-right"
class="btn btn-green-border float-right"
v-tooltip.bottom="'將目前頁面或篩選範圍之資料輸出為 CSV 檔並下載'"
:href="canSearch ? exportCSVLink : undefined"
target="_blank"
Expand Down Expand Up @@ -136,21 +136,21 @@
hide-clear-button
></vue-timepicker>
</div>
<a
@click="clickSearch"
class="btn btn-sm btn-green"
<button
@click.prevent="clickSearch"
class="btn btn-green"
:style="{ margin: '4px' }"
:disabled="!canSearch"
>
篩選
</a>
</button>
</div>
</div>
</div>
</form>
<div>
<button
class="btn btn-sm btn-block btn-green"
class="btn btn-block btn-green"
@click="setEdit(true)"
:disabled="disabledEdit"
>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/UploadHistory/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@
<span v-else-if="errorType === 'missing-fields'">
缺少欄位: {{ errorMessage }}
</span>
<span v-else-if="errorType === 'others'">
其他錯誤
</span>
<span v-else>其他錯誤: {{ errorMessage }}</span>
</p></info-modal
>
</div>
Expand Down
3 changes: 0 additions & 3 deletions src/sass/components/_navbar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ nav.navbar
background: #30936F
border-right: 1px solid #1E5C45

.navbar-nav .btn
line-height: 40px !important

form.search
position: relative
margin-right: 1rem
Expand Down
3 changes: 1 addition & 2 deletions src/sass/globals/_page.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
width: 100%
max-width: 360px
font-size: 24px
height: 60px
line-height: 60px
line-height: 48px

section
min-height: 680px
Expand Down

0 comments on commit eed4830

Please sign in to comment.