Skip to content

Commit

Permalink
Merge 3648d60 into bda0bc9
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezequielpereyraa committed Sep 5, 2022
2 parents bda0bc9 + 3648d60 commit 0972cff
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 31 deletions.
7 changes: 4 additions & 3 deletions lib/schemas/monitor/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const cardsModified = cards.map(card => modifySchemaThenProperties(card, {
label: { $ref: 'schemaDefinitions#/definitions/stringPrefix' },
actionsModalSize: { $ref: 'schemaDefinitions#/definitions/modalSize' },
translateLabel: { type: 'boolean' },
conditions: makeConditions(false, true)
conditions: makeConditions(false, true),
source: { $ref: 'schemaDefinitions#/definitions/endpoint' },
endpointParameters: { $ref: 'schemaDefinitions#/definitions/endpointParameters' }

},
requiredProperties: ['name']
}));
Expand All @@ -34,10 +37,8 @@ module.exports = {
sortableFields,
featureFlags: { $ref: 'schemaDefinitions#/definitions/featureFlags' },
root: { const: 'Monitor' },
source: { $ref: 'schemaDefinitions#/definitions/endpoint' },
autoRefresh: { $ref: 'schemaDefinitions#/definitions/autoRefresh' },
dependencies: { $ref: 'schemaDefinitions#/definitions/dependencies' },
endpointParameters: { $ref: 'schemaDefinitions#/definitions/endpointParameters' },
cardLink: {
oneOf: [{ const: false }, customLink]
},
Expand Down
45 changes: 30 additions & 15 deletions tests/mocks/schemas/expected/monitor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@
"name": "views-demo-monitor",
"root": "Monitor",
"autoRefresh": 60,
"source": {
"service": "playground",
"namespace": "views-demo",
"method": "list",
"resolve": false
},
"endpointParameters": [
{
"name": "status",
"target": "filter",
"value": {
"static": "active"
}
}
],
"schemaSource": {
"type": "dynamic",
"endpoint": {
Expand Down Expand Up @@ -194,6 +179,21 @@
"translateLabel": false,
"mapper": "addHashtag",
"actionsModalSize": "large",
"source": {
"service": "playground",
"namespace": "views-demo",
"method": "list",
"resolve": false
},
"endpointParameters": [
{
"name": "status",
"target": "filter",
"value": {
"static": "active"
}
}
],
"actions": [
{
"name": "testEndpoint",
Expand Down Expand Up @@ -317,6 +317,21 @@
{
"name": "someCardTwo",
"component": "BaseCard",
"source": {
"service": "playground",
"namespace": "views-demo",
"method": "list",
"resolve": false
},
"endpointParameters": [
{
"name": "status",
"target": "filter",
"value": {
"static": "active"
}
}
],
"fieldsGroup": [
{
"name": "info",
Expand Down
34 changes: 21 additions & 13 deletions tests/mocks/schemas/monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ root: Monitor

autoRefresh: 60

source:
service: playground
namespace: views-demo
method: list
resolve: false

endpointParameters:
- name: status
target: filter
value:
static: active

schemaSource:
type: dynamic
endpoint:
Expand Down Expand Up @@ -133,6 +121,16 @@ fields:
translateLabel: false
mapper: addHashtag
actionsModalSize: large
source:
service: "playground"
namespace: "views-demo"
method: "list"
resolve: false
endpointParameters:
- name: "status"
target: "filter"
value:
static: "active"
actions:
- name: testEndpoint
type: endpoint
Expand Down Expand Up @@ -204,6 +202,17 @@ fields:

- name: someCardTwo
component: BaseCard
source:
service: "playground"
namespace: "views-demo"
method: "list"
resolve: false
endpointParameters:
- name: "status"
target: "filter"
value:
static: "active"

fieldsGroup:
- name: info
fields:
Expand All @@ -216,4 +225,3 @@ fields:
- - name: isEqualTo
field: name
referenceValue: test

0 comments on commit 0972cff

Please sign in to comment.