From c229a17d41ebbe969fcac49c404e3a0955d88ced Mon Sep 17 00:00:00 2001 From: Taras Dubyk Date: Thu, 19 Dec 2024 14:44:31 +0200 Subject: [PATCH] HCK-9178: add directives properties (#25) * add field level directives property * add root type directives property * add config for help message * add help for entity level directive --------- Co-authored-by: Vitalii Bedletskyi <70570504+VitaliiBedletskyi@users.noreply.github.com> --- localization/en.json | 2 + .../entity_level/entityLevelConfig.json | 41 +- .../field_level/fieldLevelConfig.json | 683 ++++++++++++++++-- 3 files changed, 676 insertions(+), 50 deletions(-) diff --git a/localization/en.json b/localization/en.json index f784d5e..05c2fa5 100644 --- a/localization/en.json +++ b/localization/en.json @@ -55,6 +55,8 @@ "PROPERTIES_PANE___MAX_VARIABLE": "Max variable", "PROPERTIES_PANE___BACKWARDS": "Backwards", "PROPERTIES_PANE___NORMALIZATION": "Normalization", + "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE": "Structured directive format not supported", + "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY": "The current version of the GraphQL plugin allows you to attach directives as raw input. Please ensure that you follow the GraphQL specifications to generate a correct script.", "CENTRAL_PANE___TAB_MONGODB_VIEW_SCRIPT": "Create View Script", "CENTRAL_PANE___TAB_DIAGRAM": "Operations ERD", "CONTEXT_MENU___ADD_BUCKET": "Add graph", diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index c7aee83..48c08eb 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -163,12 +163,41 @@ making sure that you maintain a proper JSON format. "markdown": false }, { - "propertyName": "Directive", - "propertyKeyword": "directive", - "propertyTooltip": "Popup for multi-line text entry", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyName": "Directives", + "propertyKeyword": "typeDirectives", + "propertyTooltip": "Type directives", + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ] }, { "propertyName": "Comments", diff --git a/properties_pane/field_level/fieldLevelConfig.json b/properties_pane/field_level/fieldLevelConfig.json index b0af803..26c106e 100644 --- a/properties_pane/field_level/fieldLevelConfig.json +++ b/properties_pane/field_level/fieldLevelConfig.json @@ -144,11 +144,40 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "fieldDirectives", "propertyTooltip": "Field directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ] }, "primaryKey", "foreignCollection", @@ -187,11 +216,40 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "fieldDirectives", "propertyTooltip": "Field directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ] }, "primaryKey", "default", @@ -232,11 +290,40 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "fieldDirectives", "propertyTooltip": "Field directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ] }, "default", "unit", @@ -275,11 +362,40 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "fieldDirectives", "propertyTooltip": "Field directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ] }, "primaryKey", "foreignCollection", @@ -318,11 +434,40 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "fieldDirectives", "propertyTooltip": "Field directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ] }, "default", "sample", @@ -410,11 +555,86 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "typeDirectives", "propertyTooltip": "Scalar directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": false + } + }, + { + "propertyName": "Directives", + "propertyKeyword": "fieldDirectives", + "propertyTooltip": "Field directives", + "propertyType": "group", + "enableForReference": true, + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": true + } }, "comments" ], @@ -435,11 +655,86 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "typeDirectives", "propertyTooltip": "Enum directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": false + } + }, + { + "propertyName": "Directives", + "propertyKeyword": "fieldDirectives", + "propertyTooltip": "Field directives", + "propertyType": "group", + "enableForReference": true, + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": true + } }, "comments" ], @@ -459,11 +754,86 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "typeDirectives", "propertyTooltip": "Object directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": false + } + }, + { + "propertyName": "Directives", + "propertyKeyword": "fieldDirectives", + "propertyTooltip": "Field directives", + "propertyType": "group", + "enableForReference": true, + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": true + } }, "minProperties", "maxProperties", @@ -485,11 +855,86 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "typeDirectives", "propertyTooltip": "Interface directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": false + } + }, + { + "propertyName": "Directives", + "propertyKeyword": "fieldDirectives", + "propertyTooltip": "Field directives", + "propertyType": "group", + "enableForReference": true, + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": true + } }, "minProperties", "maxProperties", @@ -511,11 +956,86 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "typeDirectives", "propertyTooltip": "Union directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": false + } + }, + { + "propertyName": "Directives", + "propertyKeyword": "fieldDirectives", + "propertyTooltip": "Field directives", + "propertyType": "group", + "enableForReference": true, + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": true + } }, "comments" ], @@ -535,11 +1055,86 @@ making sure that you maintain a proper JSON format. }, { "propertyName": "Directives", - "propertyKeyword": "directive", + "propertyKeyword": "typeDirectives", "propertyTooltip": "Input directives", - "propertyType": "details", - "template": "textarea", - "markdown": false + "propertyType": "group", + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": false + } + }, + { + "propertyName": "Directives", + "propertyKeyword": "fieldDirectives", + "propertyTooltip": "Field directives", + "propertyType": "group", + "enableForReference": true, + "structure": [ + { + "propertyName": "Directive format", + "propertyKeyword": "directiveFormat", + "propertyTooltip": "Select directive format", + "propertyType": "select", + "options": [ + "Raw" + ], + "defaultValue": "Raw", + "helpInfo": { + "type": "modal", + "title": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_TITLE", + "content": "PROPERTIES_PANE___DIRECTIVES_INFO_MODAL_BODY", + "featureNameForHelp": "GraphQL directives", + "buttons": ["contactSupport", "ok"] + } + }, + { + "propertyName": "Raw directive", + "propertyKeyword": "rawDirective", + "propertyTooltip": "Enter raw directive", + "propertyType": "details", + "template": "textarea", + "markdown": false, + "dependency": { + "key": "directiveFormat", + "value": "Raw" + } + } + ], + "dependency": { + "key": "ref", + "exist": true + } }, "comments" ],