Form Newsletter and others fix

This commit is contained in:
Paolo Arena
2019-07-12 14:09:44 +02:00
parent 7f5076d8f2
commit b11dd46f9f
33 changed files with 119 additions and 47 deletions

View File

@@ -5,6 +5,7 @@ import { clone } from 'lodash'
import * as Types from './ApiTypes'
import { GlobalStore, UserStore } from '@store'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { serv_constants } from '@src/store/Modules/serv_constants'
export const API_URL = process.env.MONGODB_HOST

View File

@@ -8,6 +8,7 @@ export { addAuthHeaders, removeAuthHeaders, API_URL } from './Instance'
// import {AlgoliaSearch} from './AlgoliaController'
import Paths from '@paths'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { GlobalStore, Projects, UserStore } from '@modules'
import globalroutines from './../../globalroutines/index'

View File

@@ -4,6 +4,7 @@ import { GlobalStore, Todos, Projects, UserStore } from '@store'
import globalroutines from './../../globalroutines/index'
import { serv_constants } from '@src/store/Modules/serv_constants'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
export const OtherTables = ['categories', 'config', 'swmsg']
export const MainTables = ['todos', 'projects']
@@ -126,7 +127,7 @@ async function Sync_Execute(cmd, tablesync, nametab, method, item: ITodo, id, ms
console.log('ris write:', ris)
const sep = '|'
const multiparams = cmdSw + sep + tablesync + sep + nametab + sep + method + sep + UserStore.state.x_auth_token + sep + UserStore.state.lang
const multiparams = cmdSw + sep + tablesync + sep + nametab + sep + method + sep + UserStore.state.x_auth_token + sep + toolsext.getLocale()
const mymsgkey = {
_id: multiparams,
value: multiparams

View File

@@ -11,6 +11,7 @@ import Api from '@api'
import * as Types from '@src/store/Api/ApiTypes'
import { costanti } from '@src/store/Modules/costanti'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import * as ApiTables from '@src/store/Modules/ApiTables'
import { GlobalStore, Projects, Todos, UserStore } from '@store'
import messages from '../../statics/i18n'
@@ -132,7 +133,7 @@ namespace Getters {
const t = b.read((state) => (params) => {
const msg = params.split('.')
const lang = UserStore.state.lang
const lang = toolsext.getLocale()
const stringa = messages[lang]

View File

@@ -4,6 +4,7 @@ import { storeBuilder } from './Store/Store'
import Api from '@api'
import { tools } from './tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { lists } from './lists'
import * as ApiTables from './ApiTables'
import { GlobalStore, UserStore } from '@store'

View File

@@ -3,6 +3,7 @@ import { storeBuilder } from './Store/Store'
import Api from '@api'
import { tools } from './tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { lists } from './lists'
import * as ApiTables from './ApiTables'
import { GlobalStore, Todos, UserStore } from '@store'

View File

@@ -6,6 +6,7 @@ import router from '@router'
import { serv_constants } from '../Modules/serv_constants'
import { tools } from '../Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { GlobalStore, UserStore, Todos, Projects } from '@store'
import globalroutines from './../../globalroutines/index'
@@ -20,7 +21,7 @@ const state: IUserState = {
email: '',
username: '',
password: '',
lang: '',
lang: process.env.LANG_DEFAULT,
repeatPassword: '',
tokens: [],
verified_email: false,

View File

@@ -1,3 +1,5 @@
import { UserStore } from '@store'
export const costanti = {
ShowTypeTask: {
SHOW_LAST_N_COMPLETED: 200,
@@ -8,5 +10,5 @@ export const costanti = {
CONFIG_ID_STATE_CONN: '2',
CONFIG_ID_SHOW_TYPE_TODOS: '3',
MAX_PHASES: 5
MAX_PHASES: 5,
}

View File

@@ -1,6 +1,7 @@
import { Todos, Projects, UserStore } from '@store'
import globalroutines from './../../globalroutines/index'
import { costanti } from './costanti'
import { toolsext } from './toolsext'
import { translation } from './translation'
import Quasar, { date, Screen } from 'quasar'
import { IListRoutes, IMenuList, IProject, ITodo, Privacy } from '@src/model'
@@ -9,6 +10,7 @@ import translate from '@src/globalroutines/util'
import { RouteNames } from '@src/router/route-names'
import { lists } from './lists'
import { shen } from '@src/database/shen'
export interface INotify {
color?: string | 'primary'
@@ -65,14 +67,6 @@ export const tools = {
COMPLETED: 10
},
DateFormatter: new Intl.DateTimeFormat(this.getLocale() || void 0, {
weekday: 'long',
day: 'numeric',
month: 'long',
year: 'numeric'
// timeZone: 'UTC'
}),
selectPhase: {
it: [
{
@@ -931,7 +925,7 @@ export const tools = {
getStatusListByInd(index) {
try {
const arr = tools.selectStatus[UserStore.state.lang]
const arr = tools.selectStatus[toolsext.getLocale()]
for (const rec of arr) {
if (rec.value === index) {
return rec.label
@@ -945,9 +939,9 @@ export const tools = {
,
getPriorityByInd(index) {
// console.log('LANG in PRIOR', UserStore.state.lang)
// console.log('LANG in PRIOR', toolsext.getLocale())
try {
const arr = lists.selectPriority[UserStore.state.lang]
const arr = lists.selectPriority[toolsext.getLocale()]
for (const rec of arr) {
if (rec.value === index) {
return rec.label
@@ -1316,6 +1310,7 @@ export const tools = {
,
checkLangPassed(mylang) {
console.log('checkLangPassed')
const mybrowserLang = Quasar.lang.isoName
@@ -1339,11 +1334,15 @@ export const tools = {
if (!mylang) {
mylang = process.env.LANG_DEFAULT
}
if (toolsext.getLocale(true) === '') {
UserStore.mutations.setlang(mylang)
}
console.log('mylang calc : ', mylang)
return mylang
}
,
},
getimglogo() {
return 'statics/images/' + process.env.LOGO_REG
@@ -1816,16 +1815,20 @@ export const tools = {
return val + ''
},
getLocale() {
return UserStore.state.lang
getLocale(vero?: boolean) {
if (UserStore) {
if (UserStore.state) {
return UserStore.state.lang
}
}
if (!vero)
return process.env.LANG_DEFAULT
else
return ''
},
getDateStr(mydate) {
if (this.DateFormatter && this.getLocale()) {
const date = new Date(mydate)
return this.titleFormatter.format(date)
}
return ''
addDays(mydate, days) {
return date.addToDate(mydate, { days })
}
// getLocale() {