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:
+2
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user