Skip to content

Commit

Permalink
Merge branch 'gsoc' into release-sort-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz authored Aug 17, 2023
2 parents f11d412 + 81f588b commit 5881d26
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions aiida-registry-app/src/Components/MainIndex.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react';
import { useState, useEffect } from 'react';
import { Link, Route, Routes } from 'react-router-dom';
import jsonData from '../plugins_metadata.json'
import base64Icon from '../base64Icon';
Expand All @@ -16,9 +16,24 @@ const length = Object.keys(plugins).length;
const currentPath = import.meta.env.VITE_PR_PREVIEW_PATH || "/aiida-registry/";

function MainIndex() {
const [sortOption, setSortOption] = useState('alpha');
const [sortOption, setSortOption] = useState('commits');
const [sortedData, setSortedData] = useState(plugins);
document.documentElement.style.scrollBehavior = 'auto';

useEffect(() => {
document.documentElement.style.scrollBehavior = 'auto';
setSortedData(sortByCommits(plugins));
setupScrollBehavior();
}, [plugins, setSortedData]);

function sortByCommits(plugins) {
const pluginsArray = Object.entries(plugins);

// Sort the array based on the commit_count value
pluginsArray.sort(([, pluginA], [, pluginB]) => pluginB.commits_count - pluginA.commits_count);

// Return a new object with the sorted entries
return Object.fromEntries(pluginsArray);
}

function setupScrollBehavior() {
var prevScrollpos = window.scrollY;
Expand All @@ -42,13 +57,7 @@ function MainIndex() {

let sortedPlugins = {};
if (option === 'commits') {
const pluginsArray = Object.entries(plugins);

// Sort the array based on the commit_count value
pluginsArray.sort(([, pluginA], [, pluginB]) => pluginB.commits_count - pluginA.commits_count);

// Create a new object with the sorted entries
sortedPlugins = Object.fromEntries(pluginsArray);
sortedPlugins = sortByCommits(plugins);
}
else if (option == 'alpha') {
sortedPlugins = plugins;
Expand Down

1 comment on commit 5881d26

@github-actions
Copy link

Choose a reason for hiding this comment

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

Potential issues in retrieved plugin metadata (ignore those for plugins not managed by you)

WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-QECpWorkChain]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-aenet]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-aenet]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-alloy]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-alloy]
WARNING! Entry point 'elastic' does not start with prefix 'alloy.' [aiida-alloy]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-autocas]
WARNING! No bdist_wheel available for PyPI release [aiida-bands-inspect]
WARNING! AiiDA version not found [aiida-bands-inspect]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-bigdft]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-castep]
WARNING! No bdist_wheel available for PyPI release [aiida-catmat]
WARNING! AiiDA version not found [aiida-catmat]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-catmat]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-catmat]
WARNING! Entry point 'vasp_base_parser' does not start with prefix 'catmat.' [aiida-catmat]
WARNING! Entry point 'vasp.base' does not start with prefix 'catmat.' [aiida-catmat]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-ce]
WARNING! No bdist_wheel available for PyPI release [aiida-champ]
WARNING! AiiDA version not found [aiida-champ]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-champ]
WARNING! Entry point 'CHAMP' does not start with prefix 'champ.' [aiida-champ]
WARNING! Entry point 'CHAMP' does not start with prefix 'champ.' [aiida-champ]
WARNING! Entry point 'CHAMP' does not start with prefix 'champ.' [aiida-champ]
WARNING! Entry point 'CHAMP' does not start with prefix 'champ.' [aiida-champ]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-core]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-crystal-dft]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-crystal17]
WARNING! Entry point 'potcar' does not start with prefix 'cusp.' [aiida-cusp]
WARNING! Development status in classifiers (alpha) does not match development_status in metadata (stable) [aiida-diff]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-diff]
WARNING! Cannot fetch all data from PyPI and missing plugin_info key! [aiida-dynamic-workflows]
WARNING! AiiDA version not found [aiida-dynamic-workflows]
WARNING! > WARNING! Unable to retrieve plugin info from: https://raw.github.com/environ-developers/aiida-environ/master/setup.json [aiida-environ]
WARNING! AiiDA version not found [aiida-environ]
WARNING! Cannot fetch all data from PyPI and missing plugin_info key! [aiida-eon]
WARNING! AiiDA version not found [aiida-eon]
WARNING! Cannot fetch all data from PyPI and missing plugin_info key! [aiida-eonclient]
WARNING! AiiDA version not found [aiida-eonclient]
WARNING! > WARNING! Unable to retrieve plugin info from: https://raw.github.com/sphuber/aiida-fenics/master/setup.json [aiida-fenics]
WARNING! AiiDA version not found [aiida-fenics]
WARNING! AiiDA version not found [aiida-fireworks-scheduler]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-fireworks-scheduler]
WARNING! Entry point 'fireworks' does not start with prefix 'fireworks_scheduler.' [aiida-fireworks-scheduler]
WARNING! Entry point 'fireworks-scheduler' does not start with prefix 'fireworks_scheduler.' [aiida-fireworks-scheduler]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-fleur]
WARNING! Prefix 'gaussian' does not follow naming convention. [aiida-gaussian-datatypes]
WARNING! Unable to read wheel file from PyPI release: No entry_points.txt found in wheel [aiida-graphql]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-graphql]
WARNING! Entry point 'general-MD' does not start with prefix 'gromacs.' [aiida-gromacs]
WARNING! Entry point 'general-MD' does not start with prefix 'gromacs.' [aiida-gromacs]
WARNING! Unable to read wheel file from PyPI release: No entry_points.txt found in wheel [aiida-grouppathx]
WARNING! Development status in classifiers (alpha) does not match development_status in metadata (beta) [aiida-grouppathx]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-grouppathx]
WARNING! Entry point 'gpx' does not start with prefix 'grouppathx.' [aiida-grouppathx]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-gudhi]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-gudhi]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-gulp]
WARNING! No bdist_wheel available for PyPI release [aiida-kkr]
WARNING! > WARNING! Unable to retrieve plugin info from: https://raw.github.com/JuDFTteam/aiida-kkr/develop/setup.json [aiida-kkr]
WARNING! AiiDA version not found [aiida-kkr]
WARNING! Development status in classifiers (beta) does not match development_status in metadata (stable) [aiida-kkr]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-kkr]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-lammps]
WARNING! Entry point 'dynaphopy' does not start with prefix 'lammps.' [aiida-lammps]
WARNING! Entry point 'dynaphopy' does not start with prefix 'lammps.' [aiida-lammps]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-lsmo]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-lsmo]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-metavo-scheduler]
WARNING! Entry point 'sshmetavo' does not start with prefix 'metavo_scheduler.' [aiida-metavo-scheduler]
WARNING! Entry point 'pbsprometavo' does not start with prefix 'metavo_scheduler.' [aiida-metavo-scheduler]
WARNING! Entry point 'sshmetavo' does not start with prefix 'metavo_scheduler.' [aiida-metavo-scheduler]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-mpds]
WARNING! Entry point 'crystal.mpds' does not start with prefix 'mpds.' [aiida-mpds]
WARNING! Entry point 'crystal.cif' does not start with prefix 'mpds.' [aiida-mpds]
WARNING! Entry point 'crystal.aiida' does not start with prefix 'mpds.' [aiida-mpds]
WARNING! > WARNING! Unable to retrieve plugin info from: https://raw.githubusercontent.com/nanotech-empa/aiida-nanotech-empa/master/setup.json [aiida-nanotech-empa]
WARNING! AiiDA version not found [aiida-nanotech-empa]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-nanotech-empa]
WARNING! > WARNING! Unable to retrieve plugin info from: https://raw.githubusercontent.com/atztogo/aiida-nims-scheduler/master/setup.json [aiida-nims-scheduler]
WARNING! AiiDA version not found [aiida-nims-scheduler]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-nims-scheduler]
WARNING! Prefix 'quantumespresso.ocv' does not follow naming convention. [aiida-open_circuit_voltage]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-orca]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-phtools]
WARNING! No bdist_wheel available for PyPI release [aiida-porousmaterials]
WARNING! AiiDA version not found [aiida-porousmaterials]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-porousmaterials]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-psi4]
WARNING! Cannot fetch all data from PyPI and missing plugin_info key! [aiida-python]
WARNING! AiiDA version not found [aiida-python]
WARNING! Prefix 'aiidapython' does not follow naming convention. [aiida-python]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-qeq]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-qeq]
WARNING! No bdist_wheel available for PyPI release [aiida-qp2]
WARNING! AiiDA version not found [aiida-qp2]
WARNING! Entry point 'noncollinearhydrogen' does not start with prefix 'quantumespresso.' [aiida-quantumespresso]
WARNING! Entry point 'spinorbithydrogen' does not start with prefix 'quantumespresso.' [aiida-quantumespresso]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-quantumespresso-hp]
WARNING! Prefix 'quantumespresso.hp' does not follow naming convention. [aiida-quantumespresso-hp]
WARNING! No bdist_wheel available for PyPI release [aiida-raspa]
WARNING! AiiDA version not found [aiida-raspa]
WARNING! Prefix 'core' does not follow naming convention. [aiida-shell]
WARNING! No bdist_wheel available for PyPI release [aiida-siesta]
WARNING! > WARNING! Unable to retrieve plugin info from: https://raw.github.com/siesta-project/aiida_siesta_plugin/master/setup.json [aiida-siesta]
WARNING! No bdist_wheel available for PyPI release [aiida-spirit]
WARNING! AiiDA version not found [aiida-spirit]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-sshonly]
WARNING! Entry point 'ssh_only' does not start with prefix 'sshonly.' [aiida-sshonly]
WARNING! No bdist_wheel available for PyPI release [aiida-statefile-schedulers]
WARNING! AiiDA version not found [aiida-statefile-schedulers]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-statefile-schedulers]
WARNING! No bdist_wheel available for PyPI release [aiida-strain]
WARNING! AiiDA version not found [aiida-strain]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-supercell]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-supercell]
WARNING! No bdist_wheel available for PyPI release [aiida-symmetry-representation]
WARNING! AiiDA version not found [aiida-symmetry-representation]
WARNING! No bdist_wheel available for PyPI release [aiida-tbextraction]
WARNING! AiiDA version not found [aiida-tbextraction]
WARNING! No bdist_wheel available for PyPI release [aiida-tbmodels]
WARNING! AiiDA version not found [aiida-tbmodels]
WARNING! Missing classifier 'Framework :: AiiDA' [aiida-tcod]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-tcod]
WARNING! Entry point 'UppASD_core_calculations' does not start with prefix 'uppasd.' [aiida-uppasd]
WARNING! Entry point 'UppASD_core_parsers' does not start with prefix 'uppasd.' [aiida-uppasd]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-wannier90-workflows]
WARNING! Cannot fetch all data from PyPI and missing plugin_info key! [aiida-wien2k]
WARNING! AiiDA version not found [aiida-wien2k]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-yambo]
WARNING! AiiDA version not found [aiida-yascheduler]
WARNING! > WARNING! Unable to retrieve plugin info from: https://raw.githubusercontent.com/antimomarrazzo/aiida-z2pack/master/setup.json [aiida-z2pack]
WARNING! AiiDA version not found [aiida-z2pack]
WARNING! No bdist_wheel available for PyPI release [aiida-zeopp]
WARNING! AiiDA version not found [aiida-zeopp]
WARNING! development_status key is deprecated. Use PyPI Trove classifiers in the plugin repository instead. [aiida-zeopp]

Please sign in to comment.