This commit is contained in:
2020-12-23 23:02:26 +00:00
parent d114d7175b
commit 82749eb98b
10 changed files with 100 additions and 112 deletions

View File

@@ -6,17 +6,6 @@
MISC ITEMS THAT CAME UP MISC ITEMS THAT CAME UP
todo: time picker no way to select NOW
todo: time picker defaults to 12:00am when date is selected, how about current time instead?
todo: date picker component add drop down quick pick:
i.e. Hour from now, Day from now, Week from now, Month from now.
todo: datetime picker read only mode is grayed out, should not be?
probably still setting both readonly and disabled like old times
todo: Server returned broken rules not showing in form beside the field in Question todo: Server returned broken rules not showing in form beside the field in Question
test on widget form to confirm test on widget form to confirm
todo: incorrect creds on login get "res is not defined" instead of proper error todo: incorrect creds on login get "res is not defined" instead of proper error

View File

@@ -38,7 +38,6 @@
:value="readonlyFormat()" :value="readonlyFormat()"
:label="label" :label="label"
readonly readonly
disabled
prepend-icon="$ayiCalendarAlt" prepend-icon="$ayiCalendarAlt"
></v-text-field> ></v-text-field>
<p v-show="error" class="form__error v-messages theme--light error--text"> <p v-show="error" class="form__error v-messages theme--light error--text">

View File

@@ -19,7 +19,6 @@
:value="readonlyFormat()" :value="readonlyFormat()"
:label="label" :label="label"
readonly readonly
disabled
></v-text-field> ></v-text-field>
</template> </template>
</div> </div>

View File

@@ -1,87 +1,92 @@
<template> <template>
<v-row> <div>
<template v-if="!readonly"> <div>
<v-col xs6> <v-row>
<v-dialog v-model="dlgdate" width="290px"> <template v-if="!readonly">
<template v-slot:activator="{ on }"> <v-col xs6>
<v-text-field <v-dialog v-model="dlgdate" width="290px">
v-on="on" <template v-slot:activator="{ on }">
prepend-icon="$ayiCalendarAlt" <v-text-field
@click:prepend="dlgdate = true" v-on="on"
:value="dateValue" prepend-icon="$ayiCalendarAlt"
v-bind:label="label" @click:prepend="dlgdate = true"
v-bind:rules="rules" :value="dateValue"
readonly v-bind:label="label"
:error="!!error" v-bind:rules="rules"
:data-cy="'dtfpick:' + testId" readonly
></v-text-field> :error="!!hasErrors"
</template> :data-cy="'dtfpick:' + testId"
<v-date-picker ></v-text-field>
:value="dateValue" </template>
@input="updateDateValue" <v-date-picker
:locale="defaultLocale" :value="dateValue"
:data-cy="'dpick:' + testId" @input="updateDateValue"
> :locale="defaultLocale"
<v-btn text color="primary" @click="$emit('input', null)">{{ :data-cy="'dpick:' + testId"
$ay.t("Delete") >
}}</v-btn> <v-btn text color="primary" @click="$emit('input', null)">{{
<v-spacer></v-spacer> $ay.t("Delete")
<v-btn text color="primary" @click="dlgdate = false">{{ }}</v-btn>
$ay.t("OK") <v-spacer></v-spacer>
}}</v-btn> <v-btn text color="primary" @click="dlgdate = false">{{
</v-date-picker> $ay.t("OK")
</v-dialog> }}</v-btn>
</v-col> </v-date-picker>
<v-col xs6> </v-dialog>
<v-dialog v-model="dlgtime" width="300px"> </v-col>
<template v-slot:activator="{ on }"> <v-col xs6>
<v-text-field <v-dialog v-model="dlgtime" width="300px">
v-on="on" <template v-slot:activator="{ on }">
:value="readonlyTimeFormat()" <v-text-field
label v-on="on"
prepend-icon="$ayiClock" :value="readonlyTimeFormat()"
@click:prepend="dlgtime = true" label
readonly prepend-icon="$ayiClock"
:error="!!error" @click:prepend="dlgtime = true"
:data-cy="'ttfpick:' + testId" readonly
></v-text-field> :error="!!hasErrors"
</template> :data-cy="'ttfpick:' + testId"
<v-time-picker ></v-text-field>
scrollable </template>
ampm-in-title <v-time-picker
:format="hour12 ? 'ampm' : '24hr'" scrollable
:value="timeValue" ampm-in-title
@input="updateTimeValue" :format="hour12 ? 'ampm' : '24hr'"
:data-cy="'tpick:' + testId" :value="timeValue"
> @input="updateTimeValue"
<v-btn text color="primary" @click="$emit('input', null)">{{ :data-cy="'tpick:' + testId"
$ay.t("Delete") >
}}</v-btn> <v-btn text color="primary" @click="$emit('input', null)">{{
<v-spacer></v-spacer> $ay.t("Delete")
<v-btn text color="primary" @click="setNow()">{{ }}</v-btn>
$ay.t("Now") <v-spacer></v-spacer>
}}</v-btn> <v-btn text color="primary" @click="setNow()">{{
<v-spacer></v-spacer> $ay.t("Now")
<v-btn text color="primary" @click="dlgtime = false">{{ }}</v-btn>
$ay.t("OK") <v-spacer></v-spacer>
}}</v-btn> <v-btn text color="primary" @click="dlgtime = false">{{
</v-time-picker> $ay.t("OK")
</v-dialog> }}</v-btn>
</v-col> </v-time-picker>
</template> </v-dialog>
<template v-else> </v-col>
<v-text-field </template>
:value="readonlyFormat()" <template v-else>
:label="label" <v-text-field
readonly :value="readonlyFormat()"
disabled :label="label"
prepend-icon="$ayiCalendarAlt" readonly
></v-text-field> prepend-icon="$ayiCalendarAlt"
<p v-show="error" class="form__error v-messages theme--light error--text"> ></v-text-field>
{{ error }} </template>
</p> </v-row>
</template> </div>
</v-row> <div class="v-messages theme--light error--text mt-n5" role="alert">
<div class="v-messages__wrapper">
<div class="v-messages__message">{{ allErrors() }}</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
/* Xeslint-disable */ /* Xeslint-disable */
@@ -98,17 +103,16 @@ export default {
props: { props: {
label: String, label: String,
rules: Array, rules: Array,
"error-messages": { type: Array, default: null }, errorMessages: { type: Array, default: null },
value: String, value: String,
readonly: { type: Boolean, default: false }, readonly: { type: Boolean, default: false },
disabled: { type: Boolean, default: false }, disabled: { type: Boolean, default: false },
error: {
type: String,
required: false
},
testId: String testId: String
}, },
computed: { computed: {
hasErrors() {
return this.errorMessages != null && this.errorMessages.length > 0;
},
timeValue() { timeValue() {
return window.$gz.locale.utcDateStringToLocal8601TimeOnlyString( return window.$gz.locale.utcDateStringToLocal8601TimeOnlyString(
this.value, this.value,
@@ -130,9 +134,7 @@ export default {
}, },
allErrors() { allErrors() {
let ret = ""; let ret = "";
if (this.error != null) {
ret = this.error;
}
if (this.errorMessages != null && this.errorMessages.length > 0) { if (this.errorMessages != null && this.errorMessages.length > 0) {
ret += this.errorMessages.toString(); ret += this.errorMessages.toString();
} }

View File

@@ -32,7 +32,6 @@
:value="readonlyFormat()" :value="readonlyFormat()"
:label="label" :label="label"
readonly readonly
disabled
></v-text-field> ></v-text-field>
</template> </template>
</v-row> </v-row>

View File

@@ -42,7 +42,6 @@
:value="readonlyFormat()" :value="readonlyFormat()"
:label="label" :label="label"
prepend-icon="$ayiClock" prepend-icon="$ayiClock"
disabled
readonly readonly
></v-text-field> ></v-text-field>
<p v-show="error" class="form__error v-messages theme--light error--text"> <p v-show="error" class="form__error v-messages theme--light error--text">

View File

@@ -19,7 +19,6 @@
:value="readonlyFormat()" :value="readonlyFormat()"
:label="label" :label="label"
readonly readonly
disabled
></v-text-field> ></v-text-field>
</template> </template>
</div> </div>

View File

@@ -152,7 +152,6 @@
:label="$ay.t('LastLogin')" :label="$ay.t('LastLogin')"
v-model="obj.lastLogin" v-model="obj.lastLogin"
readonly readonly
disabled
ref="lastLogin" ref="lastLogin"
testId="lastLogin" testId="lastLogin"
></gz-date-time-picker> ></gz-date-time-picker>

View File

@@ -142,7 +142,6 @@
:label="$ay.t('LastLogin')" :label="$ay.t('LastLogin')"
v-model="obj.lastLogin" v-model="obj.lastLogin"
readonly readonly
disabled
ref="lastLogin" ref="lastLogin"
testId="lastLogin" testId="lastLogin"
></gz-date-time-picker> ></gz-date-time-picker>

View File

@@ -50,7 +50,8 @@
ref="count" ref="count"
data-cy="count" data-cy="count"
:rules="[form().integerValid(this, 'count')]" :rules="[form().integerValid(this, 'count')]"
:error-messages="form().serverErrors(this, 'count')" :error-messages="['blah', 'blah2']"
:serror-messages="form().serverErrors(this, 'count')"
@input="fieldValueChanged('count')" @input="fieldValueChanged('count')"
type="number" type="number"
></v-text-field> ></v-text-field>
@@ -85,11 +86,14 @@
:readonly="formState.readOnly" :readonly="formState.readOnly"
ref="startDate" ref="startDate"
testId="startDate" testId="startDate"
:error-messages="form().serverErrors(this, 'startDate')" :error-messages="[
'blah',
'blah2 teh quick brown fox jumped over teh six lazy dogs'
]"
@input="fieldValueChanged('startDate')" @input="fieldValueChanged('startDate')"
></gz-date-time-picker> ></gz-date-time-picker>
</v-col> </v-col>
<!-- :error-messages="form().serverErrors(this, 'startDate')" -->
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker <gz-date-time-picker
:label="$ay.t('WidgetEndDate')" :label="$ay.t('WidgetEndDate')"