diff --git a/front/client/components/AddCategoryDialog.vue b/front/client/components/AddCategoryDialog.vue
index e93f3f0..f981148 100644
--- a/front/client/components/AddCategoryDialog.vue
+++ b/front/client/components/AddCategoryDialog.vue
@@ -1,58 +1,76 @@
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
- Cancel
-
-
- Submit
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ Cancel
+
+
+ Submit
+
+
+
+
+
+
+
+ This group already has categories with the same name:
+ {{ category.title }}
+
+
diff --git a/front/client/components/ConfirmDialog.vue b/front/client/components/ConfirmDialog.vue
index 66d4917..c2deee8 100644
--- a/front/client/components/ConfirmDialog.vue
+++ b/front/client/components/ConfirmDialog.vue
@@ -2,14 +2,18 @@
-
- Are you sure you want to {{ text }} ?
+
+
+
+
+ {{ fullText || `Are you sure you want to ${text} ?` }}
@@ -17,17 +21,16 @@
- {{ confirmBtnText }}
+ {{ cancelBtnText }}
- {{ cancelBtnText }}
+ {{ confirmBtnText }}
@@ -42,12 +45,15 @@ import { Prop } from 'vue-property-decorator'
@Component
export default class ConfirmDialog extends Vue {
@Prop(String) text!: string
+ @Prop(String) fullText!: string
@Prop(Boolean) value!: boolean
+ @Prop(String) attach!: string
@Prop({ default: 'Continue' }) confirmBtnText!: string
@Prop({ default: 'Cancel' }) cancelBtnText!: string
close () {
this.$emit('input', false)
+ this.$emit('canceled')
}
confirm () {
this.$emit('confirmed')
diff --git a/front/client/helpers/ConfirmDecorator.ts b/front/client/helpers/ConfirmDecorator.ts
index 268bf03..1958802 100644
--- a/front/client/helpers/ConfirmDecorator.ts
+++ b/front/client/helpers/ConfirmDecorator.ts
@@ -1,14 +1,17 @@
interface IConfirmDialogProps {
- text: string,
- confirmBtnText?: string,
+ fullText: string
+ text: string
+ confirmBtnText?: string
cancelBtnText?: string
}
+// TODO looks like documentation isn't working
/**
* Use only for vue components methods.
* Executes '_confirm' function (see confirmDialogMixin.ts) with provided options before executing following method.
* If not confirmed method is not executed.
* @param {Object} options - options passed to _confirm function
* @param {String} options.text
+ * @param {String} options.fullText
* @param {String} options.confirmBtnText
* @param {String} options.cancelBtnText
*/
diff --git a/front/client/mixins/confirmDialogMixin.ts b/front/client/mixins/confirmDialogMixin.ts
index 9128905..12a8159 100644
--- a/front/client/mixins/confirmDialogMixin.ts
+++ b/front/client/mixins/confirmDialogMixin.ts
@@ -6,18 +6,20 @@ import DeferredPromise from 'utils/DeferredPromise'
const ComponentClass = Vue.extend(ConfirmDialog)
interface IConfirmDialogProps {
- text: string,
- confirmBtnText?: string,
+ fullText: string
+ text: string
+ confirmBtnText?: string
cancelBtnText?: string
}
@Mixin
export default class ConfirmDialogMixin extends Vue {
- async _confirm ({ text, confirmBtnText, cancelBtnText }: IConfirmDialogProps): Promise {
+ async _confirm ({ text, fullText, confirmBtnText, cancelBtnText }: IConfirmDialogProps): Promise {
const instance = new ComponentClass({
propsData: {
value: true,
text,
+ fullText,
confirmBtnText,
cancelBtnText
}