diff --git a/scripts/build-client-js.sh b/scripts/build-client-js.sh index afcbf26811..ea9eaa2241 100755 --- a/scripts/build-client-js.sh +++ b/scripts/build-client-js.sh @@ -13,6 +13,7 @@ cross-env BABEL_ENV="browser" browserify -t [babelify] \ revision.js \ search.js \ statistics.js \ + recent-imports.js \ -p [ factor-bundle \ -o ../../../static/js/entity-editor.js \ -o ../../../static/js/editor/edit.js \ @@ -25,5 +26,6 @@ cross-env BABEL_ENV="browser" browserify -t [babelify] \ -o ../../../static/js/revision.js \ -o ../../../static/js/search.js \ -o ../../../static/js/statistics.js \ + -o ../../../static/js/recent-imports.js \ ] > ../../../static/js/bundle.js popd diff --git a/scripts/watch-client-js.sh b/scripts/watch-client-js.sh index e985025705..8075e3b8d3 100755 --- a/scripts/watch-client-js.sh +++ b/scripts/watch-client-js.sh @@ -13,6 +13,7 @@ cross-env BABEL_ENV="browser" watchify -t [babelify] \ revision.js \ search.js \ statistics.js \ + recent-imports.js \ -p [ factor-bundle \ -o ../../../static/js/entity-editor.js \ -o ../../../static/js/editor/edit.js \ @@ -25,5 +26,6 @@ cross-env BABEL_ENV="browser" watchify -t [babelify] \ -o ../../../static/js/revision.js \ -o ../../../static/js/search.js \ -o ../../../static/js/statistics.js \ + -o ../../../static/js/recent-imports.js \ ] -o ../../../static/js/bundle.js -dv popd diff --git a/src/client/components/pages/parts/recent-import-results.js b/src/client/components/pages/parts/recent-import-results.js new file mode 100644 index 0000000000..63abefe159 --- /dev/null +++ b/src/client/components/pages/parts/recent-import-results.js @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2018 Shivam Tripathi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +import * as bootstrap from 'react-bootstrap'; +import * as utilsHelper from '../../../helpers/utils'; +import PropTypes from 'prop-types'; +import React from 'react'; + + +const {formatDate, getImportUrl} = utilsHelper; +const {Table} = bootstrap; + +/** + * Renders the document and displays the recentImports table. + * @returns {ReactElement} a HTML document which displays the recentImports + */ + +function RecentImportsTable(props) { + const {offset, recentImports} = props; + return ( +
# | +Name | +Type | +Date Added | +Source | +
---|---|---|---|---|
{i + 1 + offset} | ++ + {imports.defaultAlias.name} + + | +{imports.type} | ++ {formatDate(new Date(importedAt))} + | ++ {imports.source} + | +
{`Displaying ${limit} of ${totalResults} results`}
+