Browse Source

Merge pull request #900 from doccano/fix/#825

Replace BaseDialog with VDialog, fix #825
pull/903/head
Hiroki Nakayama 4 years ago
committed by GitHub
parent
commit
8f623a5190
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 48 deletions
  1. 9
      frontend/components/containers/annotation/GuidelineButton.vue
  2. 16
      frontend/components/containers/documents/DocumentActionMenu.vue
  3. 9
      frontend/components/containers/documents/DocumentDeletionButton.vue
  4. 16
      frontend/components/containers/labels/LabelActionMenu.vue
  5. 9
      frontend/components/containers/labels/LabelDeletionButton.vue
  6. 24
      frontend/components/molecules/BaseDialog.vue

9
frontend/components/containers/annotation/GuidelineButton.vue

@ -16,24 +16,25 @@
</template> </template>
<span>Show guideline</span> <span>Show guideline</span>
</v-tooltip> </v-tooltip>
<base-dialog :dialog="dialog">
<v-dialog
v-model="dialog"
width="800"
>
<guideline-card <guideline-card
v-if="currentProject" v-if="currentProject"
:guideline-text="currentProject.guideline" :guideline-text="currentProject.guideline"
@close="dialog=false" @close="dialog=false"
/> />
</base-dialog>
</v-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import BaseDialog from '@/components/molecules/BaseDialog'
import GuidelineCard from '@/components/organisms/annotation/GuidelineCard' import GuidelineCard from '@/components/organisms/annotation/GuidelineCard'
export default { export default {
components: { components: {
BaseDialog,
GuidelineCard GuidelineCard
}, },

16
frontend/components/containers/documents/DocumentActionMenu.vue

@ -5,34 +5,38 @@
@upload="importDialog=true" @upload="importDialog=true"
@download="exportDialog=true" @download="exportDialog=true"
/> />
<base-dialog :dialog="importDialog">
<v-dialog
v-model="importDialog"
width="800"
>
<document-upload-form <document-upload-form
:upload-document="uploadDocument" :upload-document="uploadDocument"
:formats="getImportFormat" :formats="getImportFormat"
@close="importDialog=false" @close="importDialog=false"
/> />
</base-dialog>
<base-dialog :dialog="exportDialog">
</v-dialog>
<v-dialog
v-model="exportDialog"
width="800"
>
<document-export-form <document-export-form
:export-document="exportDocument" :export-document="exportDocument"
:formats="getExportFormat" :formats="getExportFormat"
@close="exportDialog=false" @close="exportDialog=false"
/> />
</base-dialog>
</v-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
import ActionMenu from '@/components/molecules/ActionMenu' import ActionMenu from '@/components/molecules/ActionMenu'
import BaseDialog from '@/components/molecules/BaseDialog'
import DocumentUploadForm from '@/components/organisms/documents/DocumentUploadForm' import DocumentUploadForm from '@/components/organisms/documents/DocumentUploadForm'
import DocumentExportForm from '@/components/organisms/documents/DocumentExportForm' import DocumentExportForm from '@/components/organisms/documents/DocumentExportForm'
export default { export default {
components: { components: {
ActionMenu, ActionMenu,
BaseDialog,
DocumentUploadForm, DocumentUploadForm,
DocumentExportForm DocumentExportForm
}, },

9
frontend/components/containers/documents/DocumentDeletionButton.vue

@ -8,7 +8,10 @@
> >
Delete Delete
</v-btn> </v-btn>
<base-dialog :dialog="dialog">
<v-dialog
v-model="dialog"
width="800"
>
<confirm-form <confirm-form
:items="selected" :items="selected"
title="Delete Document" title="Delete Document"
@ -17,18 +20,16 @@
@ok="deleteDocument($route.params.id);dialog=false" @ok="deleteDocument($route.params.id);dialog=false"
@cancel="dialog=false" @cancel="dialog=false"
/> />
</base-dialog>
</v-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapGetters, mapActions } from 'vuex' import { mapState, mapGetters, mapActions } from 'vuex'
import BaseDialog from '@/components/molecules/BaseDialog'
import ConfirmForm from '@/components/organisms/utils/ConfirmForm' import ConfirmForm from '@/components/organisms/utils/ConfirmForm'
export default { export default {
components: { components: {
BaseDialog,
ConfirmForm ConfirmForm
}, },

16
frontend/components/containers/labels/LabelActionMenu.vue

@ -6,33 +6,37 @@
@upload="importDialog=true" @upload="importDialog=true"
@download="handleDownload" @download="handleDownload"
/> />
<base-dialog :dialog="createDialog">
<v-dialog
v-model="createDialog"
width="800"
>
<label-creation-form <label-creation-form
:create-label="createLabel" :create-label="createLabel"
:keys="shortkeys" :keys="shortkeys"
@close="createDialog=false" @close="createDialog=false"
/> />
</base-dialog>
<base-dialog :dialog="importDialog">
</v-dialog>
<v-dialog
v-model="importDialog"
width="800"
>
<label-import-form <label-import-form
:upload-label="uploadLabel" :upload-label="uploadLabel"
@close="importDialog=false" @close="importDialog=false"
/> />
</base-dialog>
</v-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
import ActionMenu from '@/components/molecules/ActionMenu' import ActionMenu from '@/components/molecules/ActionMenu'
import BaseDialog from '@/components/molecules/BaseDialog'
import LabelCreationForm from '@/components/organisms/labels/LabelCreationForm' import LabelCreationForm from '@/components/organisms/labels/LabelCreationForm'
import LabelImportForm from '@/components/organisms/labels/LabelImportForm' import LabelImportForm from '@/components/organisms/labels/LabelImportForm'
export default { export default {
components: { components: {
ActionMenu, ActionMenu,
BaseDialog,
LabelCreationForm, LabelCreationForm,
LabelImportForm LabelImportForm
}, },

9
frontend/components/containers/labels/LabelDeletionButton.vue

@ -8,7 +8,10 @@
> >
Delete Delete
</v-btn> </v-btn>
<base-dialog :dialog="dialog">
<v-dialog
v-model="dialog"
width="800"
>
<confirm-form <confirm-form
:items="selected" :items="selected"
title="Delete Label" title="Delete Label"
@ -17,18 +20,16 @@
@ok="deleteLabel($route.params.id);dialog=false" @ok="deleteLabel($route.params.id);dialog=false"
@cancel="dialog=false" @cancel="dialog=false"
/> />
</base-dialog>
</v-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapGetters, mapActions } from 'vuex' import { mapState, mapGetters, mapActions } from 'vuex'
import BaseDialog from '@/components/molecules/BaseDialog'
import ConfirmForm from '@/components/organisms/utils/ConfirmForm' import ConfirmForm from '@/components/organisms/utils/ConfirmForm'
export default { export default {
components: { components: {
BaseDialog,
ConfirmForm ConfirmForm
}, },

24
frontend/components/molecules/BaseDialog.vue

@ -1,24 +0,0 @@
<template>
<v-dialog
:value="dialog"
:width="width"
>
<slot />
</v-dialog>
</template>
<script>
export default {
props: {
dialog: {
type: Boolean,
default: false,
required: true
},
width: {
type: String,
default: '800'
}
}
}
</script>
Loading…
Cancel
Save