File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
geonode_mapstore_client/client/js/plugins/CreateDataset/utils Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,31 @@ export const DEFAULT_ATTRIBUTE = {
3535 attributes : [ ]
3636} ;
3737
38+ /**
39+ * Parse a number string to a number
40+ * @param {string } value - The value to parse
41+ * @returns {number } The parsed number
42+ */
3843export const parseNumber = ( value ) => {
3944 if ( value === '' ) {
4045 return null ;
4146 }
4247 return parseFloat ( value ) ;
4348} ;
4449
50+ /**
51+ * Get the attribute control id
52+ * @param {Object } data - The data to get the attribute control id from
53+ * @param {string } suffix - The suffix to add to the attribute control id
54+ * @returns {string } The attribute control id
55+ */
4556export const getAttributeControlId = ( data , suffix ) =>
4657 `attribute-${ data ?. id ?? '' } -${ suffix } ` ;
4758
59+ /**
60+ * The JSON schema for the dataset
61+ * @type {Object }
62+ */
4863export const validateSchema = {
4964 "type" : "object" ,
5065 "properties" : {
You can’t perform that action at this time.
0 commit comments