Commit 495f990b authored by Reza Sahebgharan's avatar Reza Sahebgharan

feat(client side debug): write client side debug for methods

parent a538536f
Pipeline #1167 passed with stage
in 45 minutes and 56 seconds
...@@ -41,7 +41,11 @@ ...@@ -41,7 +41,11 @@
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-checkbox v-model="ClientForm.AutoComplete" class="mx-2" :label="$t('Client.AutoCompleteLabel')"></v-checkbox> <v-checkbox
v-model="ClientForm.AutoComplete"
class="mx-2"
:label="$t('Client.AutoCompleteLabel')"
></v-checkbox>
</v-col> </v-col>
</v-row> </v-row>
</v-container> </v-container>
...@@ -133,8 +137,8 @@ ...@@ -133,8 +137,8 @@
<script> <script>
import Client from "../../imports/api/collections/clients.js"; import Client from "../../imports/api/collections/clients.js";
import { Meteor } from "meteor/meteor"; import { Meteor } from "meteor/meteor";
// import { log_init, logClient } from "../../imports/plugins/logger"; import { log_init, logClient } from "../../imports/plugins/logger";
// log_init(); log_init();
export default { export default {
data() { data() {
...@@ -163,12 +167,8 @@ export default { ...@@ -163,12 +167,8 @@ export default {
minLength: 0, minLength: 0,
numberRules: [ numberRules: [
// v => !!v || "Input is required!", // v => !!v || "Input is required!",
v => v => v < this.maxLength || this.$t("Client.lessThan25"),
v < this.maxLength || v => v > this.minLength || this.$t("Client.greaterThanZero")
this.$t("Client.lessThan25"),
v =>
v > this.minLength ||
this.$t("Client.greaterThanZero")
] ]
}; };
}, },
...@@ -215,13 +215,6 @@ export default { ...@@ -215,13 +215,6 @@ export default {
} }
}, },
openNewDialog() { openNewDialog() {
// logClient(
// "debug",
// `openNewDialog() => newDialog `,
// this.ClientForm,
// Meteor.user().username
// );
for (let prop in this.ClientForm) { for (let prop in this.ClientForm) {
this.$set(this.ClientForm, prop, ""); this.$set(this.ClientForm, prop, "");
} }
...@@ -269,12 +262,49 @@ export default { ...@@ -269,12 +262,49 @@ export default {
this.loading = true; this.loading = true;
let me = this; let me = this;
if (this.newOrEdit == "new") { if (this.newOrEdit == "new") {
debugger
Meteor.settings.public.enableDebug
? logClient(
"debug",
`createClient Method Called from Client `,
this.ClientForm,
Meteor.user().username
)
: "";
Meteor.call("createClient", this.ClientForm, function(error, result) { Meteor.call("createClient", this.ClientForm, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`createClient Method error`,
error,
Meteor.user().username
)
: "";
}
}); });
} }
if (this.newOrEdit == "edit") { if (this.newOrEdit == "edit") {
Meteor.settings.public.enableDebug
? logClient(
"debug",
`editClient Method Called from Client `,
this.ClientForm,
Meteor.user().username
)
: "";
Meteor.call("editClient", this.ClientForm, function(error, result) { Meteor.call("editClient", this.ClientForm, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`editClient Method error`,
error,
Meteor.user().username
)
: "";
}
// me.dialog = false; // me.dialog = false;
me.selectedItemInTable = []; me.selectedItemInTable = [];
}); });
...@@ -290,7 +320,27 @@ export default { ...@@ -290,7 +320,27 @@ export default {
let deleteHislink = {}; let deleteHislink = {};
deleteHislink._id = this.selectedItemInTable[0]["_id"]; deleteHislink._id = this.selectedItemInTable[0]["_id"];
Meteor.settings.public.enableDebug
? logClient(
"debug",
`deleteClient Method Called from Client `,
deleteHislink,
Meteor.user().username
)
: "";
Meteor.call("deleteClient", deleteHislink, function(error, result) { Meteor.call("deleteClient", deleteHislink, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`deleteClient Method error `,
error,
Meteor.user().username
)
: "";
}
if (error.reason == "relationShipError") { if (error.reason == "relationShipError") {
me.alertColor = "error"; me.alertColor = "error";
me.alertSnackbar = true; me.alertSnackbar = true;
......
...@@ -141,9 +141,9 @@ import Devicemap from "../../imports/api/collections/devicemap.js"; ...@@ -141,9 +141,9 @@ import Devicemap from "../../imports/api/collections/devicemap.js";
import HisLink from "../../imports/api/collections/hislink.js"; import HisLink from "../../imports/api/collections/hislink.js";
import Client from "../../imports/api/collections/clients.js"; import Client from "../../imports/api/collections/clients.js";
import { Meteor } from "meteor/meteor"; import { Meteor } from "meteor/meteor";
debugger
// import { log_init, logClient } from "../../imports/plugins/logger"; import { log_init, logClient } from "../../imports/plugins/logger";
// log_init(); log_init();
export default { export default {
data() { data() {
return { return {
...@@ -197,36 +197,37 @@ export default { ...@@ -197,36 +197,37 @@ export default {
this.dialog = false; this.dialog = false;
if (this.devicemaps && this.devicemaps.length > 0) { if (this.devicemaps && this.devicemaps.length > 0) {
let currentDevicemap = []; let currentDevicemap = [];
for (let devicemap of this.devicemaps) {
let hislink = HisLink.find( for (let devicemap of this.devicemaps) {
{ _id: devicemap.HisLinkId }, let hislink = HisLink.find(
{ fields: { Name: 1 } } { _id: devicemap.HisLinkId },
).fetch(); { fields: { Name: 1 } }
).fetch();
if ( if (
hislink != undefined && hislink != undefined &&
hislink != null && hislink != null &&
// hislink.length > 0 && // hislink.length > 0 &&
hislink[0].Name != undefined hislink[0].Name != undefined
) )
devicemap = { ...devicemap, HisName: hislink[0].Name }; devicemap = { ...devicemap, HisName: hislink[0].Name };
let client = Client.find( let client = Client.find(
{ _id: devicemap.ClientId }, { _id: devicemap.ClientId },
{ fields: { Caption: 1 } } { fields: { Caption: 1 } }
).fetch(); ).fetch();
if ( if (
client != undefined && client != undefined &&
client != null && client != null &&
// hislink.length > 0 && // hislink.length > 0 &&
client[0].Caption != undefined client[0].Caption != undefined
) )
devicemap = { ...devicemap, Client: client[0].Caption }; devicemap = { ...devicemap, Client: client[0].Caption };
currentDevicemap.push({ ...devicemap });
}
currentDevicemap.push({ ...devicemap });
}
return currentDevicemap; return currentDevicemap;
} }
return []; return [];
...@@ -318,7 +319,30 @@ export default { ...@@ -318,7 +319,30 @@ export default {
this.DevicemapForm.HisLinkId = this.selectedHisLink._id; this.DevicemapForm.HisLinkId = this.selectedHisLink._id;
} }
Meteor.call("createDevicemap", this.DevicemapForm, function() {}); Meteor.settings.public.enableDebug
? logClient(
"debug",
`createDevicemap Method Called from Client `,
this.DevicemapForm,
Meteor.user().username
)
: "";
Meteor.call("createDevicemap", this.DevicemapForm, function(
error,
result
) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`createDevicemap Method error`,
error,
Meteor.user().username
)
: "";
}
});
} }
if (this.newOrEdit == "edit") { if (this.newOrEdit == "edit") {
if (this.selectedClient != undefined && this.selectedClient != null) if (this.selectedClient != undefined && this.selectedClient != null)
...@@ -328,8 +352,32 @@ export default { ...@@ -328,8 +352,32 @@ export default {
this.DevicemapForm.HisLinkId = this.selectedHisLink._id; this.DevicemapForm.HisLinkId = this.selectedHisLink._id;
} }
Meteor.call("editDevicemap", this.DevicemapForm, function() { Meteor.settings.public.enableDebug
? logClient(
"debug",
`editDevicemap Method Called from Client `,
this.DevicemapForm,
Meteor.user().username
)
: "";
Meteor.call("editDevicemap", this.DevicemapForm, function(
error,
result
) {
// me.dialog = false; // me.dialog = false;
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`editDevicemap Method error`,
error,
Meteor.user().username
)
: "";
}
me.selectedItemInTable = []; me.selectedItemInTable = [];
}); });
} }
...@@ -344,7 +392,27 @@ export default { ...@@ -344,7 +392,27 @@ export default {
let deleteHislink = {}; let deleteHislink = {};
deleteHislink._id = this.selectedItemInTable[0]["_id"]; deleteHislink._id = this.selectedItemInTable[0]["_id"];
Meteor.call("deleteDevicemap", deleteHislink, function() { Meteor.settings.public.enableDebug
? logClient(
"debug",
`deleteDevicemap Method Called from Client `,
deleteHislink,
Meteor.user().username
)
: "";
Meteor.call("deleteDevicemap", deleteHislink, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`deleteDevicemap Method error `,
error,
Meteor.user().username
)
: "";
}
me.alertSnackbarMethod(me.$t("DeviceMap.devicemapDeleteStatement")); me.alertSnackbarMethod(me.$t("DeviceMap.devicemapDeleteStatement"));
}); });
}, },
......
...@@ -206,6 +206,9 @@ import HisLink from "../../imports/api/collections/hislink.js"; ...@@ -206,6 +206,9 @@ import HisLink from "../../imports/api/collections/hislink.js";
import Brands from "../../imports/api/collections/brands.js"; import Brands from "../../imports/api/collections/brands.js";
import { Meteor } from "meteor/meteor"; import { Meteor } from "meteor/meteor";
// import HisWorklist from "./HisWorklist.vue"; // import HisWorklist from "./HisWorklist.vue";
import { log_init, logClient } from "../../imports/plugins/logger";
log_init();
export default { export default {
// components: { // components: {
// HisWorklist // HisWorklist
...@@ -331,12 +334,32 @@ export default { ...@@ -331,12 +334,32 @@ export default {
this.loading = true; this.loading = true;
if (this.newOrEdit == "new") { if (this.newOrEdit == "new") {
Meteor.call("createHisLink", this.HisLinkForm, function(error, result) { Meteor.call("createHisLink", this.HisLinkForm, function(error, result) {
// me.dialog = false; if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`createHisLink Method error`,
error,
Meteor.user().username
)
: "";
}
}); });
} }
if (this.newOrEdit == "edit") { if (this.newOrEdit == "edit") {
Meteor.call("editHisLink", this.HisLinkForm, function() { Meteor.call("editHisLink", this.HisLinkForm, function(error, result) {
// me.dialog = false; if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`editHisLink Method error`,
error,
Meteor.user().username
)
: "";
}
me.selectedItemInTable = []; me.selectedItemInTable = [];
}); });
} }
...@@ -352,7 +375,17 @@ export default { ...@@ -352,7 +375,17 @@ export default {
deleteHislink._id = this.selectedItemInTable[0]["_id"]; deleteHislink._id = this.selectedItemInTable[0]["_id"];
Meteor.call("deleteHisLink", deleteHislink, function(error, result) { Meteor.call("deleteHisLink", deleteHislink, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`deleteHisLink Method error`,
error,
Meteor.user().username
)
: "";
}
if (error) { if (error) {
if (error.reason == "relationShipError") { if (error.reason == "relationShipError") {
me.alertColor = "error"; me.alertColor = "error";
...@@ -368,7 +401,7 @@ export default { ...@@ -368,7 +401,7 @@ export default {
this.snackbar = true; this.snackbar = true;
}, },
alertSnackbarMethod(text) { alertSnackbarMethod(text) {
me.alertColor = "primary"; this.alertColor = "primary";
this.alertText = text; this.alertText = text;
this.alertSnackbar = true; this.alertSnackbar = true;
}, },
...@@ -381,7 +414,17 @@ export default { ...@@ -381,7 +414,17 @@ export default {
let activeHislink = {}; let activeHislink = {};
activeHislink._id = this.selectedItemInTable[0]["_id"]; activeHislink._id = this.selectedItemInTable[0]["_id"];
Meteor.call("activeHisLink", activeHislink, function() { Meteor.call("activeHisLink", activeHislink, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`activeHisLink Method error`,
error,
Meteor.user().username
)
: "";
}
me.alertSnackbarMethod(me.$t("HISLink.hislinkActiveStatement")); me.alertSnackbarMethod(me.$t("HISLink.hislinkActiveStatement"));
}); });
}, },
...@@ -394,7 +437,17 @@ export default { ...@@ -394,7 +437,17 @@ export default {
let deactiveHislink = {}; let deactiveHislink = {};
deactiveHislink._id = this.selectedItemInTable[0]["_id"]; deactiveHislink._id = this.selectedItemInTable[0]["_id"];
Meteor.call("deactiveHisLink", deactiveHislink, function() { Meteor.call("deactiveHisLink", deactiveHislink, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`deactiveHisLink Method error`,
error,
Meteor.user().username
)
: "";
}
me.alertSnackbarMethod(me.$t("HISLink.hislinkDeactiveStatement")); me.alertSnackbarMethod(me.$t("HISLink.hislinkDeactiveStatement"));
}); });
}, },
...@@ -431,10 +484,21 @@ export default { ...@@ -431,10 +484,21 @@ export default {
// } // }
// }; // };
Meteor.call("authenticateHisLink", authenticateHislink, function( Meteor.call("authenticateHisLink", authenticateHislink, function(
err, error,
result result
) { ) {
if (err) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`authenticateHisLink Method error`,
error,
Meteor.user().username
)
: "";
}
if (error) {
me.alertSnackbarMethod(me.$t("HISLink.hislinkAuthenticateFailed")); me.alertSnackbarMethod(me.$t("HISLink.hislinkAuthenticateFailed"));
} }
me.alertSnackbarMethod( me.alertSnackbarMethod(
......
...@@ -114,6 +114,9 @@ ...@@ -114,6 +114,9 @@
</template> </template>
<script> <script>
import Devicemap from "../../imports/api/collections/devicemap.js"; import Devicemap from "../../imports/api/collections/devicemap.js";
import { log_init, logClient } from "../../imports/plugins/logger";
log_init();
export default { export default {
data() { data() {
return { return {
...@@ -150,10 +153,20 @@ export default { ...@@ -150,10 +153,20 @@ export default {
if (this.selectedDeviceMap) { if (this.selectedDeviceMap) {
registerPatient.CodeInHis = this.selectedDeviceMap.CodeInHIS; registerPatient.CodeInHis = this.selectedDeviceMap.CodeInHIS;
} }
Meteor.call("Register", registerPatient, function(err, result) { Meteor.call("Register", registerPatient, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`Register Method error`,
error,
Meteor.user().username
)
: "";
}
me.registerLoading = false; me.registerLoading = false;
me.registerPatient = { me.registerPatient = {
FarsiFirstName: "", FarsiFirstName: "",
......
...@@ -69,6 +69,8 @@ import { FilesCollection } from "meteor/ostrio:files"; ...@@ -69,6 +69,8 @@ import { FilesCollection } from "meteor/ostrio:files";
import TranslitDbUploads from "../../imports/api/collections/translitdbuploads.js"; import TranslitDbUploads from "../../imports/api/collections/translitdbuploads.js";
import TransliterationDb from "../../imports/api/collections/transliterationdb.js"; import TransliterationDb from "../../imports/api/collections/transliterationdb.js";
import { Counts } from "meteor/tmeasday:publish-counts"; import { Counts } from "meteor/tmeasday:publish-counts";
import { log_init, logClient } from "../../imports/plugins/logger";
log_init();
export default { export default {
data() { data() {
return { return {
...@@ -83,7 +85,7 @@ export default { ...@@ -83,7 +85,7 @@ export default {
alertSnackbar: false, alertSnackbar: false,
alertText: "" alertText: ""
}; };
}, },
computed: { computed: {
links() { links() {
let links = []; let links = [];
...@@ -166,9 +168,19 @@ export default { ...@@ -166,9 +168,19 @@ export default {
}, 500); }, 500);
Meteor.call("sqlite2mongo", fileObj.versions.original.path, function( Meteor.call("sqlite2mongo", fileObj.versions.original.path, function(
err, error,
result result
) { ) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`sqlite2mongo Method error`,
error,
Meteor.user().username
)
: "";
}
if (result == true) { if (result == true) {
me.uploadMessage = me.$t("TransliterationRoute.dbUpdateDone"); me.uploadMessage = me.$t("TransliterationRoute.dbUpdateDone");
Meteor.setTimeout(() => { Meteor.setTimeout(() => {
...@@ -196,7 +208,6 @@ export default { ...@@ -196,7 +208,6 @@ export default {
let scrollerEndPoint = scrollHeight - divHeight; let scrollerEndPoint = scrollHeight - divHeight;
let divScrollerTop = e.target.scrollTop; let divScrollerTop = e.target.scrollTop;
if (divScrollerTop === scrollerEndPoint) { if (divScrollerTop === scrollerEndPoint) {
this.count = Counts.get("transliterationCount"); this.count = Counts.get("transliterationCount");
if (this.transliterationdb.length < this.count) { if (this.transliterationdb.length < this.count) {
this.limit += 5; this.limit += 5;
...@@ -223,9 +234,7 @@ export default { ...@@ -223,9 +234,7 @@ export default {
transliterationdb: function() { transliterationdb: function() {
// this.TransliterationLoading = true; // this.TransliterationLoading = true;
return [ return [{ limit: this.limit }];
{ limit: this.limit }
];
}, },
transliterationdbCount: [] transliterationdbCount: []
}, },
...@@ -233,7 +242,6 @@ export default { ...@@ -233,7 +242,6 @@ export default {
return TranslitDbUploads.find({}); return TranslitDbUploads.find({});
}, },
transliterationdb() { transliterationdb() {
return TransliterationDb.find({}, { sort: { ID: 1 } }); return TransliterationDb.find({}, { sort: { ID: 1 } });
} }
} }
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
<v-img v-if="!temp" :src="src"></v-img> <v-img v-if="!temp" :src="src"></v-img>
<v-img v-else :src="newSrc"></v-img> <v-img v-else :src="newSrc"></v-img>
<v-btn <v-btn
@click="$refs.inputUpload.click()" @click="$refs.inputUpload.click()"
fab fab
style="position:absolute;bottom:5px;right:5px" style="position:absolute;bottom:5px;right:5px"
> >
<v-icon>add_a_photo</v-icon> <v-icon>add_a_photo</v-icon>
</v-btn> </v-btn>
</v-avatar> </v-avatar>
<input <input
v-show="false" v-show="false"
ref="inputUpload" ref="inputUpload"
...@@ -78,6 +78,8 @@ ...@@ -78,6 +78,8 @@
</template> </template>
<script> <script>
import { mapActions } from "vuex"; import { mapActions } from "vuex";
import { log_init, logClient } from "../../imports/plugins/logger";
log_init();
export default { export default {
data() { data() {
return { return {
...@@ -116,7 +118,17 @@ export default { ...@@ -116,7 +118,17 @@ export default {
"profile.picture": this.newSrc "profile.picture": this.newSrc
}; };
let me = this; let me = this;
Meteor.call("editUserProfile", profile, function(err, result) { Meteor.call("editUserProfile", profile, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`editUserProfile Method error`,
error,
Meteor.user().username
)
: "";
}
if (result) { if (result) {
me.alertSnackbarMethod(me.$t("UserSetting.successfullSave")); me.alertSnackbarMethod(me.$t("UserSetting.successfullSave"));
} }
...@@ -202,7 +214,7 @@ export default { ...@@ -202,7 +214,7 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.v-avatar{ .v-avatar {
overflow: initial; overflow: initial;
} }
</style> </style>
\ No newline at end of file
...@@ -91,16 +91,35 @@ ...@@ -91,16 +91,35 @@
<v-card-actions> <v-card-actions>
<v-row style="margin:auto"> <v-row style="margin:auto">
<v-col cols="12" class="d-flex justify-center align-center flex-wrap"> <v-col cols="12" class="d-flex justify-center align-center flex-wrap">
<v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openNewDialog"> <v-btn
color="rgb(94, 181, 177,.85)"
class="white--text ma-1"
@click="openNewDialog"
>
<strong>{{$t("HISLink.newBtn")}}</strong> <strong>{{$t("HISLink.newBtn")}}</strong>
</v-btn> </v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openEditDialog" :disabled="this.selectedItemInTable.length == 0"> <v-btn
color="rgb(94, 181, 177,.85)"
class="white--text ma-1"
@click="openEditDialog"
:disabled="this.selectedItemInTable.length == 0"
>
<strong>{{$t("HISLink.editBtn")}}</strong> <strong>{{$t("HISLink.editBtn")}}</strong>
</v-btn> </v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="openResetDialog" :disabled="this.selectedItemInTable.length == 0"> <v-btn
color="rgb(94, 181, 177,.85)"
class="white--text ma-1"
@click="openResetDialog"
:disabled="this.selectedItemInTable.length == 0"
>
<strong>{{$t("Users.ResetPasswordBtn")}}</strong> <strong>{{$t("Users.ResetPasswordBtn")}}</strong>
</v-btn> </v-btn>
<v-btn color="rgb(94, 181, 177,.85)" class="white--text ma-1" @click="deleteSnackbar" :disabled="this.selectedItemInTable.length == 0"> <v-btn
color="rgb(94, 181, 177,.85)"
class="white--text ma-1"
@click="deleteSnackbar"
:disabled="this.selectedItemInTable.length == 0"
>
<strong>{{$t("HISLink.deleteBtn")}}</strong> <strong>{{$t("HISLink.deleteBtn")}}</strong>
</v-btn> </v-btn>
</v-col> </v-col>
...@@ -148,7 +167,8 @@ ...@@ -148,7 +167,8 @@
</v-container> </v-container>
</template> </template>
<script> <script>
import { Meteor } from "meteor/meteor"; import { log_init, logClient } from "../../imports/plugins/logger";
log_init();
export default { export default {
data() { data() {
return { return {
...@@ -277,7 +297,7 @@ export default { ...@@ -277,7 +297,7 @@ export default {
createOrEditUser() { createOrEditUser() {
this.loading = true; this.loading = true;
let me = this; let me = this;
if (this.newOrEdit == "new") { if (this.newOrEdit == "new") {
const username = this.UserForm.username; const username = this.UserForm.username;
const password = this.UserForm.password; const password = this.UserForm.password;
...@@ -330,7 +350,17 @@ export default { ...@@ -330,7 +350,17 @@ export default {
} }
}; };
Meteor.call("createUser1", item, function() { Meteor.call("createUser1", item, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`createUser1 Method error`,
error,
Meteor.user().username
)
: "";
}
me.loading = false; me.loading = false;
// me.dialog = false; // me.dialog = false;
}); });
...@@ -341,8 +371,17 @@ export default { ...@@ -341,8 +371,17 @@ export default {
_id: this.UserForm._id, _id: this.UserForm._id,
fullName: this.UserForm.fullName fullName: this.UserForm.fullName
}; };
Meteor.call("editUser1", item, function() { Meteor.call("editUser1", item, function(error, result) {
// me.dialog = false; if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`editUser1 Method error`,
error,
Meteor.user().username
)
: "";
}
me.selectedItemInTable = []; me.selectedItemInTable = [];
me.loading = false; me.loading = false;
}); });
...@@ -382,7 +421,17 @@ export default { ...@@ -382,7 +421,17 @@ export default {
_id: this.UserForm._id, _id: this.UserForm._id,
password: this.UserForm.password password: this.UserForm.password
}; };
Meteor.call("setPassword", item, function() { Meteor.call("setPassword", item, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`setPassword Method error`,
error,
Meteor.user().username
)
: "";
}
me.loading = false; me.loading = false;
me.dialog = false; me.dialog = false;
// me.selectedItemInTable = []; // me.selectedItemInTable = [];
...@@ -390,7 +439,6 @@ export default { ...@@ -390,7 +439,6 @@ export default {
} }
}, },
deleteUser() { deleteUser() {
let me = this; let me = this;
this.snackbar = false; this.snackbar = false;
if (this.selectedItemInTable.length == 0) { if (this.selectedItemInTable.length == 0) {
...@@ -401,7 +449,17 @@ export default { ...@@ -401,7 +449,17 @@ export default {
let deleteUser = {}; let deleteUser = {};
deleteUser._id = this.selectedItemInTable[0]["_id"]; deleteUser._id = this.selectedItemInTable[0]["_id"];
Meteor.call("deleteUser1", deleteUser, function() { Meteor.call("deleteUser1", deleteUser, function(error, result) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`deleteUser1 Method error`,
error,
Meteor.user().username
)
: "";
}
me.alertSnackbarMethod(this.$t("Users.userDeleteStatement")); me.alertSnackbarMethod(this.$t("Users.userDeleteStatement"));
}); });
}, },
......
...@@ -525,6 +525,9 @@ import Worklist from "../../imports/api/collections/worklist.js"; ...@@ -525,6 +525,9 @@ import Worklist from "../../imports/api/collections/worklist.js";
import Clients from "../../imports/api/collections/clients.js"; import Clients from "../../imports/api/collections/clients.js";
// import HisWorklist from "./HisWorklist.vue"; // import HisWorklist from "./HisWorklist.vue";
import { log_init, logClient } from "../../imports/plugins/logger";
log_init();
export default { export default {
methods: { methods: {
activerow: function(item) { activerow: function(item) {
...@@ -557,13 +560,25 @@ export default { ...@@ -557,13 +560,25 @@ export default {
// this.$set(item, "selected", true); // this.$set(item, "selected", true);
}, },
searchPatients() { searchPatients() {
if ( if (
this.selectedDevice && this.selectedDevice &&
this.devicemap != this.selectedDevice.Caption this.devicemap != this.selectedDevice.Caption
) { ) {
let self = this; let self = this;
Meteor.call("Fetchworklist", this.selectedDevice.Caption, function() { Meteor.call("Fetchworklist", this.selectedDevice.Caption, function(
error,
result
) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`Fetchworklist Method error`,
error,
Meteor.user().username
)
: "";
}
self.devicemap = self.selectedDevice.Caption; self.devicemap = self.selectedDevice.Caption;
}); });
} }
...@@ -660,7 +675,6 @@ export default { ...@@ -660,7 +675,6 @@ export default {
this.activerow(this.sortedItems[index - 1]); this.activerow(this.sortedItems[index - 1]);
}, },
savePatient() { savePatient() {
this.selectedItem.EnglishFirstNameParts = [ this.selectedItem.EnglishFirstNameParts = [
this.editedItemParts.EnglishFirstNameParts0, this.editedItemParts.EnglishFirstNameParts0,
this.editedItemParts.EnglishFirstNameParts1, this.editedItemParts.EnglishFirstNameParts1,
...@@ -694,13 +708,23 @@ export default { ...@@ -694,13 +708,23 @@ export default {
}); });
let { selected, ...selectedItemClone } = this.selectedItem; let { selected, ...selectedItemClone } = this.selectedItem;
this.editLoading = true; this.editLoading = true;
let self = this; let self = this;
Meteor.call("EditworklistItem", selectedItemClone, function( Meteor.call("EditworklistItem", selectedItemClone, function(
error, error,
result result
) { ) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`EditworklistItem Method error`,
error,
Meteor.user().username
)
: "";
}
self.editLoading = false; self.editLoading = false;
}); });
} }
...@@ -816,7 +840,20 @@ export default { ...@@ -816,7 +840,20 @@ export default {
if (this.selectedDevice && this.selectedDevice.Caption) { if (this.selectedDevice && this.selectedDevice.Caption) {
let self = this; let self = this;
this.fetchWorklistLoading = true; this.fetchWorklistLoading = true;
Meteor.call("Fetchworklist", this.selectedDevice.Caption, function() { Meteor.call("Fetchworklist", this.selectedDevice.Caption, function(
error,
result
) {
if (error) {
Meteor.settings.public.enableDebug
? logClient(
"error",
`Fetchworklist Method error`,
error,
Meteor.user().username
)
: "";
}
self.devicemap = self.selectedDevice.Caption; self.devicemap = self.selectedDevice.Caption;
self.fetchWorklistLoading = false; self.fetchWorklistLoading = false;
}); });
......
...@@ -4,6 +4,7 @@ import { LoggerFile } from 'meteor/ostrio:loggerfile'; ...@@ -4,6 +4,7 @@ import { LoggerFile } from 'meteor/ostrio:loggerfile';
let mylog = {}; let mylog = {};
export function log_init() { export function log_init() {
mylog = new Logger(); mylog = new Logger();
(new LoggerFile(mylog)).enable(); (new LoggerFile(mylog)).enable();
} }
......
...@@ -8868,9 +8868,9 @@ ...@@ -8868,9 +8868,9 @@
} }
}, },
"kind-of": { "kind-of": {
"version": "6.0.2", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
"integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
"dev": true "dev": true
}, },
"kleur": { "kleur": {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"private": true, "private": true,
"version": "0.0.9", "version": "0.0.9",
"scripts": { "scripts": {
"start": "SET MONGO_URL=mongodb://karnameh.marcopacs.com:27018/karname&& meteor run --inspect --settings settings.json", "start": "SET MONGO_URL=mongodb://staging.karname.ir:27018/karname&& meteor run --inspect --settings settings.json",
"test": "meteor test --once --driver-package meteortesting:mocha", "test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha", "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"test-jest": "jest", "test-jest": "jest",
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"databusUrl": "http://localhost:8090", "databusUrl": "http://localhost:8090",
"enableDebug": false, "enableDebug": false,
"public": { "public": {
"enableDebug": false "enableDebug": true
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment