Skip to content

Commit

Permalink
Merge pull request #483 from hubmapconsortium/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
axdanbol authored Jun 21, 2024
2 parents 9dce99f + 4d0b5d6 commit fea9949
Show file tree
Hide file tree
Showing 42 changed files with 874 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
&.visible {
border-width: 1px;
padding: 2rem;
width: 47.5rem;
width: 56.5rem;
height: 40rem;
transition: all 0.2s ease-in-out 0s;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class FiltersPopoverComponent {
if (!this.filtersVisible) {
return '0rem';
} else {
return `${this.spatialSearchFilters.length > 0 ? 43 + this.spatialSearchFilters.length * 3 : 40}rem`;
return `${this.spatialSearchFilters.length > 0 ? 44 + this.spatialSearchFilters.length * 3 : 41}rem`;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<mat-button-toggle-group class="toggleGroup" name="menuOptions" aria-label="menuOptions" multiple appearance="standard">
<mat-button-toggle-group
class="toggleGroup"
name="menuOptions"
aria-label="menuOptions"
appearance="standard"
multiple
hideMultipleSelectionIndicator
>
<mat-button-toggle
[class.button-selected]="isItemSelected(item)"
*ngFor="let item of menuOptions; let i = index"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

&.three {
.option {
width: 14.375rem;
width: 16.375rem;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
disableRipple="true"
hideSingleSelectionIndicator="true"
>
<mat-option *ngFor="let option of options" [value]="option">
<div class="{{ optionsVisible }}">
{{ option }}
</div>
</mat-option>
@for (option of options; track option) {
<mat-option [value]="option">
<div class="{{ optionsVisible }}">
{{ option }}
</div>
</mat-option>
}
</mat-select>
</mat-form-field>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('DropdownComponent', () => {
it('should provide the current value to mat-select', async () => {
const { findComponent } = await shallow.render({ bind: { selection: 'one' } });
const matSelect = findComponent(MatSelect);
expect(matSelect.value).toBe('one');
expect(matSelect.value).toBe('One');
});

it('should open options if clicked', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
EventEmitter,
Input,
OnChanges,
Output,
SimpleChanges,
} from '@angular/core';
import { GoogleAnalyticsService } from 'ngx-google-analytics';

/**
Expand All @@ -10,7 +18,7 @@ import { GoogleAnalyticsService } from 'ngx-google-analytics';
styleUrls: ['./dropdown.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DropdownComponent {
export class DropdownComponent implements OnChanges {
/**
* What the component is selecting for.
*/
Expand Down Expand Up @@ -43,6 +51,12 @@ export class DropdownComponent {
*/
constructor(private readonly ga: GoogleAnalyticsService) {}

ngOnChanges(changes: SimpleChanges) {
if ('selection' in changes) {
this.selectionChanged(this.selection.replace(/^./, this.selection[0].toUpperCase()));
}
}

/**
* Controls fade-in effect after dropdown menu opens
*/
Expand Down
10 changes: 10 additions & 0 deletions apps/cde-visualization-wc-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
}
]
}
7 changes: 7 additions & 0 deletions apps/cde-visualization-wc-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';

import { defineConfig } from 'cypress';

export default defineConfig({
e2e: { ...nxE2EPreset(__filename, { cypressDir: 'src' }), baseUrl: 'http://localhost:4200' },
});
29 changes: 29 additions & 0 deletions apps/cde-visualization-wc-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "cde-visualization-wc-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/cde-visualization-wc-e2e/src",
"tags": [],
"implicitDependencies": ["cde-visualization-wc"],
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/cde-visualization-wc-e2e/cypress.config.ts",
"testingType": "e2e",
"devServerTarget": "cde-visualization-wc:serve:development"
},
"configurations": {
"production": {
"devServerTarget": "cde-visualization-wc:serve:production"
},
"ci": {
"devServerTarget": "cde-visualization-wc:serve-static"
}
}
},
"lint": {
"executor": "@nx/eslint:lint"
}
}
}
13 changes: 13 additions & 0 deletions apps/cde-visualization-wc-e2e/src/e2e/app.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getGreeting } from '../support/app.po';

describe('cde-visualization-wc-e2e', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
// Custom command example, see `../support/commands.ts` file
cy.login('my-email@something.com', 'myPassword');

// Function helper example, see `../support/app.po.ts` file
getGreeting().contains(/Welcome/);
});
});
5 changes: 5 additions & 0 deletions apps/cde-visualization-wc-e2e/src/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
1 change: 1 addition & 0 deletions apps/cde-visualization-wc-e2e/src/support/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const getGreeting = () => cy.get('h1');
35 changes: 35 additions & 0 deletions apps/cde-visualization-wc-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/// <reference types="cypress" />

// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************

// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
login(email: string, password: string): void;
}
}

// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
});
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions apps/cde-visualization-wc-e2e/src/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.ts using ES2015 syntax:
import './commands';
17 changes: 17 additions & 0 deletions apps/cde-visualization-wc-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["cypress", "node"],
"sourceMap": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"include": ["**/*.ts", "**/*.js", "cypress.config.ts", "**/*.cy.ts", "**/*.cy.js", "**/*.d.ts"]
}
33 changes: 33 additions & 0 deletions apps/cde-visualization-wc/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "cde",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "cde",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
}
22 changes: 22 additions & 0 deletions apps/cde-visualization-wc/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'cde-visualization-wc',
preset: '../../jest.preset.cjs',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/apps/cde-visualization-wc',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
Loading

0 comments on commit fea9949

Please sign in to comment.