Skip to content

Commit

Permalink
Merge pull request #222 from smartdevicelink/develop
Browse files Browse the repository at this point in the history
Release 2.10
  • Loading branch information
renonick87 authored Nov 5, 2020
2 parents 7eaa6db + 1e8cbc7 commit 52b4b24
Show file tree
Hide file tree
Showing 73 changed files with 11,183 additions and 6,599 deletions.
31 changes: 0 additions & 31 deletions .babelrc

This file was deleted.

9 changes: 0 additions & 9 deletions .editorconfig

This file was deleted.

12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ dist/
*.ntvs*
*.njsproj
*.sln
*.zip
*.zip

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
8 changes: 0 additions & 8 deletions .postcssrc.js

This file was deleted.

8 changes: 4 additions & 4 deletions app/v1/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports = app;
app.locals.shaid = require('./shaid');
//load all the routes in the controllers files and other places
const login = require('./login/controller.js');
const forgot = require('./forgot/controller.js');
const register = require('./register/controller.js');
//const forgot = require('./forgot/controller.js');
//const register = require('./register/controller.js');
const applications = require('./applications/controller.js');
const policy = require('./policy/controller.js');
const permissions = require('./permissions/controller.js');
Expand Down Expand Up @@ -156,10 +156,10 @@ flame.async.parallel([
});
},
function(next) {
vehicleData.updateRpcSpec(function() {
vehicleData.updateRpcSpec(function() {
log.info("RPC Spec updated");
next();
});
});
},
], function () {
log.info("Start up complete. Exposing routes.");
Expand Down
3 changes: 2 additions & 1 deletion app/v1/applications/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ function createAppInfoFlow (filterTypeFunc, value) {
appCountries: setupSql.bind(null, sql.getApp.countries[filterTypeFunc](value)),
appDisplayNames: setupSql.bind(null, sql.getApp.displayNames[filterTypeFunc](value)),
appPermissions: setupSql.bind(null, sql.getApp.permissions[filterTypeFunc](value)),
appCategories: setupSql.bind(null, sql.getApp.category[filterTypeFunc](value)),
appCategories: setupSql.bind(null, sql.getApp.category[filterTypeFunc](value)),
appAllCategories: setupSql.bind(null, sql.getApp.allCategories[filterTypeFunc](value)),
appServiceTypes: setupSql.bind(null, sql.getApp.serviceTypes[filterTypeFunc](value)),
appServiceTypeNames: setupSql.bind(null, sql.getApp.serviceTypeNames[filterTypeFunc](value)),
appServiceTypePermissions: setupSql.bind(null, sql.getApp.serviceTypePermissions[filterTypeFunc](value)),
Expand Down
9 changes: 9 additions & 0 deletions app/v1/applications/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,20 @@ function constructFullAppObjs (res, next) {
obj.countries = [];
obj.display_names = [];
obj.permissions = [];
obj.categories = [];
obj.services = arrayify(hashedServices, [appInfo.id]); //services should be an array
obj.description = appInfo.description;
}
}));

// categories
hashify(hashedApps, res.appAllCategories, elem => ({
location: [elem.id, "categories"],
data: arr => arr.push({
id: elem.category_id,
display_name: elem.display_name
})
}))
// countries
hashify(hashedApps, res.appCountries, elem => ({
location: [elem.id, "countries"],
Expand Down
41 changes: 41 additions & 0 deletions app/v1/applications/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,42 @@ function getAppCategory (id) {
.toString();
}

function getAllAppCategoriesFilter (filterObj) {
return sql.select('app_id AS id', 'app_categories.category_id', 'display_name')
.from('app_categories')
.join('categories', {
'app_categories.category_id': 'categories.id'
})
.join('(' + getAppInfoFilter(filterObj) + ') ai', {
'ai.id': 'app_categories.app_id'
})
.toString();
}

function getAllAppCategories (id) {
return sql.select('app_id AS id', 'app_categories.category_id', 'display_name')
.from('app_categories')
.join('categories', {
'app_categories.category_id': 'categories.id'
})
.where({
app_id: id
})
.toString();
}

function getAppCategoriesNames (id) {
return sql.select('categories.id', 'categories.name')
.from('categories')
.join('app_categories', {
'app_categories.category_id': 'categories.id'
})
.where({
'app_categories.app_id': id
})
.toString();
}

function getAppServiceTypes (id) {
return sql.select('ast.app_id, ast.service_type_name, st.display_name')
.from('app_service_types ast')
Expand Down Expand Up @@ -1076,6 +1112,10 @@ module.exports = {
multiFilter: getAppCategoryFilter,
idFilter: getAppCategory
},
allCategories: {
multiFilter: getAllAppCategoriesFilter,
idFilter: getAllAppCategories
},
serviceTypes: {
multiFilter: getAppServiceTypesFilter,
idFilter: getAppServiceTypes
Expand Down Expand Up @@ -1111,6 +1151,7 @@ module.exports = {
certificate: getAppCertificate,
allExpiredCertificates: getAllExpiredAppCertificates,
},
getAppCategoriesNames: getAppCategoriesNames,
updateAppCertificate: updateAppCertificate,
timestampCheck: timestampCheck,
versionCheck: versionCheck,
Expand Down
33 changes: 33 additions & 0 deletions app/v1/module-config/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function validatePost (req, res) {
}
req.body.notifications_per_minute_by_priority.EMERGENCY -= 0;
req.body.notifications_per_minute_by_priority.NAVIGATION -= 0;
req.body.notifications_per_minute_by_priority.PROJECTION -= 0;
req.body.notifications_per_minute_by_priority.VOICECOM -= 0;
req.body.notifications_per_minute_by_priority.COMMUNICATION -= 0;
req.body.notifications_per_minute_by_priority.NORMAL -= 0;
Expand All @@ -63,6 +64,9 @@ function validatePost (req, res) {
if (!check.number(req.body.notifications_per_minute_by_priority.NAVIGATION)) {
return setError("NAVIGATION notification count required");
}
if (!check.number(req.body.notifications_per_minute_by_priority.PROJECTION)) {
return setError("PROJECTION notification count required");
}
if (!check.number(req.body.notifications_per_minute_by_priority.VOICECOM)) {
return setError("VOICECOM notification count required");
}
Expand All @@ -75,6 +79,35 @@ function validatePost (req, res) {
if (!check.number(req.body.notifications_per_minute_by_priority.NONE)) {
return setError("NONE notification count required");
}

req.body.subtle_notifications_per_minute_by_priority.EMERGENCY -= 0;
req.body.subtle_notifications_per_minute_by_priority.NAVIGATION -= 0;
req.body.subtle_notifications_per_minute_by_priority.PROJECTION -= 0;
req.body.subtle_notifications_per_minute_by_priority.VOICECOM -= 0;
req.body.subtle_notifications_per_minute_by_priority.COMMUNICATION -= 0;
req.body.subtle_notifications_per_minute_by_priority.NORMAL -= 0;
req.body.subtle_notifications_per_minute_by_priority.NONE -= 0;
if (!check.number(req.body.subtle_notifications_per_minute_by_priority.EMERGENCY)) {
return setError("Subtle EMERGENCY notification count required");
}
if (!check.number(req.body.subtle_notifications_per_minute_by_priority.NAVIGATION)) {
return setError("Subtle NAVIGATION notification count required");
}
if (!check.number(req.body.subtle_notifications_per_minute_by_priority.PROJECTION)) {
return setError("Subtle PROJECTION notification count required");
}
if (!check.number(req.body.subtle_notifications_per_minute_by_priority.VOICECOM)) {
return setError("Subtle VOICECOM notification count required");
}
if (!check.number(req.body.subtle_notifications_per_minute_by_priority.COMMUNICATION)) {
return setError("Subtle COMMUNICATION notification count required");
}
if (!check.number(req.body.subtle_notifications_per_minute_by_priority.NORMAL)) {
return setError("Subtle NORMAL notification count required");
}
if (!check.number(req.body.subtle_notifications_per_minute_by_priority.NONE)) {
return setError("Subtle NONE notification count required");
}
return;

function setError (msg) {
Expand Down
18 changes: 18 additions & 0 deletions app/v1/module-config/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ function baseTemplate (objOverride) {
notifications_per_minute_by_priority: {
EMERGENCY: 0,
NAVIGATION: 0,
PROJECTION: 0,
VOICECOM: 0,
COMMUNICATION: 0,
NORMAL: 0,
NONE: 0
},
subtle_notifications_per_minute_by_priority: {
EMERGENCY: 0,
NAVIGATION: 0,
PROJECTION: 0,
VOICECOM: 0,
COMMUNICATION: 0,
NORMAL: 0,
Expand Down Expand Up @@ -85,10 +95,18 @@ function baseTemplate (objOverride) {
obj.endpoints.custom_vehicle_data_mapping_url = objOverride.custom_vehicle_data_mapping_url;
obj.notifications_per_minute_by_priority.EMERGENCY = objOverride.emergency_notifications;
obj.notifications_per_minute_by_priority.NAVIGATION = objOverride.navigation_notifications;
obj.notifications_per_minute_by_priority.PROJECTION = objOverride.projection_notifications;
obj.notifications_per_minute_by_priority.VOICECOM = objOverride.voicecom_notifications;
obj.notifications_per_minute_by_priority.COMMUNICATION = objOverride.communication_notifications;
obj.notifications_per_minute_by_priority.NORMAL = objOverride.normal_notifications;
obj.notifications_per_minute_by_priority.NONE = objOverride.none_notifications;
obj.subtle_notifications_per_minute_by_priority.EMERGENCY = objOverride.subtle_emergency_notifications;
obj.subtle_notifications_per_minute_by_priority.NAVIGATION = objOverride.subtle_navigation_notifications;
obj.subtle_notifications_per_minute_by_priority.PROJECTION = objOverride.subtle_projection_notifications;
obj.subtle_notifications_per_minute_by_priority.VOICECOM = objOverride.subtle_voicecom_notifications;
obj.subtle_notifications_per_minute_by_priority.COMMUNICATION = objOverride.subtle_communication_notifications;
obj.subtle_notifications_per_minute_by_priority.NORMAL = objOverride.subtle_normal_notifications;
obj.subtle_notifications_per_minute_by_priority.NONE = objOverride.subtle_none_notifications;
obj.certificate = objOverride.certificate;
obj.private_key = objOverride.private_key;
obj.expiration_ts = objOverride.expiration_ts;
Expand Down
8 changes: 8 additions & 0 deletions app/v1/module-config/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,18 @@ function insertModuleConfig (moduleConfig) {
custom_vehicle_data_mapping_url: moduleConfig.endpoints.custom_vehicle_data_mapping_url,
emergency_notifications: moduleConfig.notifications_per_minute_by_priority.EMERGENCY,
navigation_notifications: moduleConfig.notifications_per_minute_by_priority.NAVIGATION,
projection_notifications: moduleConfig.notifications_per_minute_by_priority.PROJECTION,
voicecom_notifications: moduleConfig.notifications_per_minute_by_priority.VOICECOM,
communication_notifications: moduleConfig.notifications_per_minute_by_priority.COMMUNICATION,
normal_notifications: moduleConfig.notifications_per_minute_by_priority.NORMAL,
none_notifications: moduleConfig.notifications_per_minute_by_priority.NONE,
subtle_emergency_notifications: moduleConfig.subtle_notifications_per_minute_by_priority.EMERGENCY,
subtle_navigation_notifications: moduleConfig.subtle_notifications_per_minute_by_priority.NAVIGATION,
subtle_projection_notifications: moduleConfig.subtle_notifications_per_minute_by_priority.PROJECTION,
subtle_voicecom_notifications: moduleConfig.subtle_notifications_per_minute_by_priority.VOICECOM,
subtle_communication_notifications: moduleConfig.subtle_notifications_per_minute_by_priority.COMMUNICATION,
subtle_normal_notifications: moduleConfig.subtle_notifications_per_minute_by_priority.NORMAL,
subtle_none_notifications: moduleConfig.subtle_notifications_per_minute_by_priority.NONE,
certificate: moduleConfig.certificate,
private_key: moduleConfig.private_key,
expiration_ts: moduleConfig.expiration_ts,
Expand Down
1 change: 1 addition & 0 deletions app/v1/policy/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ function setupAppPolicies (isProduction, useLongUuids = false, reqAppPolicy) {
function mapAppBaseInfo (isProduction, useLongUuids = false, requestedUuids, incomingAppObjs, appObjs, callback) {
const makeAppPolicyFlow = flame.flow(flame.map(appObjs, function (appObj, next) {
const getInfoFlow = flame.flow({
categories: setupSqlCommand.bind(null, sqlApps.getAppCategoriesNames(appObj.id)),
displayNames: setupSqlCommand.bind(null, sql.getAppDisplayNames(appObj.id)),
moduleNames: setupSqlCommand.bind(null, sql.getAppModules(appObj.id)),
funcGroupNames: setupSqlCommand.bind(null, sql.getAppFunctionalGroups(isProduction, appObj)),
Expand Down
15 changes: 15 additions & 0 deletions app/v1/policy/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@ function transformModuleConfig (isProduction, useLongUuids = false, info, next)
"notifications_per_minute_by_priority": {
"EMERGENCY": base.emergency_notifications,
"NAVIGATION": base.navigation_notifications,
"PROJECTION": base.projection_notifications,
"VOICECOM": base.voicecom_notifications,
"COMMUNICATION": base.communication_notifications,
"NORMAL": base.normal_notifications,
"NONE": base.none_notifications
},
"subtle_notifications_per_minute_by_priority": {
"EMERGENCY": base.subtle_emergency_notifications,
"NAVIGATION": base.subtle_navigation_notifications,
"PROJECTION": base.subtle_projection_notifications,
"VOICECOM": base.subtle_voicecom_notifications,
"COMMUNICATION": base.subtle_communication_notifications,
"NORMAL": base.subtle_normal_notifications,
"NONE": base.subtle_none_notifications
},
"certificate": base.certificate,
};

Expand Down Expand Up @@ -354,6 +364,10 @@ function constructAppPolicy (appObj, useLongUuids = false, res, next) {
const funcGroupNames = res.funcGroupNames.map(function (elem) {
return elem.property_name;
});
const categories = res.categories.map(function (elem) {
return elem.name;
})

const appServiceObj = {};
res.serviceTypes.forEach(s => {
appServiceObj[s.service_type_name] = {
Expand All @@ -376,6 +390,7 @@ function constructAppPolicy (appObj, useLongUuids = false, res, next) {
const appPolicyObj = {};
const uuidProp = (useLongUuids ? appObj.app_uuid : appObj.app_short_uuid)
appPolicyObj[uuidProp] = {
AppHMIType: categories,
nicknames: displayNames,
keep_context: true,
steal_focus: appObj.can_steal_focus,
Expand Down
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
41 changes: 0 additions & 41 deletions build/build.js

This file was deleted.

Loading

0 comments on commit 52b4b24

Please sign in to comment.