Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions adapter/0.1.37.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* Copyright © 2016-2018 by IntegrIT S.A. dba Hackolade. All rights reserved.
*
* The copyright to the computer software herein is the property of IntegrIT S.A.
* The software may be used and/or copied only with the written permission of
* IntegrIT S.A. or in accordance with the terms and conditions stipulated in
* the agreement/contract under which the software has been supplied.
*
* {
* "add": {
* "entity": [<names of new property>],
* "container": [<names of new property>],
* "model": [<names of new property>],
* "view": [<names of new property>],
* "field": {
* "<type>": [<names of new property>]
* }
* },
* "remove": {
* "entity": [<names of new property>],
* "container": [<names of new property>],
* "model": [<names of new property>],
* "view": [<names of new property>],
* "field": {
* "<type>": [<names of new property>]
* }
* },
* "modify": {
* "entity": [
* {
* "from": { <properties that identify record> },
* "to": { <properties that need to be changed> }
* }
* ],
* "container": [],
* "model": [],
* "view": [],
* "field": []
* },
* }
*/
{
"modify": {
"field": [
{
"from": {
"type": "integer",
"format": "int64"
},
"to": {
"mode": "int64"
}
},
{
"from": {
"type": "integer",
"format": "int32"
},
"to": {
"mode": "int32"
}
},
{
"from": {
"type": "number",
"format": "float"
},
"to": {
"mode": "float"
}
},
{
"from": {
"type": "number",
"format": "double"
},
"to": {
"mode": "double"
}
}
]
},
"delete": {
"field": {
"integer": [
"format"
],
"number": [
"format"
]
}
}
}
2 changes: 1 addition & 1 deletion properties_pane/field_level/fieldLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ making sure that you maintain a proper JSON format.
"schemaId",
"type",
{
"propertyName": "format",
"propertyName": "Format",
"propertyKeyword": "mode",
"propertyType": "select",
"options": [
Expand Down
17 changes: 15 additions & 2 deletions reverse_engineering/helpers/dataHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,27 @@ const setMissedType = (schema) => {
return schema;
}

const convertFormatToMode = schema => {
switch (schema.type) {
case 'number':
case 'integer': {
const { format, ...schemaData } = schema;

return { ...schemaData, mode: format };
}
default:
return schema;
}
};

const handleSchemaProps = (schema, fieldOrder) => {
if (!schema) {
schema = {
type: 'object'
};
}

const fixedSchema = setMissedType(schema);
const fixedSchema = convertFormatToMode(setMissedType(schema));
const schemaWithAdditionalPropertiesData = handleAdditionalProperties(fixedSchema);
const schemaWithChoices = handleSchemaChoices(schemaWithAdditionalPropertiesData, fieldOrder);
const reorderedSchema = commonHelper.reorderFields(schemaWithChoices, fieldOrder);
Expand Down Expand Up @@ -608,7 +621,7 @@ const handleDefinitionSchemaProps = (schema, fieldOrder) => {
};
}

const fixedSchema = setMissedType(schema);
const fixedSchema = convertFormatToMode(setMissedType(schema));
const schemaWithAdditionalPropertiesData = handleAdditionalProperties(fixedSchema);
const reorderedSchema = commonHelper.reorderFields(schemaWithAdditionalPropertiesData, fieldOrder);
const schemaWithHandledProperties = Object.keys(reorderedSchema).reduce((accumulator, property) => {
Expand Down