Add PointGroup resource to FE

pull/1353/head
Rick Carlino 2019-08-05 16:45:19 -05:00
parent 23744364e5
commit 056b58da90
6 changed files with 40 additions and 34 deletions

View File

@ -366,6 +366,7 @@ const KIND_PRIORITY: ResourceLookupTable = {
Sensor: 1,
Tool: 1,
Alert: 1,
PointGroup: 2,
SensorReading: 2,
Sequence: 2,
Regimen: 3,

View File

@ -117,6 +117,8 @@ export class API {
get imagesPath() { return `${this.baseUrl}/api/images/`; }
/** /api/points/ */
get pointsPath() { return `${this.baseUrl}/api/points/`; }
/** /api/point_groups/ */
get pointGroupsPath() { return `${this.baseUrl}/api/point_groups/`; }
/** /api/points/?filter=all */
get allPointsPath() { return `${this.pointsPath}?filter=all`; }
/** /api/points/search */

View File

@ -252,28 +252,29 @@ export function saveAll(input: TaggedResource[],
export function urlFor(tag: ResourceName) {
const OPTIONS: Partial<Record<ResourceName, string>> = {
Sequence: API.current.sequencesPath,
Tool: API.current.toolsPath,
FarmEvent: API.current.farmEventsPath,
Regimen: API.current.regimensPath,
Peripheral: API.current.peripheralsPath,
Sensor: API.current.sensorPath,
PinBinding: API.current.pinBindingPath,
Point: API.current.pointsPath,
User: API.current.usersPath,
Alert: API.current.alertPath,
Device: API.current.devicePath,
Image: API.current.imagesPath,
Log: API.current.filteredLogsPath,
WebcamFeed: API.current.webcamFeedPath,
FbosConfig: API.current.fbosConfigPath,
WebAppConfig: API.current.webAppConfigPath,
FirmwareConfig: API.current.firmwareConfigPath,
DiagnosticDump: API.current.diagnosticDumpsPath,
SavedGarden: API.current.savedGardensPath,
PlantTemplate: API.current.plantTemplatePath,
FarmEvent: API.current.farmEventsPath,
FarmwareEnv: API.current.farmwareEnvPath,
FarmwareInstallation: API.current.farmwareInstallationPath,
Alert: API.current.alertPath,
FbosConfig: API.current.fbosConfigPath,
FirmwareConfig: API.current.firmwareConfigPath,
Image: API.current.imagesPath,
Log: API.current.filteredLogsPath,
Peripheral: API.current.peripheralsPath,
PinBinding: API.current.pinBindingPath,
PlantTemplate: API.current.plantTemplatePath,
Point: API.current.pointsPath,
PointGroup: API.current.pointGroupsPath,
Regimen: API.current.regimensPath,
SavedGarden: API.current.savedGardensPath,
Sensor: API.current.sensorPath,
Sequence: API.current.sequencesPath,
Tool: API.current.toolsPath,
User: API.current.usersPath,
WebAppConfig: API.current.webAppConfigPath,
WebcamFeed: API.current.webcamFeedPath,
};
const url = OPTIONS[tag];
if (url) {

View File

@ -37,31 +37,32 @@ export const emptyState = (): RestResources => {
index: {
all: {},
byKind: {
WebcamFeed: {},
Alert: {},
Crop: {},
Device: {},
DiagnosticDump: {},
FarmEvent: {},
FarmwareEnv: {},
FarmwareInstallation: {},
FbosConfig: {},
FirmwareConfig: {},
Image: {},
Plant: {},
Log: {},
Peripheral: {},
Crop: {},
PinBinding: {},
Plant: {},
PlantTemplate: {},
Point: {},
PointGroup: {},
Regimen: {},
SavedGarden: {},
Sensor: {},
SensorReading: {},
Sequence: {},
Tool: {},
User: {},
FbosConfig: {},
FirmwareConfig: {},
WebAppConfig: {},
SensorReading: {},
Sensor: {},
FarmwareInstallation: {},
FarmwareEnv: {},
PinBinding: {},
PlantTemplate: {},
SavedGarden: {},
DiagnosticDump: {},
Alert: {},
WebcamFeed: {},
},
byKindAndId: {},
references: {},

View File

@ -80,7 +80,8 @@ export async function fetchSyncData(dispatch: Function) {
]),
2: () => Promise.all<{}>([
get("SensorReading", API.current.sensorReadingPath),
get("Sequence", API.current.sequencesPath)
get("Sequence", API.current.sequencesPath),
get("PointGroup", API.current.pointGroupsPath)
]),
3: () => Promise.all<{}>([
get("Regimen", API.current.regimensPath),

View File

@ -45,7 +45,7 @@
"coveralls": "3.0.5",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"farmbot": "8.0.3",
"farmbot": "8.0.4",
"i18next": "17.0.6",
"lodash": "4.17.15",
"markdown-it": "9.0.1",