Adding changes for operations module
This commit is contained in:
1 parent
b07848c447
commit
37d8bf1901
5 files changed
+35
-13
No files matched your search
@@ -30,6 +30,7 @@
|
||||
"@advancedalgos/teams-client": "0.0.30",
|
||||
"@advancedalgos/users-client": "0.0.24",
|
||||
"@advancedalgos/web-components": "0.0.15",
|
||||
"@advancedalgos/operations-client": "0.0.1",
|
||||
"@babel/core": "^7.1.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||
|
||||
@@ -18,6 +18,7 @@ import Users from '@advancedalgos/users-client'
|
||||
import Teams from '@advancedalgos/teams-client'
|
||||
import Events from '@advancedalgos/events-client'
|
||||
import KeyVault from '@advancedalgos/key-vault-client'
|
||||
import Operations from '@advancedalgos/operations-client'
|
||||
// import FinancialBeings from '@advancedalgos/financial-beings-client'
|
||||
|
||||
import { FINANCIAL_BEINGS } from './constants/routes'
|
||||
@@ -74,6 +75,10 @@ export const MasterApp = props => (
|
||||
path='/key-vault'
|
||||
render={props => <KeyVault {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/operations'
|
||||
render={props => <Operations {...props} auth={auth} />}
|
||||
/>
|
||||
</Switch>
|
||||
</Layout>
|
||||
</MuiThemeProvider>
|
||||
|
||||
@@ -64,19 +64,34 @@ const keyvaultMenus = {
|
||||
]
|
||||
}
|
||||
|
||||
const operationsMenus = {
|
||||
title: 'Operations',
|
||||
to: '/operations',
|
||||
icon: Home,
|
||||
authenticated: true,
|
||||
submenus: [
|
||||
{ title: 'Your clones', to: '/operations/browse', icon: ImportContacts },
|
||||
{ title: 'Clone a bot', to: '/operations/add', icon: AddCircleOutline },
|
||||
{ title: 'Report a Bug', to: 'https://github.com/AdvancedAlgos/OperationsModule/issues/new', icon: BugReport, externalLink: true }
|
||||
]
|
||||
}
|
||||
|
||||
const financialBeingsMenus = {
|
||||
title: 'Financial beings',
|
||||
to: FINANCIAL_BEINGS,
|
||||
title: 'FBs',
|
||||
to: '/financial-beings',
|
||||
authenticated: false,
|
||||
submenus: []
|
||||
submenus: [
|
||||
{ title: 'Directory', to: '/financial-beings', icon: ImportContacts }
|
||||
]
|
||||
}
|
||||
|
||||
const allMenus = [
|
||||
usersMenus,
|
||||
teamsMenus,
|
||||
eventsMenus,
|
||||
// financialBeingsMenus,
|
||||
keyvaultMenus
|
||||
financialBeingsMenus,
|
||||
keyvaultMenus,
|
||||
operationsMenus
|
||||
]
|
||||
|
||||
export default allMenus
|
||||
@@ -45,6 +45,7 @@ export const createRemoteSchema = async (uri, preshared_key) => {
|
||||
export const createTransformedRemoteSchema = async (prefix, uri, preshared_key) => {
|
||||
var schema
|
||||
try {
|
||||
logger.info(`About to create ${prefix} schema at ${uri}`)
|
||||
schema = await createRemoteSchema(uri, preshared_key)
|
||||
} catch (error) {
|
||||
logger.error(`An error occured while fetching ${prefix}, ${uri} schema. Details: ${error}`)
|
||||
|
||||
+8
-8
@@ -43,32 +43,30 @@ async function getUserId (authId) {
|
||||
}
|
||||
|
||||
async function run () {
|
||||
logger.info('About to create schemas')
|
||||
const transformedKeyVaultSchema = await createTransformedRemoteSchema(
|
||||
'keyVault_',
|
||||
process.env.KEYVAULT_API_URL,
|
||||
process.env.KEYVAULT_API_PRESHARED)
|
||||
logger.info('KeyVault schema created')
|
||||
const transformedTeamsSchema = await createTransformedRemoteSchema(
|
||||
'teams_',
|
||||
process.env.TEAMS_API_URL,
|
||||
process.env.TEAMS_API_PRESHARED)
|
||||
logger.info('Teams schema created')
|
||||
const transformedUsersSchema = await createTransformedRemoteSchema(
|
||||
'users_',
|
||||
process.env.USERS_API_URL,
|
||||
process.env.USERS_API_PRESHARED)
|
||||
logger.info('Users schema created')
|
||||
const transformedEventsSchema = await createTransformedRemoteSchema(
|
||||
'events_',
|
||||
process.env.EVENTS_API_URL,
|
||||
process.env.EVENTS_API_PRESHARED)
|
||||
logger.info('Events schema created')
|
||||
const transformedFinancialBeingsSchema = await createTransformedRemoteSchema(
|
||||
'financialBeings_',
|
||||
process.env.FINANCIAL_BEINGS_API_URL,
|
||||
process.env.FINANCIAL_BEINGS_API_PRESHARED)
|
||||
logger.info('FINANCIAL_BEINGS schema created')
|
||||
const transformedOperationsSchema = await createTransformedRemoteSchema(
|
||||
'operations_',
|
||||
process.env.OPERATIONS_API_URL,
|
||||
process.env.OPERATIONS_API_PRESHARED)
|
||||
|
||||
var schemas = [masterSchema]
|
||||
var resolvers = {}
|
||||
@@ -97,7 +95,10 @@ async function run () {
|
||||
if (transformedFinancialBeingsSchema) {
|
||||
schemas.push(transformedFinancialBeingsSchema)
|
||||
}
|
||||
|
||||
if (transformedOperationsSchema) {
|
||||
schemas.push(transformedOperationsSchema)
|
||||
}
|
||||
|
||||
const schema = mergeSchemas({
|
||||
schemas,
|
||||
resolvers
|
||||
@@ -184,7 +185,6 @@ async function run () {
|
||||
}
|
||||
|
||||
try {
|
||||
logger.info('About to run main run method')
|
||||
run()
|
||||
} catch (e) {
|
||||
logger.error(`An general error occured while running the app: ${e}, details: ${e.message}, stack: ${e.stack}`)
|
||||
|
||||
Reference in new issue
Block a user