feat: changed old server ports so it can coexists with the new server

feat: removed deleted references from old server

feat: created reset and migrate mutations on gql server and
correspondent functions on new settings loader

feat: created front end for the config migration with reset and migrate
functionalities

style: add spacing between buttons
Signed-off-by: Liordino Neto <liordinoneto@gmail.com>
This commit is contained in:
Liordino Neto 2020-11-26 20:02:04 -03:00 committed by Josh Harvey
parent 368d528ee2
commit df8a1804a3
6 changed files with 144 additions and 65 deletions

View file

@ -271,8 +271,11 @@ const typeDefs = gql`
machineAction(deviceId:ID!, action: MachineAction!, cassette1: Int, cassette2: Int, newName: String): Machine
setCustomer(customerId: ID!, customerInput: CustomerInput): Customer
saveConfig(config: JSONObject): JSONObject
resetConfig(schemaVersion: Int): JSONObject
createPairingTotem(name: String!): String
saveAccounts(accounts: JSONObject): JSONObject
resetAccounts(schemaVersion: Int): JSONObject
migrateConfigAndAccounts: JSONObject
revokeToken(token: String!): UserToken
deleteBlacklistRow(cryptoCode: String!, address: String!): Blacklist
insertBlacklistRow(cryptoCode: String!, address: String!): Blacklist
@ -331,6 +334,7 @@ const resolvers = {
machineAction: (...[, { deviceId, action, cassette1, cassette2, newName }]) => machineAction({ deviceId, action, cassette1, cassette2, newName }),
createPairingTotem: (...[, { name }]) => pairing.totem(name),
saveAccounts: (...[, { accounts }]) => settingsLoader.saveAccounts(accounts),
resetAccounts: (...[, { schemaVersion }]) => settingsLoader.resetAccounts(schemaVersion),
setCustomer: (root, args, context, info) => {
const token = context.req.cookies && context.req.cookies.token
return customers.updateCustomer(args.customerId, args.customerInput, token)
@ -340,6 +344,8 @@ const resolvers = {
notify()
return it
}),
resetConfig: (...[, { schemaVersion }]) => settingsLoader.resetConfig(schemaVersion),
migrateConfigAndAccounts: () => settingsLoader.migrate(),
deleteBlacklistRow: (...[, { cryptoCode, address }]) =>
blacklist.deleteFromBlacklist(cryptoCode, address),
insertBlacklistRow: (...[, { cryptoCode, address }]) =>