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

Feature 2079 file display #2209

Merged
merged 104 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
ea1a7c9
Add required dependencies from PackageTableView
rushirajnenuji Dec 12, 2022
41519f0
Add functions required for the metadata view display
rushirajnenuji Dec 12, 2022
36f6ca3
Fix indentation
rushirajnenuji Dec 12, 2022
776a9a4
Update DataPackageView with table render method for packageTable
rushirajnenuji Dec 12, 2022
7552848
Update references for PackageTableView to DataPackageView
rushirajnenuji Dec 12, 2022
40efe70
Updated MetadataView with references for DataPackageView
rushirajnenuji Dec 12, 2022
a890bb1
Merge remote-tracking branch 'origin/develop' into feature-deprecatin…
rushirajnenuji Dec 12, 2022
d696cf4
Remove unused references
rushirajnenuji Jan 10, 2023
ec174ff
(init) Utilize same template for both editable and non-editable displays
rushirajnenuji Jan 10, 2023
e52e331
Remove DownloadContentsTemplate from DataPackageView
rushirajnenuji Jan 10, 2023
0fb293f
[init] Use dataPackage to render files in view mode
rushirajnenuji Jan 10, 2023
9dd70d1
Wait for dataPackage to sync before rendering the packageTable
rushirajnenuji Jan 10, 2023
80b62ea
Get files to display in the MetadataView
rushirajnenuji Jan 10, 2023
f4fc814
Update data package template to display columns based on view type
rushirajnenuji Jan 10, 2023
b691d99
Remove spinner and loading message
rushirajnenuji Jan 19, 2023
71dea8f
Add header to the files table
rushirajnenuji Jan 19, 2023
96ce341
Fix file type and file icon in data package table
rushirajnenuji Jan 19, 2023
620fa69
Insert member metrics in the Package table
rushirajnenuji Jan 19, 2023
5469b1e
Update dataPackage.html
rushirajnenuji Feb 16, 2023
8797737
Add icons for the actions panel
rushirajnenuji Feb 16, 2023
6cbce4a
Add additional classes to package table
rushirajnenuji Feb 16, 2023
a8e2777
Get More Info button working in Actions panel
rushirajnenuji Feb 16, 2023
0eda652
Add some styling changes to the Package Table View
rushirajnenuji Feb 16, 2023
8f48ed2
Download Action Button init
rushirajnenuji Feb 16, 2023
214609f
Update download button view for actions panel
rushirajnenuji Feb 16, 2023
c2c6f16
Add styling rules for rounded actions button
rushirajnenuji Feb 16, 2023
2027472
Moving download button to actions panel
rushirajnenuji Feb 16, 2023
9bdc350
Add more icons and buttons in the package table header
rushirajnenuji Feb 16, 2023
03ec889
[WIP] Add expand/collapse of file icons
rushirajnenuji Feb 16, 2023
f6daf7e
Update DataItem to include preview class for info icons
rushirajnenuji Feb 16, 2023
c2d7300
Add some styling fix for the file download button
rushirajnenuji Feb 28, 2023
eeee4ab
Update metadata object title to file name
rushirajnenuji Feb 28, 2023
19c3703
Update file size units
rushirajnenuji Mar 2, 2023
fb0219e
Use metrics icon in package contents table
rushirajnenuji Mar 2, 2023
cd5e0f9
Fix issues with download URL in package table
rushirajnenuji Mar 2, 2023
7842992
Merge branch 'develop' into feature-2079-file-display
rushirajnenuji Mar 20, 2023
79ee0fe
Fix broken changes in the merge
rushirajnenuji Mar 22, 2023
059dc5d
Parse and store atLocation information
rushirajnenuji Mar 23, 2023
010080c
Store atLocation information in the dataPackageView
rushirajnenuji Mar 30, 2023
491cb04
form FilePath object
rushirajnenuji Apr 4, 2023
f648854
Update DataPackageView.js
rushirajnenuji Apr 5, 2023
f5bc843
[WIP] display folders in PackageTable
rushirajnenuji Apr 6, 2023
209241f
Update DataPackageView.js
rushirajnenuji Apr 7, 2023
fc43448
Use DataItemHierarchy template in dataItemView for hierarchical display
rushirajnenuji Apr 11, 2023
57334f6
[WIP] Display hierarchy in the package table
rushirajnenuji Apr 11, 2023
82f2ee2
Fix issues with file paths
rushirajnenuji Apr 13, 2023
82f562a
[WIP] Expand Collapse file hierarchy
rushirajnenuji Apr 13, 2023
683a20b
Expand/Collapse at child level
rushirajnenuji Apr 18, 2023
00e6edf
Fix issues with expand / collapse
rushirajnenuji Apr 27, 2023
4c5f5ba
Fix more issues with expand / collapse
rushirajnenuji May 4, 2023
95ff41b
[WIP] Adding nested datasets to the package table
rushirajnenuji May 9, 2023
db34bcf
Add nested packages to the package table
rushirajnenuji May 15, 2023
0265fd4
Add top level data package row to the package table
rushirajnenuji May 16, 2023
7b70ea2
Styling changes for the file table
rushirajnenuji May 18, 2023
c7e9d10
Expand and Collapse all folders within a package
rushirajnenuji May 25, 2023
b2e994a
Add flags to display sort and filter options
rushirajnenuji May 30, 2023
9613010
Add styles for fixed table header
rushirajnenuji May 31, 2023
5928081
Retrieve title only if it is not available
rushirajnenuji Jun 26, 2023
8f61ea8
Add stop listening handler for datapackage
rushirajnenuji Jul 6, 2023
1be1f74
Merge branch 'develop' into feature-2079-file-display
rushirajnenuji Jul 31, 2023
15a5515
Replace package header and add package download button
rushirajnenuji Aug 2, 2023
fe6fedb
Update metacatui-common.css
rushirajnenuji Aug 3, 2023
8bdd9d0
Fix issues with Data Packages not loading properly for datasets
rushirajnenuji Aug 7, 2023
bea0221
Disable Package downloads for lonely metadata docs
rushirajnenuji Aug 8, 2023
20e4fd9
Fix issues with nested packages
rushirajnenuji Aug 9, 2023
ad263b6
Fix size string for nested packages
rushirajnenuji Aug 9, 2023
47b2135
Fix some more issues with Expand / Collapse
rushirajnenuji Aug 10, 2023
18b250e
Disable sorting and filtering buttons
rushirajnenuji Aug 23, 2023
f57a3ef
Fix indentation for folder hierarchy
rushirajnenuji Aug 24, 2023
8baf08e
Add metrics to the package table
rushirajnenuji Aug 24, 2023
3b862f7
Update styling rules for package table
rushirajnenuji Aug 24, 2023
b04530e
Only display more info icons if entity details are available
rushirajnenuji Aug 24, 2023
7f0a5fe
Replace DataItemView download functionality with DownloadButtonView
rushirajnenuji Aug 25, 2023
5d38eef
Use DownloadButtonView for nested packages download
rushirajnenuji Aug 25, 2023
e9b0bb1
Add tooltips for file names
rushirajnenuji Sep 7, 2023
798690a
Bug fix
rushirajnenuji Sep 7, 2023
76913cf
Fix errors with title
rushirajnenuji Oct 19, 2023
88e730b
Update DataPackage.js
rushirajnenuji Oct 30, 2023
b3c2a2e
Add some more documentation
rushirajnenuji Oct 30, 2023
e146438
Update router.js
rushirajnenuji Oct 30, 2023
2aab9b5
Update StatsView.js
rushirajnenuji Oct 30, 2023
a789dd2
Merge branch 'develop' into feature-2079-file-display
rushirajnenuji Oct 30, 2023
6dc5ad5
Update puppeteer
rushirajnenuji Nov 21, 2023
8e98930
convertToAbsolutePath
rushirajnenuji Nov 21, 2023
b0b3818
Add tests
rushirajnenuji Nov 21, 2023
3a3edd4
Updated tests + bug fixes
rushirajnenuji Nov 21, 2023
2adbc57
Add more jsdocs
rushirajnenuji Nov 21, 2023
6263e94
Clean up code
rushirajnenuji Dec 4, 2023
a9c1e32
Add some more documentation
rushirajnenuji Dec 4, 2023
a8e0e18
Resolve issues with slow loading of data items
rushirajnenuji Jan 29, 2024
51ee1c9
Update DataPackageView
rushirajnenuji Jan 29, 2024
24dc998
Update DataPackage.js
rushirajnenuji Jan 29, 2024
1d227ff
Fix whitespace
rushirajnenuji Jan 31, 2024
e3f2ccc
Fix package download links
rushirajnenuji Jan 31, 2024
2cf8cdd
Fix More Info links
rushirajnenuji Jan 31, 2024
8779d70
Merge remote-tracking branch 'origin/develop' into feature-2079-file-…
rushirajnenuji Jan 31, 2024
ecfc83f
Minor CSS/layout tweaks to data package view
robyngit Feb 1, 2024
7f429cf
Fixed formatting
rushirajnenuji Feb 12, 2024
5003813
Update dataPackage fetch
rushirajnenuji Feb 12, 2024
8c71552
Add custom styling for DataONE theme in the Package table header
rushirajnenuji Feb 14, 2024
2b0183d
Fix issue with infinite spinners
rushirajnenuji Mar 19, 2024
2e40dff
Show error when dataPackage fetch failed
rushirajnenuji Mar 19, 2024
02b4d00
Merge remote-tracking branch 'origin/develop' into feature-2079-file-…
rushirajnenuji Mar 25, 2024
ee71cf7
Ran tests successfully on local environment
rushirajnenuji Mar 27, 2024
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
144 changes: 144 additions & 0 deletions src/css/metacatui-common.css
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,64 @@ text-shadow: none;
.data-tag-icon.crimson g{
fill: #800000;
}
/******************************************
** CatalogSearchView ***
******************************************/
.catalog-search-view .catalog-search-inner{
display: grid;
justify-content: stretch;
align-items: stretch;
grid-template-columns: auto 1fr 1fr;
}
.catalog-search-view .filter-groups-container {
width: 215px;
padding: var(--pad)
}
.catalog-search-view .search-results-container,
.catalog-search-view .map-container {
}
.catalog-search-body.mapMode{
height: 100vh;
width: 100vw;
padding-bottom: 0px;
display: grid;
align-items: stretch;
justify-content: stretch;
overflow: hidden;
}
.catalog-search-body.mapMode #Content{
padding: 40px 0px 0px 0px;
}
.catalog-search-body.mapMode .search-results-view .result-row:last-child{
margin-bottom: 100px;
}
.catalog-search-body.mapMode .search-results-view {
overflow-y: scroll;
height: 100vh;
padding-bottom: 200px; /* Leaving room for the last row to show */
padding-right: 15px; /* Padding for the scrollbar */
}
.catalog-search-body.mapMode .search-results-panel-container .map-toggle-container{
display: none;
}
.catalog-search-body.listMode .map-panel-container{
display: none;
}
.catalog-search-body.listMode .catalog-search-inner{
grid-template-columns: auto 1fr 0;
}
.catalog-search-view .cesium-widget-view {
width: inherit;
margin-left: 0;
}
.search-results-view .result-row{
padding: var(--pad);
}
.catalog-search-view .no-search-results{
padding: var(--pad);
text-align: center;
}

/******************************************
** Results and Result Rows ***
******************************************/
Expand Down Expand Up @@ -9038,4 +9096,90 @@ body > #extension-is-installed{
margin-left: 5px;
}

#data-package-table-head {
position: sticky;
top: 0;
z-index: 1;
}

#data-package-table-head > .file-header > th {
background-color: #FDFDFD;
border-bottom: 1px solid #E3E3E3;
height: 32px;
position: sticky;
top: 0;
z-index: -2;
}

#data-package-table-head > .file-header > th:not(:last-child) {
border-right: 1px solid #E3E3E3;
height: 30px;
}

#data-package-table-body > tr > td:first-child {
cursor: default;
}

.file-table-container {
height: max-content;
max-height: 25.4em;
overflow-y: scroll;
border: 1px solid #E3E3E3;
border-radius: 4px 4px 4px 4px;
}

.file-table-container::-webkit-scrollbar {
-webkit-appearance: none;
width: 10px;
}

.file-table-container::-webkit-scrollbar-thumb {
border-radius: 5px;
background-color: rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}

.btn.btn-rounded.action {
border-radius: 50%;
height: 15px;
width: 15px;
}

.btn.btn-rounded.action.downloadAction{
border: none;
}
.btn.btn-rounded.action.downloadAction > i{
margin-left: -4px;
}
.data-package-item {
height: 38px;
}

.data-package-file-table > .data-package-item > .file-actions > .action
.btn, .btn-primary,
.btn-large, .btn-small,
.btn-mini {
font-weight: 400;
background-image: none;
background-repeat: no-repeat;
background-color: transparent;
border: 1px solid #146660;
text-shadow: none;
box-shadow: none;
color: #146660;
padding: .5em;
}

.data-package-file-table > .data-package-item > .file-actions > .action
.btn:hover, .btn:focus,
.header .nav li .btn:hover, .header nav li .btn:focus{
background-color: #146660;
color: #FFF;
border: 0px;
box-shadow: none;
border: 1px solid #146660;
}

.data-package-file-table div.tooltip{
text-wrap: wrap;
}
33 changes: 32 additions & 1 deletion src/js/collections/DataPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,21 @@ define(['jquery', 'underscore', 'backbone', 'rdflib', "uuid", "md5",
ORE = this.rdf.Namespace(this.namespaces.ORE),
DCTERMS = this.rdf.Namespace(this.namespaces.DCTERMS),
CITO = this.rdf.Namespace(this.namespaces.CITO),
PROV = this.rdf.Namespace(this.namespaces.PROV),
XSD = this.rdf.Namespace(this.namespaces.XSD);

var memberStatements = [],
atLocationStatements = [],
memberURIParts,
memberPIDStr,
memberPID,
memberPIDs = [],
memberModel,
documentsStatements,
objectParts,
objectPIDStr,
objectPID,
objectAtLocationValue,
scimetaID, // documentor
scidataID, // documentee
models = []; // the models returned by parse()
Expand Down Expand Up @@ -569,6 +575,23 @@ define(['jquery', 'underscore', 'backbone', 'rdflib', "uuid", "md5",
//Save the list of science metadata pids
this.sciMetaPids = sciMetaPids;

// Parse atLocation
var atLocationObject = {};
atLocationStatements = this.dataPackageGraph.statementsMatching(
undefined, PROV("atLocation"), undefined, undefined);

// Get system metadata for each member to eval the formatId
_.each(atLocationStatements, function(atLocationStatement){
objectParts = atLocationStatement.subject.value.split("/");
objectPIDStr = _.last(objectParts);
objectPID = decodeURIComponent(objectPIDStr);
objectAtLocationValue = atLocationStatement.object.value;

atLocationObject[objectPID] = objectAtLocationValue;
}, this);

this.atLocationObject = atLocationObject;

//Put the science metadata pids first
memberPIDs = _.difference(memberPIDs, sciMetaPids);
_.each(_.uniq(sciMetaPids), function(id){ memberPIDs.unshift(id); });
Expand Down Expand Up @@ -1730,8 +1753,11 @@ define(['jquery', 'underscore', 'backbone', 'rdflib', "uuid", "md5",
});

//If there are any models that are not synced yet, the collection is not complete
if( notSynced.length > 0 )
if( notSynced.length > 0 ) {
var view = this;
robyngit marked this conversation as resolved.
Show resolved Hide resolved
this.listenToOnce(notSynced[0], "sync", this.triggerComplete, notSynced[0]);
return;
}

//If the number of models in this collection does not equal the number of objects referenced in the RDF XML, the collection is not complete
if(this.originalMembers.length > this.length)
Expand Down Expand Up @@ -3122,6 +3148,11 @@ define(['jquery', 'underscore', 'backbone', 'rdflib', "uuid", "md5",
}
});
}
},


getAtLocation: function() {
return this.atLocationObject;
}
});

Expand Down
47 changes: 28 additions & 19 deletions src/js/models/AppModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ define(['jquery', 'underscore', 'backbone'],
* DataCatalog). This can be set to either "google" (the default), or "cesium". To
* use Google maps, the {@link AppConfig#googleAnalyticsKey} must be set. To use
* Cesium maps, the {@link AppConfig#enableCesium} property must be set to true, and
* the {@link AppConfig#cesiumToken} must be set. DEPRECATION NOTE: This configuration
* the {@link AppConfig#cesiumToken} must be set. DEPRECATION NOTE: This configuration
* is deprecated along with the {@link DataCatalogView} and {@link DataCatalogViewWithFilters}
* views and Google Maps. The {@link CatalogSearchView} will replace these as the primary search view and will only
* support Cesium, not Google Maps.
Expand All @@ -103,14 +103,23 @@ define(['jquery', 'underscore', 'backbone'],
dataCatalogMap: "google",

/**
* The default options for the Cesium map used in the
* {@link CatalogSearchView} for searching the data catalog. Add custom
* layers, a default home position (for example, zoom into your area of
* research), and enable/disable map widgets. See {@link MapConfig} for
* the full suite of options. Use any satellite imagery layer of your
* choice, such as a self-hosted imagery layer or hosted on Cesium Ion. If
* no layer of type `CesiumGeohash` is included, a geohash layer will be
* added automatically in order to show the search results on the map.
* Set this option to true to display the filtering button for data package table
* @type {boolean}
*/
dataPackageFiltering: false,

/**
* Set this option to true to display the sorting button for data package table
* @type {boolean}
*/
dataPackageSorting: false,

/**
* The default options for the Cesium map used in the {@link CatalogSearchView} for searching the data
* catalog. Add custom layers, a default home position (for example, zoom into your area of research),
* and enable/disable map widgets. See {@link MapConfig} for the full suite of options. Keep the `CesiumGeohash`
* layer here in order to show the search results in the map as geohash boxes. Use any satellite imagery
* layer of your choice, such as a self-hosted imagery layer or hosted on Cesium Ion.
* @type {MapConfig}
* @since 2.22.0
*/
Expand Down Expand Up @@ -359,25 +368,25 @@ define(['jquery', 'underscore', 'backbone'],
contact: true
},

/**
* A list of required fields for each EMLParty (People) in the dataset editor.
/**
* A list of required fields for each EMLParty (People) in the dataset editor.
* This is a literal object where the keys are the EML Party type (e.g. creator, principalInvestigator) {@link see EMLParty.partytypes}
* and the values are arrays of field names.
* By default, EMLPartys are *always* required to have an individual's name, position name, or organization name.
* @type {object}
* @since 2.21.0
* @example
* @example
* {
* contact: ["email"],
* creator: ["email", "address", "phone"]
* principalInvestigator: ["organizationName"]
* }
* @default
* @default
* {
* }
*/
emlEditorRequiredFields_EMLParty: {

},

/**
Expand Down Expand Up @@ -511,7 +520,7 @@ define(['jquery', 'underscore', 'backbone'],
* @since 2.19.0
*/
customEMLMethods: [],

/**
* Configuration options for a drop down list of taxa.
* @typedef {object} AppConfig#quickAddTaxaList
Expand Down Expand Up @@ -1679,14 +1688,14 @@ define(['jquery', 'underscore', 'backbone'],
* @since 2.17.0
*/
queryIdentifierFields: ["id", "identifier", "seriesId", "isPartOf"],

/**
* The name of the query fields that specify latitude. Filter models that these
* fields are handled specially, since they must be a float value and have a
* pre-determined minRange and maxRange (-90 to 90).
*/
queryLatitudeFields: ["northBoundCoord", "southBoundCoord"],

/**
* The name of the query fields that specify longitude. Filter models that these
* fields are handled specially, since they must be a float value and have a
Expand Down Expand Up @@ -1802,8 +1811,8 @@ define(['jquery', 'underscore', 'backbone'],
}
],

/**
* The document fields to return when conducting a search. This is the list of fields returned by the main catalog search view.
/**
* The document fields to return when conducting a search. This is the list of fields returned by the main catalog search view.
* @type {string[]}
* @since 2.22.0
* @example ["id", "title", "obsoletedBy"]
Expand Down
Loading