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

Qa #1805

Merged
merged 55 commits into from
Mar 13, 2024
Merged

Qa #1805

Changes from 53 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
06a2c38
Change ElasticSearch query to be "query_string" based
ommann Sep 18, 2023
3f4f338
Add URL search query parameters. Use search query as source of truth.
ommann Sep 28, 2023
69d0c77
Add better aggregation that can calculate filters additive and subtra…
ommann Oct 3, 2023
fc8fd9d
Add incomplete organization filter
ommann Oct 5, 2023
a1aeedb
Get organization names separately
ommann Oct 12, 2023
b72e64a
Merge remote-tracking branch 'origin/devel' into search-pages-2
ommann Oct 17, 2023
dbdd8f6
Add inputs for pagination
ommann Oct 18, 2023
aca10c6
Add total count to the new search. Improve the presentation of the ne…
ommann Oct 25, 2023
7fe7b0a
Improve the presentation of the search. Add Playwright.
ommann Nov 7, 2023
fa7321d
Merge remote-tracking branch 'origin/master' into search-pages-2
ommann Nov 7, 2023
0065683
Add publicationFormat and publicationAudience filters
ommann Nov 15, 2023
12679ae
New filters: publicationType, international, articleType, jufo
ommann Nov 22, 2023
4fa8b8f
Create collapsible parent for filters, adjust colors
ommann Nov 28, 2023
48fd341
Add show more and less buttons. Fix language filter to have all langu…
ommann Nov 30, 2023
7203232
Add summary of the filters to the top of the search page
ommann Dec 7, 2023
669e4e4
Add fieldsOfScience and publicationTypeCode filters
ommann Dec 14, 2023
6e71a2a
Replacing strings with i18n enabled equivalent
ommann Jan 3, 2024
06564b7
Add secondary sorting based on publicationYear
ommann Jan 4, 2024
b980977
Add locale module for non-Angular code. Fix placeholders into i18n st…
ommann Jan 10, 2024
413771b
Adjust the presentation of side panel filters
ommann Jan 17, 2024
892ffd2
Create functions repeated search terms and add openAccess as filter
ommann Jan 17, 2024
aedb85a
Proof of concept without "global" aggregations
ommann Jan 22, 2024
1fd1521
Generalize the building of aggregation steps
ommann Jan 24, 2024
678f438
Fix the tooltips in openAccess type filters
ommann Feb 5, 2024
1a85389
Grid based layout and sortable columns
ommann Feb 6, 2024
0176ab0
Adjust breakpoints and add badges to the search listing
ommann Feb 8, 2024
385d355
Merge branch 'master' into search-pages-2
ommann Feb 12, 2024
f98dee5
Adjust grid cell heights and cell padding
ommann Feb 12, 2024
514bcd1
Fix translations for split open access filters
ommann Feb 13, 2024
8992038
Merge branch 'devel' into search-pages-2
ommann Feb 14, 2024
0b3e2af
Merge branch 'devel' into search-pages-2
ommann Feb 14, 2024
723b6be
Add modal that shows filters in mobile
ommann Feb 20, 2024
37ffe0e
Add banner for accessing the new publication search
ommann Feb 21, 2024
80ea39e
Fix organization, field of science filters and pagination
ommann Feb 23, 2024
1c768de
Add full width style to the table and some spacing to the filter mana…
ommann Feb 23, 2024
ce448dc
Update banner text to the new search
ommann Feb 26, 2024
9ddd66f
Hide placeholder select / button from search bar
ommann Feb 27, 2024
e0f4103
Add disabled "Show as a image" placeholder button
ommann Feb 27, 2024
156b730
Fix excess spacing under the results table
ommann Feb 27, 2024
8e5f134
Hide unknown or missing values from being filter values
ommann Feb 29, 2024
1c697c0
Add tutorial texts to new search
ommann Mar 4, 2024
96a6a4b
Fix i18n texts
ommann Mar 4, 2024
3fdc12f
Fix invalid sorting parameters
ommann Mar 6, 2024
3f4019b
Fix the unnecessary splitting of keywords
ommann Mar 7, 2024
c93926b
Escape the last quotation mark when uneven number
ommann Mar 7, 2024
720c544
Fix layout by removing grid cells
ommann Mar 11, 2024
2fef024
Adjust highlight generation to include more of the original data
ommann Mar 11, 2024
184f234
Changing search parameters also resets page to 1
ommann Mar 12, 2024
a67d5dc
Fix summary not counting all filters. Search bar searches from enter.
ommann Mar 12, 2024
0042856
Remove filters from narrow display, rely on alternative filters
ommann Mar 13, 2024
0202dd9
Improve the responsiveness of the new search
ommann Mar 13, 2024
3ae23b6
Remove accidentally generated tests
ommann Mar 13, 2024
1f01735
Merge pull request #1803 from CSCfi/search-pages-2
ommann Mar 13, 2024
00c3c2d
Merge branch 'qa' into devel
ommann Mar 13, 2024
88ceaf5
Merge pull request #1804 from CSCfi/devel
ommann Mar 13, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -53,3 +53,6 @@ src/environments/environment.researchfi.ts
src/environments/environment.researchfi.prod.ts
src/assets/config/config.json
src/assets/config/auth_config.json
/test-results/
/playwright-report/
/playwright/.cache/
12 changes: 12 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -92,11 +92,23 @@
"en": {
"localize": [
"en"
],
"fileReplacements": [
{
"replace": "src/environments/locale.ts",
"with": "src/environments/locale.en.ts"
}
]
},
"sv": {
"localize": [
"sv"
],
"fileReplacements": [
{
"replace": "src/environments/locale.ts",
"with": "src/environments/locale.sv.ts"
}
]
},
"es5": {
858 changes: 636 additions & 222 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@
"mississippi": "^4.0.0",
"ngx-bootstrap": "^9.0.0",
"ngx-countup": "^13.0.0",
"ngx-pipes": "^3.2.2",
"nodemailer": "^6.7.8",
"popper.js": "^1.16.0",
"referrer-policy": "^1.2.0",
@@ -81,6 +82,7 @@
"through2": "^4.0.2",
"timers": "^0.1.1",
"tslib": "^2.1.0",
"valibot": "^0.17.0",
"zone.js": "~0.11.8"
},
"devDependencies": {
@@ -98,6 +100,7 @@
"@babel/preset-env": "^7.16.11",
"@fortawesome/fontawesome-free": "^6.0.0",
"@ngx-i18nsupport/ngx-i18nsupport": "^1.1.6",
"@playwright/test": "^1.39.0",
"@types/d3": "^7.1.0",
"@types/express": "^4.17.11",
"@types/jasmine": "~3.6.6",
77 changes: 77 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
37 changes: 37 additions & 0 deletions src/app/portal/components/collapsible/collapsible.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<ng-template #tooltipElement>
<div>
<ng-content select="[tooltip]"></ng-content>
</div>
</ng-template>

<div class="collapsible-container">
<div class='collapsible-label' (click)="toggle()">
<div style='display: flex; flex-wrap: wrap'>
<ng-container *ngIf='decoration === "plus" && isOpen'>
<div style='margin-right: 10px'>-</div>
</ng-container>

<ng-container *ngIf='decoration === "plus" && !isOpen'>
<div style='margin-right: 10px'>+</div>
</ng-container>

<div>
{{label}}

<ng-container *ngIf='hasTooltip'>
<div style='display: inline-block; margin-left: 10px; color: rgb(69, 70, 185)'>
<i class="fa fa-info-circle" [tooltip]='tooltipElement'></i>
</div>
</ng-container>
</div>
</div>

<span>
<i style='margin: 0 4px' class="fa fa-chevron-down" [ngClass]='{"icon-collapsed": !isOpen, "icon-expanded": isOpen}'></i>
</span>
</div>

<div [@expandCollapse]="isOpen ? 'expanded' : 'collapsed'">
<ng-content></ng-content>
</div>
</div>
39 changes: 39 additions & 0 deletions src/app/portal/components/collapsible/collapsible.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.collapsible-container {
background-color: rgb(247, 247, 251);
}

.collapsible-label {
font-size: 1.1rem;
font-weight: bolder;

padding: 11px 16px;
border-radius: 4px;

user-select: none;
cursor: pointer;

display: flex;
justify-content: space-between;
}

.icon-collapsed {
transition: transform 0.25s linear;
transform: rotate(0deg);
}

.icon-expanded {
transition: transform 0.25s ease-out;
transform: rotate(180deg);
}

.collapsible-content {
transition: max-height 0.4s ease-out;
overflow: hidden;

max-height: 1000px;
}

.collapsed {
// transition: 0.2s linear;
max-height: 0;
}
39 changes: 39 additions & 0 deletions src/app/portal/components/collapsible/collapsible.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { NgClass, NgIf } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { TooltipModule } from 'ngx-bootstrap/tooltip';

@Component({
selector: 'app-collapsible',
templateUrl: './collapsible.component.html',
styleUrls: ['./collapsible.component.scss'],
imports: [
NgIf,
MatIconModule,
NgClass,
TooltipModule
],
standalone: true,
animations: [
trigger('expandCollapse', [
state('collapsed', style({ height: '0px', overflow: 'hidden' })),
state('expanded', style({ height: '*', overflow: 'hidden' })),
transition('expanded <=> collapsed', animate('0.1s ease-out'))
])
]
})
export class CollapsibleComponent {
@Input() label = '';
@Input() decoration = "none";

@Input() isOpen = false;
@Output() isOpenChange = new EventEmitter<boolean>();

@Input() hasTooltip = false;

toggle() {
this.isOpen = !this.isOpen;
this.isOpenChange.emit(this.isOpen);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ng-template #buttonContent>
<ng-content></ng-content>
</ng-template>

<ng-container *ngIf="step > 0">
<button class='limit-button' mat-button [disabled]='value >= max' (click)='valueChange.emit(clamp(value + step))'>
<ng-container *ngTemplateOutlet="buttonContent"></ng-container>
</button>
</ng-container>

<ng-container *ngIf="step < 0">
<button class='limit-button' mat-button [disabled]='value <= min' (click)='valueChange.emit(clamp(value + step))'>
<ng-container *ngTemplateOutlet="buttonContent"></ng-container>
</button>
</ng-container>

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.limit-button {
height: 3rem;
}

.limit-button:enabled {
color: #4546b9;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { FilterLimitButtonComponent } from './filter-limit-button.component';

describe('FilterLimitButtonComponent', () => {
let component: FilterLimitButtonComponent;
let fixture: ComponentFixture<FilterLimitButtonComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ FilterLimitButtonComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(FilterLimitButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatButtonModule } from '@angular/material/button';

@Component({
selector: 'app-filter-limit-button',
standalone: true,
imports: [CommonModule, MatButtonModule],
templateUrl: './filter-limit-button.component.html',
styleUrls: ['./filter-limit-button.component.scss']
})
export class FilterLimitButtonComponent {
@Input() value = 0;
@Output() valueChange = new EventEmitter<number>();

@Input() step = 0;
@Input() min = 0;
@Input() max = 0;

clamp(value: number) {
return Math.min(Math.max(value, this.min), this.max);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class='filter-option-layout focus-me' (click)='toggleValue()' matRipple tabindex='0'>
<div style='display: flex; justify-content: center; align-items: center'>

<!-- Position mat-checkbox to appear vertically and horizontally centered using pixels -->
<div style='width: 24px; height: 20px; margin: 5px 20px 5px 2px; position: relative'>
<mat-checkbox style='position: absolute; top: -5px; left: 2px; width: 10px; height: 10px' [ngModel]='value'></mat-checkbox>
</div>

</div>

<div style='display: flex; flex-grow: 1; justify-content: space-between'>
<div style='display: flex; justify-content: center; font-size: 1.1rem;'>
{{label}}
</div>

<div style='display: flex; justify-content: center; align-items: center; font-size: 14px; color: grey'>
{{count}}
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.label-text {
text-overflow: ellipsis;
flex-shrink: 1;
}

.filter-option-layout {
display: flex;
justify-content: center;
align-items: center;

// padding: 16px 12px;
padding: 8px;

cursor: pointer;
user-select: none;

&:hover {
background-color: rgba(0, 0, 0, 0.04);
}
}
28 changes: 28 additions & 0 deletions src/app/portal/components/filter-option/filter-option.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatRippleModule } from '@angular/material/core';
import { MatCheckboxModule } from '@angular/material/checkbox';

@Component({
selector: 'app-filter-option',
templateUrl: './filter-option.component.html',
styleUrls: ['./filter-option.component.scss'],
imports: [
FormsModule,
MatRippleModule,
MatCheckboxModule
],
standalone: true
})
export class FilterOptionComponent {
@Input() label = "";
@Input() count = 0;

@Input() value: boolean = false;
@Output() valueChange = new EventEmitter<boolean>();

toggleValue() {
this.value = !this.value;
this.valueChange.emit(this.value);
}
}
Loading