Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Wood committed Jul 20, 2022
1 parent 9b0bfaf commit b3131cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
28 changes: 0 additions & 28 deletions server/handlers/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@ var fs = require("fs").promises;
var path = require("path");
var readJSON = require("../../lib/readJSON");

var templateList = {
"1G5p4UIsKwUK303k4gLXhAmFnret0lg3w7qLm5S62Tsg":"ai2html_graphic",
"1nbpweBccoaBqxuyKSL6o0q_qkdponL0OWgJpbozQp58":"bar_chart",
"1km6lszUzHwbgg9eFe1qcsUHfQBIF48r1XnFc1nQcnog":"county_map",
"12PsbQ7uTHr_iFeJLgt7LSkU66BQUNX8_5wQrJuvjYFU":"stacked_grouped_column_chart",
"12e3cNKWd1E2IHcDGN72URkbp7Yjb_3TbJrAxIgpYCTI":"state_grid_map",
"1E0fEV2lnchh8l5fuTvOTR5GRuv4jVtOEI-unEOCPtd4":"portrait_pullquotes",
"1kekyEB3w293-8Ex2R3VdsQZTQmrfJwZ6sfWxS7OBDyA":"graphic",
"1pcLyLFhEpKMlNpp3UqWZ1XgW8ZaloVe_d04CGdNnEWc":"dot_chart",
"1a8F0oYWVC0BdEpG8Mbz2HKRkGIn0XQiGWTcVZMXeVdQ":"table",
"1kekyEB3w293-8Ex2R3VdsQZTQmrfJwZ6sfWxS7OBDyA":"d3_graphic",
"1wq0oi5HfgfYBdDs32-Qs77xmnI9VMXPUgRHA8lKIRmM":"annotated_line_chart",
"1QTLmFGjd2BCU3QQvvXb-8RN9YkztBFOaOeaZ40SEKjw":"block_histogram",
"1-wN8QJAaAE5zzIMcbfPPchPWAGFj6BnpZrU72Fp6cm4":"column_chart",
"1G5p4UIsKwUK303k4gLXhAmFnret0lg3w7qLm5S62Tsg":"ai2html_map",
"1DLHWPcJcGoKHRGBtATdBbZVIT0EuiAXG_SiQiDucazg":"stacked_bar_chart",
"1DLxMcQRpyp1rqGJTjC28jJH5Df1GYrJrJnBl2PW9-MU":"line_chart",
"19d-SxZs0z5fl7pETB427wp4DYzNwB5znkNZg6kF69j4":"grouped_bar_chart",
"1tCkiSX2QV2_LjXWW6sNe7s9MqREeDEYrIGQF8mb0OHw":"stacked_column_chart"
}

This comment has been minimized.

Copy link
@DanielJWood

DanielJWood Jul 21, 2022

Contributor

@thomaswilburn see here where I roll this back.

var getFolders = async function(dir) {
var listing = await fs.readdir(dir);
var matching = [];
Expand All @@ -47,13 +26,6 @@ var getMetadata = async function(data,dir) {
var manifest = await readJSON(manifestPath);
if (manifest.templateType && manifest.templateType != "test") {
var template = manifest.templateType;
}
else if (manifest.templateType == "test") {
var template = templateList[manifest.templateSheet];

manifest.templateType = template;
// update manifest with test
await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));

This comment has been minimized.

Copy link
@DanielJWood

DanielJWood Jul 21, 2022

Contributor

here also, I roll back the writeFile command, which was only included for one time use.

This comment has been minimized.

Copy link
@thomaswilburn

thomaswilburn Jul 21, 2022

Contributor

Fair enough! I wonder if, in the future, it may make sense to do this kind of work in the CLI layer, not in the server, since that's a much lighter way of handling bulk actions.

} else {
template = "";
}
Expand Down
6 changes: 2 additions & 4 deletions server/templates/rootList.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ <h1 class="title">daily.graphics</h1>
<% graphics.forEach(function(g) {
var date = g.split("-")
var date = date[date.length -1]
var date = `${date.substring(4, 6)}/${date.substring(6, 8)}/${date.substring(0, 4)}`
var olds = ["πŸ§“πŸ»","πŸ‘΄πŸ»","πŸ‘΅πŸ»","πŸ§“πŸΌ","πŸ‘΄πŸΌ","πŸ‘΅πŸΌ","πŸ§“πŸ½","πŸ‘΄πŸ½","πŸ‘΅πŸ½","πŸ§“πŸΎ","πŸ‘΄πŸΎ","πŸ‘΅πŸΎ","πŸ§“πŸΏ","πŸ‘΄πŸΏ","πŸ‘΅πŸΏ"]
var randOld = olds[Math.floor(Math.random()*15)];
var lineage = graphicMetadata[g].parent.join(`<br>${randOld} `)
var date = `${date.substring(4, 6)}/${date.substring(6, 8)}/${date.substring(0, 4)}`
var lineage = graphicMetadata[g].parent.join(`<br>πŸ‘‰`)
%>
<tr data-slug="<%= g %>" role="row">
<td data-slug="<%= g %>" class="item" role="cell" data-title="Slug">
Expand Down

0 comments on commit b3131cf

Please sign in to comment.