Skip to content

Commit

Permalink
fix(chatbot): templates with invalid syntax
Browse files Browse the repository at this point in the history
Whether or not these are WIP I think it'd be great not to have syntax
errors. In addition, now these files are formatted accordingly.
  • Loading branch information
blackxored committed Dec 12, 2018
1 parent 896dd7d commit 7d00c8f
Show file tree
Hide file tree
Showing 13 changed files with 402 additions and 477 deletions.
Original file line number Diff line number Diff line change
@@ -1,91 +1,77 @@
<template>
<ModalLayout
:showControls="false"
:customControls="true"
:title="$t('Caps Protection Preferences')"
>
<div slot="fixed">
<Tabs :tabs="tabs" :value="selectedTab" @input="onSelectTabHandler">
</Tabs>
</div>
<div slot="content" class="chatbot-caps-protection__container">
<transition name='fade' mode="out-in" appear>
<validated-form ref="form">
<div v-if="selectedTab === 'general' && capsProtection">
<div class="row">
<div class="small-6 columns">
<VFormGroup
:title="$t('Auto Permit')"
v-model="capsProtection.general.excluded.level"
:metadata="metadata.caps.general.excluded.level"
/>
</div>
<div class="small-6 columns">
<VFormGroup
:title="$t('Punishment')"
v-model="capsProtection.general.punishment.type"
:metadata="metadata.caps.general.punishment.type"
/>
<ModalLayout
:showControls="false"
:customControls="true"
:title="$t('Caps Protection Preferences')"
>
<div slot="fixed">
<Tabs :tabs="tabs" :value="selectedTab" @input="onSelectTabHandler"> </Tabs>
</div>
<div slot="content" class="chatbot-caps-protection__container">
<transition name="fade" mode="out-in" appear>
<validated-form ref="form">
<div v-if="selectedTab === 'general' && capsProtection">
<div class="row">
<div class="small-6 columns">
<VFormGroup
:title="$t('Auto Permit')"
v-model="capsProtection.general.excluded.level"
:metadata="metadata.caps.general.excluded.level"
/>
</div>
<div class="small-6 columns">
<VFormGroup
:title="$t('Punishment')"
v-model="capsProtection.general.punishment.type"
:metadata="metadata.caps.general.punishment.type"
/>
</div>
</div>
<VFormGroup
v-if="capsProtection.general.punishment.type === 'Timeout'"
:title="$t('Punishment Duration (Value in Minutes)')"
v-model="capsProtection.general.punishment.duration"
:metadata="metadata.caps.general.punishment.duration"
/>
<VFormGroup
:title="$t('Punishment Response (Line breaks will be ignored)')"
v-model="capsProtection.general.message"
:metadata="metadata.caps.general.message"
/>
</div>
<VFormGroup
v-if="capsProtection.general.punishment.type === 'Timeout'"
:title="$t('Punishment Duration (Value in Minutes)')"
v-model="capsProtection.general.punishment.duration"
:metadata="metadata.caps.general.punishment.duration"
/>
<VFormGroup
:title="$t('Punishment Response (Line breaks will be ignored)')"
v-model="capsProtection.general.message"
:metadata="metadata.caps.general.message"
/>
</div>
<div v-if="selectedTab === 'advanced'">
<VFormGroup
:title="$t('Minimum Amount of Caps')"
v-model="capsProtection.advanced.minimum"
:metadata="metadata.caps.advanced.minimum"
/>
<VFormGroup
:title="$t('Maximum Amount of Caps')"
v-model="capsProtection.advanced.maximum"
:metadata="metadata.caps.advanced.maximum"
/>
<VFormGroup
:title="$t('Maximum Percent')"
v-model="capsProtection.advanced.percent"
:metadata="metadata.caps.advanced.percent"
/>
</div>
</validated-form>
</transition>
</div>
<div slot="controls" class="flex flex--space-between">
<button
class="button button--default"
@click="onResetHandler">
{{ $t('Reset') }}
</button>
<div>
<button
class="button button--default"
@click="onCancelHandler">
{{ $t('Cancel') }}
</button>
<button
class="button button--action"
@click="onSaveHandler"
>
{{ $t("Save") }}
</button>
<div v-if="selectedTab === 'advanced'">
<VFormGroup
:title="$t('Minimum Amount of Caps')"
v-model="capsProtection.advanced.minimum"
:metadata="metadata.caps.advanced.minimum"
/>
<VFormGroup
:title="$t('Maximum Amount of Caps')"
v-model="capsProtection.advanced.maximum"
:metadata="metadata.caps.advanced.maximum"
/>
<VFormGroup
:title="$t('Maximum Percent')"
v-model="capsProtection.advanced.percent"
:metadata="metadata.caps.advanced.percent"
/>
</div>
</validated-form>
</transition>
</div>
<div slot="controls" class="flex flex--space-between">
<button class="button button--default" @click="onResetHandler">{{ $t('Reset') }}</button>
<div>
<button class="button button--default" @click="onCancelHandler">{{ $t('Cancel') }}</button>
<button class="button button--action" @click="onSaveHandler">{{ $t('Save') }}</button>
</div>
</div>
</div>
</ModalLayout>
</ModalLayout>
</template>

<script lang="ts" src="./ChatbotCapsProtectionWindow.vue.ts"></script>

<style <style lang="less" scoped>
<style lang="less" scoped>
.chatbot-caps-protection__container {
padding-top: 45px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,85 +1,75 @@
<template>
<ModalLayout
:showControls="false"
:customControls="true"
:title="isEdit ? $t('Edit Command') : $t('Add Command')"
>
<div slot="fixed">
<Tabs :tabs="tabs" :value="selectedTab" @input="onSelectTabHandler">
</Tabs>
</div>
<div slot="content" class="chatbot-add-command__container">
<transition name='fade' mode="out-in" appear>
<validated-form ref="form">
<div v-if="selectedTab === 'general'">
<VFormGroup
:title="$t('Command')"
v-model="newCommand.command"
:metadata="commandMetadata"
/>
<VFormGroup
:title="$t('Response (Line breaks will be ignored)')"
v-model="newCommand.response"
:metadata="responseMetadata"
/>
<div class="row">
<div class="small-6 columns">
<VFormGroup
:title="$t('Permission')"
v-model="newCommand.permission.level"
:metadata="permissionMetadata"
/>
</div>
<div class="small-6 columns">
<VFormGroup
:title="$t('Reply In')"
v-model="newCommand.response_type"
:metadata="replyTypeMetadata"
/>
<ModalLayout
:showControls="false"
:customControls="true"
:title="isEdit ? $t('Edit Command') : $t('Add Command')"
>
<div slot="fixed">
<Tabs :tabs="tabs" :value="selectedTab" @input="onSelectTabHandler"> </Tabs>
</div>
<div slot="content" class="chatbot-add-command__container">
<transition name="fade" mode="out-in" appear>
<validated-form ref="form">
<div v-if="selectedTab === 'general'">
<VFormGroup
:title="$t('Command')"
v-model="newCommand.command"
:metadata="commandMetadata"
/>
<VFormGroup
:title="$t('Response (Line breaks will be ignored)')"
v-model="newCommand.response"
:metadata="responseMetadata"
/>
<div class="row">
<div class="small-6 columns">
<VFormGroup
:title="$t('Permission')"
v-model="newCommand.permission.level"
:metadata="permissionMetadata"
/>
</div>
<div class="small-6 columns">
<VFormGroup
:title="$t('Reply In')"
v-model="newCommand.response_type"
:metadata="replyTypeMetadata"
/>
</div>
</div>
</div>
</div>
<div v-if="selectedTab === 'advanced'">
<div class="row">
<div class="small-6 columns">
<VFormGroup
:title="$t('Global Command Cooldown (Value in Seconds)')"
v-model="newCommand.cooldowns.global"
:metadata="cooldownsMetadata"
/>
</div>
<div class="small-6 columns">
<VFormGroup
:title="$t('User Command Cooldown (Value in Seconds)')"
v-model="newCommand.cooldowns.user"
:metadata="cooldownsMetadata"
/>
<div v-if="selectedTab === 'advanced'">
<div class="row">
<div class="small-6 columns">
<VFormGroup
:title="$t('Global Command Cooldown (Value in Seconds)')"
v-model="newCommand.cooldowns.global"
:metadata="cooldownsMetadata"
/>
</div>
<div class="small-6 columns">
<VFormGroup
:title="$t('User Command Cooldown (Value in Seconds)')"
v-model="newCommand.cooldowns.user"
:metadata="cooldownsMetadata"
/>
</div>
</div>
<ChatbotAliases v-model="newCommand.aliases" />
</div>
<ChatbotAliases v-model="newCommand.aliases" />
</div>
</validated-form>
</transition>
</div>
<div slot="controls">
<button
class="button button--default"
@click="onCancelHandler">
{{ $t('Cancel') }}
</button>
<button
class="button button--action"
@click="onSaveHandler"
>
{{ $t("Save") }}
</button>
</div>
</ModalLayout>
</validated-form>
</transition>
</div>
<div slot="controls">
<button class="button button--default" @click="onCancelHandler">{{ $t('Cancel') }}</button>
<button class="button button--action" @click="onSaveHandler">{{ $t('Save') }}</button>
</div>
</ModalLayout>
</template>

<script lang="ts" src="./ChatbotCustomCommandWindow.vue.ts"></script>

<style <style lang="less" scoped>
<style lang="less" scoped>
.chatbot-add-command__container {
padding-top: 45px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { $t } from 'services/i18n';

import { ICustomCommand, IChatbotErrorResponse } from 'services/chatbot';

import { EInputType, IListMetadata, ITextMetadata, INumberMetadata } from '../../../shared/inputs';
import {
EInputType,
IListMetadata,
ITextMetadata,
INumberMetadata,
} from 'components/shared/inputs';

@Component({
components: {
Expand Down
Loading

0 comments on commit 7d00c8f

Please sign in to comment.