Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 #1

Merged
merged 13 commits into from
Aug 21, 2024
Merged

🚀 #1

merged 13 commits into from
Aug 21, 2024

Conversation

onl1ner
Copy link
Contributor

@onl1ner onl1ner commented Aug 15, 2024

The initial implementation of technology radar

@onl1ner onl1ner added the enhancement New feature or request label Aug 15, 2024
.eleventy.js Outdated
Comment on lines 11 to 16
var payload = {
"title": radar.category,
"date": radar.date,
...baseSettings,
...radar.data
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. используй пожалуйста const а не var
  2. деструктуризация baseSettings и radar.data может затереть то что ты выше подметил для title и date, поэтому лучше так попробуй:
    const payload = { ...baseSettings, ...radar.data, title: radar.category, date: radar.date, };

const { parse } = require("csv-parse/sync");

function readCSV(dir) {
var file = fs.readFileSync(dir);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

const rings = Object.keys(settings.rings).map((e) => settings.rings[e]);
const quadrants = Object.keys(settings.quadrants.names).map((e) => ({ name: settings.quadrants.names[e] }));

var entries = [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const radarsDir = path.join(process.cwd(), "radars")
const categories = fs.readdirSync(radarsDir)

var radars = [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 62 to 65
var categoryPath = path.join(radarsDir, category);

var settingsPath = path.join(categoryPath, "settings.json");
var settings = {};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 67 to 69
if (fs.existsSync(settingsPath)) {
settings = JSON.parse(fs.readFileSync(settingsPath), 'utf8');
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const settings = fs.existsSync(settingsPath) ? JSON.parse(fs.readFileSync(settingsPath), 'utf8') : {}

@temirlan-tekmates
Copy link

LGTM!

@onl1ner onl1ner merged commit 590f430 into main Aug 21, 2024
@onl1ner onl1ner deleted the init branch August 27, 2024 07:15
onl1ner added a commit that referenced this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants