Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions agency-indexes/DoE/magpie.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"contact": {
"email": "christopher.kowalczyk@inl.gov"
"email": "holdensanchez2@llnl.gov"
},
"date": {
"created": "2018-04-24",
"metadataLastUpdated": "2023-03-15"
"created": "2018-07-30",
"metadataLastUpdated": "2020-02-05"
},
"description": "Mesoscale Atomistic Glue Program for Integrated Execution",
"laborHours": 14333.6,
"description": "Magpie contains a number of scripts for running Big Data software in HPC environments, including Hadoop and Spark. There is support for Lustre, Slurm, Moab, Torque. and LSF.\n",
"laborHours": 52607.2,
"languages": [],
"name": "magpie",
"organization": "Idaho National Laboratory (INL)",
"name": "Magpie",
"organization": "Lawrence Livermore National Laboratory (LLNL)",
"permissions": {
"exemptionText": null,
"licenses": [
{
"URL": "https://api.github.com/licenses/lgpl-2.1",
"name": "LGPL-2.1"
"URL": "https://api.github.com/licenses/gpl-2.0",
"name": "GPL-2.0"
}
],
"usageType": "openSource"
},
"repositoryURL": "https://github.com/idaholab/magpie",
"repositoryURL": "https://github.com/LLNL/magpie",
"status": "Production",
"tags": [
"DOE CODE",
"Idaho National Laboratory (INL)"
"Lawrence Livermore National Laboratory (LLNL)"
],
"vcs": "git"
}
27 changes: 17 additions & 10 deletions assets/_common/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@

switch (key) {
case 'language':
actualKey = 'languages'
actualKey = 'languages';
break;
case 'category':
actualKey = 'categories'
actualKey = 'categories';
break;
case 'platform':
actualKey = 'platforms'
actualKey = 'platforms';
break;
case 'agency':
actualKey = 'agencyName'
actualKey = 'agencyName';
break;
default:
break;
}

Expand Down Expand Up @@ -107,10 +109,15 @@
return 0;
}

if (aVal === bVal) {
return 0;
}

if (direction === 'desc') {
return aVal < bVal ? 1 : aVal > bVal ? -1 : 0;
return aVal < bVal ? 1 : -1;
}
return aVal > bVal ? 1 : aVal < bVal ? -1 : 0;

return aVal > bVal ? 1 : -1;
});
};

Expand Down Expand Up @@ -165,7 +172,7 @@
if (Array.isArray(value)) return value;
if (typeof value === 'string') return [value];
return [];
}
};

return `
<div class="project-card">
Expand Down Expand Up @@ -213,7 +220,7 @@
const cardElement = document.createElement('div');
cardElement.innerHTML = targetType === 'agencies'
? createAgencyCardHTML(item)
: createProjectCardHTML(item)
: createProjectCardHTML(item);

return cardElement.firstElementChild;
};
Expand All @@ -229,7 +236,7 @@

state.filteredData.forEach(item => {
const card = createCard(item, state.targetType);
container.appendChild(card)
container.appendChild(card);
});
};

Expand Down Expand Up @@ -349,8 +356,8 @@
const data = JSON.parse(dataScript.textContent);
initializeFilters(data, targetType);
} catch (error) {
console.error('Error parcing data for filters: ', error);

Check warning on line 359 in assets/_common/js/filters.js

View workflow job for this annotation

GitHub Actions / Run linter

Unexpected console statement
}
}
}
});
});
15 changes: 10 additions & 5 deletions assets/_common/js/issue-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@
return 0;
}

if (aVal === bVal) {
return 0;
}

if (direction === 'desc') {
return aVal < bVal ? 1 : aVal > bVal ? -1 : 0;
return aVal < bVal ? 1 : -1;
}
return aVal > bVal ? 1 : aVal < bVal ? -1 : 0;

return aVal > bVal ? 1 : -1;
});
};

Expand Down Expand Up @@ -159,7 +164,7 @@
`;
};

const createCard = (item, targetType) => {
const createCard = (item) => {
const cardElement = document.createElement('div');
cardElement.innerHTML = createIssueCardHTML(item);
return cardElement.firstElementChild;
Expand All @@ -176,7 +181,7 @@

container.innerHTML = '';
state.filteredData.forEach(item => {
const card = createCard(item, state.targetType);
const card = createCard(item);
container.appendChild(card);
});
};
Expand Down Expand Up @@ -334,12 +339,12 @@
if (dataScript) {
try {
const data = JSON.parse(dataScript.textContent);
console.log('Found', data.length, 'issues');

Check warning on line 342 in assets/_common/js/issue-filters.js

View workflow job for this annotation

GitHub Actions / Run linter

Unexpected console statement
initializeIssueFilters(data);
} catch (error) {
console.error('Error parsing data for issues filters:', error);

Check warning on line 345 in assets/_common/js/issue-filters.js

View workflow job for this annotation

GitHub Actions / Run linter

Unexpected console statement
issuesGrid.innerHTML = '<p>Error loading issues. Please refresh or contact us.</p>';
}
}
}
});
});
48 changes: 31 additions & 17 deletions config/updateCodeGov.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,38 @@

// read all files in the directory
const filenames = await fs.readdir(CONFIG.agencyDirectory)

// we know that the directory will only contain json files so dont need to check for non jsons
for (const file of filenames) {
const filePath = path.join(CONFIG.agencyDirectory, file)

try {
const content = await fs.readFile(filePath, 'utf-8')
const jsonData = JSON.parse(content)

// store the agency name only for readability in codegov.json
const matches = file.match(CONFIG.regex)
const agencyName = matches[1]

const processedFiles = await Promise.all(
filenames.map(async (file) => {
const filePath = path.join(CONFIG.agencyDirectory, file)

try {
const content = await fs.readFile(filePath, 'utf-8')
const jsonData = JSON.parse(content)

// store the agency name only for readability in codegov.json
const matches = file.match(CONFIG.regex)
const agencyName = matches ? matches[1] : null

if (!agencyName) {
return null
}

console.log(`✅ Successfully processed: ${file}`)

Check warning on line 39 in config/updateCodeGov.js

View workflow job for this annotation

GitHub Actions / Run linter

Unexpected console statement
return [agencyName, jsonData]
} catch (error) {
console.error(`❌ Error processing file: ${file}`, error)

Check warning on line 42 in config/updateCodeGov.js

View workflow job for this annotation

GitHub Actions / Run linter

Unexpected console statement
return null
}
})
)

processedFiles.forEach((entry) => {
if (entry) {
const [agencyName, jsonData] = entry
updatedJSON[agencyName] = jsonData
console.log(`✅ Successfully processed: ${file}`)
} catch (error) {
console.error(`❌ Error processing file: ${file}`, error)
}
}
})

// actually update the codegov.json file
const jsonString = JSON.stringify(updatedJSON, null, 2)
Expand All @@ -45,8 +58,9 @@

return updatedJSON
} catch (error) {
console.error('❌ Failed to update codegov.json:', error)

Check warning on line 61 in config/updateCodeGov.js

View workflow job for this annotation

GitHub Actions / Run linter

Unexpected console statement
return null
}
}

updateCodeGov()
updateCodeGov()
Loading
Loading