rename all variants of naming that hold an AyaType value to "aType" (parameter) / "AType" (not parameter) everywhere front and back; "ayType", "objectType", "oType" all are used in various areas
This commit is contained in:
@@ -96,9 +96,9 @@ export default {
|
||||
};
|
||||
},
|
||||
/////////////////////////////////
|
||||
// oType is the name of the object type as defined in ayatype.js
|
||||
// aType is the name of the object type as defined in ayatype.js
|
||||
//
|
||||
getRights(oType) {
|
||||
getRights(aType) {
|
||||
//from bizroles.cs:
|
||||
//HOW THIS WORKS / WHATS EXPECTED
|
||||
//Change = CREATE, RETRIEVE, UPDATE, DELETE - Full rights
|
||||
@@ -113,13 +113,13 @@ export default {
|
||||
//Get the type name from the type enum value
|
||||
//de-lodash
|
||||
// let typeName = window.$gz. _.findKey(window.$gz.type, function(o) {
|
||||
// return o == oType;
|
||||
// return o == aType;
|
||||
// });
|
||||
|
||||
//my _.findKey replacement:
|
||||
let typeName = undefined;
|
||||
for (const [key, value] of Object.entries(window.$gz.type)) {
|
||||
if (value == oType) {
|
||||
if (value == aType) {
|
||||
typeName = key;
|
||||
break;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
let objectRoleRights = this.ROLE_RIGHTS[typeName];
|
||||
if (!objectRoleRights) {
|
||||
throw new Error(
|
||||
`authorizationroles::getRights type ${oType} not found in roles collection`
|
||||
`authorizationroles::getRights type ${aType} not found in roles collection`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -163,8 +163,8 @@ export default {
|
||||
// convenience method for forms that deal with multiple object types
|
||||
// (i.e. grids, history etc, initialization of main menu etc)
|
||||
//
|
||||
canOpen(oType) {
|
||||
let r = this.getRights(oType);
|
||||
canOpen(aType) {
|
||||
let r = this.getRights(aType);
|
||||
//convention is change might be defined but not read so canOpen is true eitehr way
|
||||
return r.change == true || r.read == true;
|
||||
},
|
||||
@@ -172,8 +172,8 @@ export default {
|
||||
// convenience method for forms that deal with multiple object types
|
||||
// (i.e. grids, history etc, initialization of main menu etc)
|
||||
//
|
||||
canChange(oType) {
|
||||
let r = this.getRights(oType);
|
||||
canChange(aType) {
|
||||
let r = this.getRights(aType);
|
||||
return r.change == true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -556,7 +556,7 @@ export default {
|
||||
},
|
||||
///////////////////////////////////
|
||||
// POST FILE ATTACHMENTS
|
||||
// @param {ayaId:objectid, ayaType:objectType, files:[array of files]}
|
||||
// @param {ayaId:objectid, ayaType:aType, files:[array of files]}
|
||||
//
|
||||
async uploadAttachment(at) {
|
||||
let that = this;
|
||||
@@ -567,7 +567,7 @@ export default {
|
||||
data.append(files[i].name, files[i]);
|
||||
}
|
||||
|
||||
data.append("AttachToObjectType", at.ayaType);
|
||||
data.append("AttachToAType", at.ayaType);
|
||||
data.append("AttachToObjectId", at.ayaId);
|
||||
data.append("Notes", at.notes);
|
||||
data.append("FileData", at.fileData);
|
||||
@@ -606,7 +606,7 @@ export default {
|
||||
data.append(files[i].name, files[i]);
|
||||
}
|
||||
if (at.ayaType) {
|
||||
data.append("ObjectType", at.ayaType);
|
||||
data.append("AType", at.ayaType);
|
||||
}
|
||||
if (at.ayaId) {
|
||||
data.append("ObjectId", at.ayaId);
|
||||
|
||||
@@ -314,12 +314,12 @@ export default {
|
||||
// break;
|
||||
case "review":
|
||||
//go to list
|
||||
// path: "/home-reviews/:objectType?/:objectId?",
|
||||
// path: "/home-reviews/:aType?/:objectId?",
|
||||
|
||||
vm.$router.push({
|
||||
name: "home-reviews",
|
||||
params: {
|
||||
objectType: window.$gz.util.stringToIntOrNull(item.data.ayaType),
|
||||
aType: window.$gz.util.stringToIntOrNull(item.data.ayaType),
|
||||
objectId: window.$gz.util.stringToIntOrNull(item.data.recordId),
|
||||
name: item.data.recordName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user