Website: update fleetRepoUrl for tables that don't have Fleet overrides (#12458)

Closes: #12434
Changes:
- Updated the `fleetRepoUrl` value for tables that don't have Fleet
overrides. The additional `/tables` in the file path is causing the
template link to create a new file in a `schema/tables//tables/` folder.
This commit is contained in:
Eric
2023-06-22 15:58:01 -05:00
committed by GitHub
parent 22bb16bf2e
commit 3b6b6e6f3f
+2 -2
View File
@@ -71,9 +71,9 @@ module.exports = {
expandedTableToPush.url = 'https://fleetdm.com/tables/'+encodeURIComponent(expandedTableToPush.name);
// Since we don't have a Fleet override for this table, we'll set the fleetRepoUrl for this table to be a link to create the Fleet override table YAML.
// This is done by adding a 'filename' and 'value' as search parameters to a url that creates a new folder in the schema/tables/ folder.
let sampleYamlSchemaForThisTable =`name: ${expandedTableToPush.name}\ndescription: >- # (required) string - The description for this table. Note: this field supports markdown\n\t# Add description here\nexamples: >- # (optional) string - An example query for this table. Note: This field supports markdown\n\t# Add examples here\nnotes: >- # (optional) string - Notes about this table. Note: This field supports markdown.\n\t# Add notes here\ncolumns: # (required)\n\t- name: # (required) string - The name of the column\n\t description: # (required) string - The column's description\n\t type: # (required) string - the column's data type\n\t required: # (required) boolean - whether or not this column is required to query this table.`;
let sampleYamlSchemaForThisTable =`name: ${expandedTableToPush.name}\ndescription: | # (required) string - The description for this table. Note: this field supports markdown\n\t# Add description here\nexamples: | # (optional) string - An example query for this table. Note: This field supports markdown\n\t# Add examples here\nnotes: | # (optional) string - Notes about this table. Note: This field supports markdown.\n\t# Add notes here\ncolumns: # (required)\n\t- name: # (required) string - The name of the column\n\t description: # (required) string - The column's description\n\t type: # (required) string - the column's data type\n\t required: # (required) boolean - whether or not this column is required to query this table.`;
expandedTableToPush.fleetRepoUrl = 'https://github.com/fleetdm/fleet/new/main/schema/tables/?filename='+encodeURIComponent('/tables/'+expandedTableToPush.name)+'.yml&value='+encodeURIComponent(sampleYamlSchemaForThisTable);
expandedTableToPush.fleetRepoUrl = 'https://github.com/fleetdm/fleet/new/main/schema?filename='+encodeURIComponent('tables/'+expandedTableToPush.name)+'.yml&value='+encodeURIComponent(sampleYamlSchemaForThisTable);
// As the table might have multiple examples, we grab only one until we
// adjust the UI to better display multiple examples (paddings, UX,