Skip to content

Commit

Permalink
Merge 7616bca into 93eadce
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Gonzalez committed May 16, 2022
2 parents 93eadce + 7616bca commit 459cf2d
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/schemas/common/browseBase/massiveActions.js
Expand Up @@ -12,6 +12,7 @@ module.exports = isPage => ({
translateTitle: { type: 'boolean' },
source: { $ref: 'schemaDefinitions#/definitions/endpoint' },
endpointParameters: getEndpointParameters(isPage),
modalSize: { $ref: 'schemaDefinitions#/definitions/modalSize' },
actions: makeGenericActions({ customCallbacks })
},
additionalProperties: false,
Expand Down
1 change: 1 addition & 0 deletions lib/schemas/common/generic-actions/action.js
Expand Up @@ -79,6 +79,7 @@ module.exports = {
type: 'object',
properties: {
...commonAttrs,
modalSize: { $ref: 'schemaDefinitions#/definitions/modalSize' },
endpoint: { $ref: 'schemaDefinitions#/definitions/endpoint' },
endpointParameters: { $ref: 'schemaDefinitions#/definitions/endpointParameters' },
fields: {
Expand Down
6 changes: 6 additions & 0 deletions lib/schemas/common/modalSize.js
@@ -0,0 +1,6 @@
'use strict';

module.exports = {
type: 'string',
enum: ['small', 'medium', 'large', 'extra-large', 'mobile']
};
1 change: 1 addition & 0 deletions lib/schemas/common/topComponents.js
Expand Up @@ -76,6 +76,7 @@ const makeTopComponents = (isBrowsePage = false) => ({
iconColor: { type: 'string' },
color: { type: 'string' },
backgroundColor: { type: 'string' },
modalSize: { $ref: 'schemaDefinitions#/definitions/modalSize' },
fields: {
type: 'array',
items: {
Expand Down
2 changes: 2 additions & 0 deletions lib/schemas/definitions/index.js
Expand Up @@ -8,6 +8,7 @@ const dependencies = require('../common/dependencies');
const stringPrefix = require('../common/stringPrefix');
const autoRefresh = require('../common/autoRefresh');
const graphs = require('../common/graphs');
const modalSize = require('../common/modalSize');

module.exports = {
$id: 'schemaDefinitions',
Expand All @@ -18,6 +19,7 @@ module.exports = {
dependencies,
stringPrefix,
autoRefresh,
modalSize,
graphs,
endpointParameters: getEndpointParameters()
}
Expand Down
1 change: 1 addition & 0 deletions lib/schemas/edit-new/modules/components/location.js
Expand Up @@ -26,6 +26,7 @@ module.exports = makeComponent({
]
},
markers: markersSchema,
modalSize: { $ref: 'schemaDefinitions#/definitions/modalSize' },
fieldsMapping: {
type: 'object',
properties: {
Expand Down
3 changes: 2 additions & 1 deletion lib/schemas/edit/schema.js
Expand Up @@ -16,7 +16,8 @@ module.exports = {
title: { $ref: 'schemaDefinitions#/definitions/stringPrefix' },
translateTitle: { type: 'boolean' },
source: { $ref: 'schemaDefinitions#/definitions/endpoint' },
sourceEndpointParameters: { $ref: 'schemaDefinitions#/definitions/endpointParameters' }
sourceEndpointParameters: { $ref: 'schemaDefinitions#/definitions/endpointParameters' },
modalSize: { $ref: 'schemaDefinitions#/definitions/modalSize' }
},
required: ['source'],
additionalProperties: false
Expand Down
1 change: 1 addition & 0 deletions lib/schemas/monitor/schema.js
Expand Up @@ -15,6 +15,7 @@ const cardsModified = cards.map(card => modifySchemaThenProperties(card, {
properties: {
name: { type: 'string' },
label: { $ref: 'schemaDefinitions#/definitions/stringPrefix' },
actionsModalSize: { $ref: 'schemaDefinitions#/definitions/modalSize' },
translateLabel: { type: 'boolean' },
conditions: makeConditions(false, true)
},
Expand Down
1 change: 1 addition & 0 deletions tests/mocks/schemas/browse.json
Expand Up @@ -155,6 +155,7 @@
"massiveActions": {
"title": "common.title",
"translateTitle": true,
"modalSize": "large",
"source": {
"service": "serviceName",
"namespace": "namespaceName",
Expand Down
3 changes: 3 additions & 0 deletions tests/mocks/schemas/edit.yml
Expand Up @@ -83,6 +83,7 @@ collapseSections: true
remoteActions:
title: views.title.someTitle
translateTitle: true
modalSize: extra-large
source:
service: serviceName
namespace: namespaceName
Expand Down Expand Up @@ -259,6 +260,7 @@ sections:
iconColor: colorName
color: colorName
backgroundColor: colorName
modalSize: medium
callback:
name: redirect
props:
Expand Down Expand Up @@ -632,6 +634,7 @@ sections:
component: Location
componentAttributes:
label: some.traduction.label
modalSize: small
markers:
icon: iconName
color: colorName
Expand Down
1 change: 1 addition & 0 deletions tests/mocks/schemas/expected/browse.json
Expand Up @@ -180,6 +180,7 @@
"massiveActions": {
"title": "common.title",
"translateTitle": true,
"modalSize": "large",
"source": {
"service": "serviceName",
"namespace": "namespaceName",
Expand Down
3 changes: 3 additions & 0 deletions tests/mocks/schemas/expected/edit.json
Expand Up @@ -132,6 +132,7 @@
"remoteActions": {
"title": "views.title.someTitle",
"translateTitle": true,
"modalSize": "extra-large",
"source": {
"service": "serviceName",
"namespace": "namespaceName",
Expand Down Expand Up @@ -400,6 +401,7 @@
"iconColor": "colorName",
"color": "colorName",
"backgroundColor": "colorName",
"modalSize": "medium",
"callback": {
"name": "redirect",
"props": {
Expand Down Expand Up @@ -1015,6 +1017,7 @@
"component": "Location",
"componentAttributes": {
"label": "some.traduction.label",
"modalSize": "small",
"markers": {
"icon": "iconName",
"color": "colorName",
Expand Down
2 changes: 2 additions & 0 deletions tests/mocks/schemas/expected/monitor.json
Expand Up @@ -189,6 +189,7 @@
"component": "BaseCard",
"label": "some.label.key",
"translateLabel": false,
"actionsModalSize": "large",
"actions": [
{
"name": "testEndpoint",
Expand Down Expand Up @@ -247,6 +248,7 @@
"type": "form",
"callback": "reloadData",
"componentAttributes": {
"modalSize": "mobile",
"endpoint": {
"service": "serviceName",
"namespace": "namespaceName",
Expand Down
2 changes: 2 additions & 0 deletions tests/mocks/schemas/monitor.yml
Expand Up @@ -128,6 +128,7 @@ fields:
component: BaseCard
label: some.label.key
translateLabel: false
actionsModalSize: large
actions:
- name: testEndpoint
type: endpoint
Expand Down Expand Up @@ -166,6 +167,7 @@ fields:
type: form
callback: reloadData
componentAttributes:
modalSize: mobile
endpoint:
service: serviceName
namespace: namespaceName
Expand Down

0 comments on commit 459cf2d

Please sign in to comment.