Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a02828b
add hover functionality for metadata name to display both human name …
Oct 27, 2025
7db2d89
added hovercontent for human and raw names in condition dialog & plac…
Oct 29, 2025
4b3754d
small fixes
Oct 29, 2025
30a9538
changed hovercontents header name
Oct 29, 2025
01e23e9
eslint fix
Oct 29, 2025
09e46f3
fixed failing e2e test
Oct 29, 2025
beb2592
removed unnecessary ellipsis and fixed a double horizontal scroll bug
Oct 29, 2025
8805a81
some adjustments for better UI and code consistencies
Junjiequan Oct 31, 2025
a50f609
changed to use theme color
Nov 3, 2025
359952a
can now search metadata keys by human name & added cypress tests
Nov 3, 2025
72dc9e5
improved UI of scientific condition
Nov 5, 2025
a097192
eslint & cypress fix
Nov 5, 2025
da878db
Merge branch 'master' into metadata_name_hoverContent
abdimo101 Nov 5, 2025
44cda69
fixed condition chip display bug
Nov 5, 2025
5cd65c2
fixed condition chip display bug
Nov 5, 2025
acccd23
issues fixed
Nov 9, 2025
ce7ae0d
metadata type and human name are now stored in user setting
Nov 10, 2025
4eb01a5
created cypress tests for the datasets filter issues
Nov 10, 2025
3f62c69
eslint fix
Nov 10, 2025
030035e
Merge branch 'master' into metadata_name_hoverContent
abdimo101 Nov 10, 2025
f242718
removed mapping human names from datasets and metadata keys are now i…
Nov 12, 2025
60877a1
Merge branch 'metadata_name_hoverContent' of github.com:SciCatProject…
Nov 12, 2025
9a3db42
Merge branch 'master' into metadata_name_hoverContent
abdimo101 Nov 12, 2025
6ec7370
skipped a test and added a comment telling the reason why
Nov 12, 2025
bca820a
Merge branch 'metadata_name_hoverContent' of github.com:SciCatProject…
Nov 12, 2025
016c2b7
Merge branch 'master' into metadata_name_hoverContent
abdimo101 Nov 24, 2025
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
157 changes: 154 additions & 3 deletions cypress/e2e/datasets/datasets-general.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ describe("Datasets general", () => {
dataFileSize: "small",
scientificMetadata: {
extra_entry_end_time: { type: "number", value: 2, unit: "" },
temperature: {
type: "number",
value: 25,
unit: "celsius",
human_name: "Temperature Human Name",
},
test_number: { type: "number", value: 5, unit: "" },
test_string: { type: "string", value: "hello", unit: "" },
},
isPublished: true,
});
Expand Down Expand Up @@ -157,7 +165,7 @@ describe("Datasets general", () => {
cy.get("mat-dialog-container").find('button[type="submit"]').click();

cy.get(".snackbar-warning")
.should("contain", "Field already used")
.should("contain", "Please select a valid field from the list")
.contains("Close")
.click();
});
Expand Down Expand Up @@ -213,6 +221,150 @@ describe("Datasets general", () => {
.find(".condition-panel")
.should("have.length", 0);
});
// skipping for now but will be relevant when we can fetch human-readable names from metadataKeys endpoint in the future
it.skip("should search by human name", () => {
cy.visit("/datasets");

cy.get('[data-cy="scientific-condition-filter-list"]').within(() => {
cy.get('[data-cy="add-condition-button"]').click();
});

cy.get('input[name="lhs"]').type("Temperature Human Name");

cy.get("mat-dialog-container").find('button[type="submit"]').click();

cy.get(".condition-panel").first().click();

cy.get('[data-cy="remove-condition-button"]').click();
});

it("should search by metadata name", () => {
cy.visit("/datasets");

cy.get('[data-cy="scientific-condition-filter-list"]').within(() => {
cy.get('[data-cy="add-condition-button"]').click();
});

cy.get('input[name="lhs"]').type("temperature");

cy.get("mat-dialog-container").find('button[type="submit"]').click();

cy.get(".condition-panel").first().click();

cy.get('[data-cy="remove-condition-button"]').click();
});

it("should not be able to add invalid field", () => {
cy.visit("/datasets");

cy.get('[data-cy="scientific-condition-filter-list"]').within(() => {
cy.get('[data-cy="add-condition-button"]').click();
});

cy.get('input[name="lhs"]').type("invalid_field_name");

cy.get("mat-dialog-container").find('button[type="submit"]').click();

cy.get(".snackbar-warning")
.should("contain", "Please select a valid field from the list")
.contains("Close")
.click();
});

it("should display equal sign in condition preview", () => {
cy.visit("/datasets");

cy.get('[data-cy="scientific-condition-filter-list"]').within(() => {
cy.get('[data-cy="add-condition-button"]').click();
});

cy.get('input[name="lhs"]').type("test_number");

cy.get("mat-dialog-container").find('button[type="submit"]').click();

cy.get(".condition-panel").first().click();

cy.get(".condition-panel")
.first()
.within(() => {
cy.get("mat-select").click();
});

cy.get("mat-option").contains("is equal to").click();

cy.get(".condition-panel")
.first()
.within(() => {
cy.get("input[matInput]").eq(0).clear().type("5");
});

cy.get(".condition-panel")
.first()
.find("mat-panel-title")
.should("contain", "=")
.and("contain", "5");

cy.get('[data-cy="remove-condition-button"]').click();
});

it("should display range values correctly when switching from equal to", () => {
cy.visit("/datasets");

cy.get('[data-cy="scientific-condition-filter-list"]').within(() => {
cy.get('[data-cy="add-condition-button"]').click();
});

cy.get('input[name="lhs"]').type("test_number");

cy.get("mat-dialog-container").find('button[type="submit"]').click();

cy.get(".condition-panel").first().click();

cy.get(".condition-panel")
.first()
.within(() => {
cy.get("mat-select").click();
});

cy.get("mat-option").contains("is equal to").click();

cy.get(".condition-panel")
.first()
.within(() => {
cy.get("input[matInput]").eq(0).clear().type("abcdefgh");
});

cy.get(".condition-panel")
.first()
.within(() => {
cy.get("mat-select").click();
});

cy.get("mat-option").contains("is in range").click();

cy.get(".condition-panel")
.first()
.within(() => {
cy.get("input[matInput]").eq(0).clear().type("6");
cy.get("input[matInput]").eq(1).clear().type("10");
});

// Verify that condition does not show all dataset when wrong range is given

cy.get(".condition-panel")
.first()
.find("mat-panel-title")
.should("contain", "6")
.and("contain", "<->")
.and("contain", "10");

cy.get('[data-cy="filter-search-button"]').click();

cy.get(".dataset-table mat-table").should("exist");


cy.get('[data-cy="remove-condition-button"]').click();
});
});

describe("Units options in condition panel units dropdown", () => {
Expand Down Expand Up @@ -433,7 +585,6 @@ describe("Datasets general", () => {
cy.visit("/datasets");
});
it("should be able to add condition with scientific notation value", () => {

cy.get('[data-cy="scientific-condition-filter-list"]').within(() => {
cy.get('[data-cy="add-condition-button"]').click();
});
Expand Down Expand Up @@ -464,5 +615,5 @@ describe("Datasets general", () => {

cy.get('[data-cy="remove-condition-button"]').click();
});
})
});
});
5 changes: 1 addition & 4 deletions cypress/e2e/datasets/datasets-metadata.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,6 @@ describe("Datasets", () => {
cy.get('[role="menu"] button')
.contains("Column setting")
.click({ force: true });
cy.get('[role="menu"]')
.contains("Raw property name")
.click({ force: true });
cy.get('[role="menu"]').contains("Type").click({ force: true });

cy.get('[role="menu"] .column-config-apply .done-setting')
Expand All @@ -753,7 +750,7 @@ describe("Datasets", () => {

cy.contains(
"dynamic-mat-table mat-header-row.header",
"Raw property name",
"Name",
);
cy.contains("dynamic-mat-table mat-header-row.header", "Type");
cy.contains("dynamic-mat-table mat-row", metadata.name);
Expand Down
72 changes: 69 additions & 3 deletions src/app/datasets/datasets-filter/datasets-filter.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,80 @@
<mat-panel-title>
<div class="condition-title-section">
<div class="condition-field-name">
{{ getHumanName(conditionConfig.condition.lhs) }}
<mat-icon
class="cell-icon"
fontIcon="description"
#hoverOriginSpan="cdkOverlayOrigin"
cdkOverlayOrigin
(mouseenter)="hoverKey = conditionConfig.condition.lhs"
(mouseleave)="hoverKey = null"
></mat-icon>
<div class="field-name-wrapper">
<ng-container
*ngIf="
getHumanName(conditionConfig.condition.lhs);
else rawNameOnlyHeader
"
>
<div class="primary-name">
{{ getHumanName(conditionConfig.condition.lhs) }}
</div>
<div
class="secondary-name"
*ngIf="humanNameMap[conditionConfig.condition.lhs]"
>
{{ conditionConfig.condition.lhs }}
</div>
</ng-container>
<ng-template #rawNameOnlyHeader>
<div class="primary-name" style="font-style: italic;">
{{ conditionConfig.condition.lhs }}
</div>
</ng-template>
</div>

<!-- Hover overlay -->
<ng-template
cdkConnectedOverlay
[cdkConnectedOverlayOrigin]="hoverOriginSpan"
[cdkConnectedOverlayOpen]="
hoverKey === conditionConfig.condition.lhs
"
[cdkConnectedOverlayPositions]="overlayPositions"
>
<mat-card class="hover-card">
<mat-card-title class="hover-card-title">
Name Details
</mat-card-title>
<div mat-card-content class="hover-card-content">
<ng-container
*ngIf="
getHumanName(conditionConfig.condition.lhs);
else rawNameOnly
"
>
<strong>Human readable name: </strong>
{{ getHumanName(conditionConfig.condition.lhs) }}
<br />
<strong>Metadata key:</strong>
{{ conditionConfig.condition.lhs }}
</ng-container>
</div>
<ng-template #rawNameOnly>
<strong>Metadata key: </strong><span style="font-style: italic;">{{ conditionConfig.condition.lhs }}</span>
</ng-template>
</mat-card>
</ng-template>
</div>
<div class="condition-description">
{{ getConditionDisplayText(conditionConfig.condition) }}
<span class="condition-chip">{{
getConditionDisplayText(conditionConfig.condition, i)
}}</span>
</div>
</div>
</mat-panel-title>
<mat-panel-description>
{{ getConditionDisplayText(conditionConfig.condition) }}
{{ getConditionDisplayText(conditionConfig.condition, i) }}
</mat-panel-description>
</mat-expansion-panel-header>

Expand Down Expand Up @@ -287,6 +352,7 @@
class="datasets-filters-search-button"
data-cy="filter-search-button"
(click)="applyFilters()"
data-cy="filter-search-button"
>
<mat-icon>search</mat-icon>
Apply
Expand Down
Loading
Loading