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

Cde design system #773

Open
wants to merge 22 commits into
base: cde-mvp2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
017a8c3
Merge branch 'cde-mvp2' of https://github.com/hubmapconsortium/hra-ui…
edlu77 Oct 2, 2024
e39172d
Use design system for cde-visualization
edlu77 Oct 3, 2024
b951a66
Update landing page to use design system
edlu77 Oct 6, 2024
58bc2c9
More style updates for tooltips and visualization page
edlu77 Oct 6, 2024
563a4a3
Change violin vis size
edlu77 Oct 8, 2024
7e516af
Fix build issue
edlu77 Oct 8, 2024
1777db0
Merge branch 'cde-mvp2' of https://github.com/hubmapconsortium/hra-ui…
edlu77 Oct 16, 2024
e77e6ae
Update testing
edlu77 Oct 16, 2024
9b7f3f8
Merge branch 'cde-mvp2' of https://github.com/hubmapconsortium/hra-ui…
edlu77 Oct 18, 2024
4864fd5
Tweaks
edlu77 Oct 18, 2024
0117c1d
Merge branch 'cde-mvp2' of https://github.com/hubmapconsortium/hra-ui…
edlu77 Oct 18, 2024
07f52f1
Use error indicator component in design system
edlu77 Oct 18, 2024
cd69c85
Add delete file button to design system and cde
edlu77 Oct 18, 2024
147dc15
Remove export
edlu77 Oct 18, 2024
742226b
Fix bugs in file upload
edlu77 Oct 18, 2024
41ccd69
Add workflow card to design system and cde
edlu77 Oct 22, 2024
4d1c9f4
Add load progress bar to workflow cards
edlu77 Oct 23, 2024
0fa64bd
Remove commented out code
edlu77 Oct 23, 2024
15276b2
Improve progress bar
edlu77 Oct 23, 2024
02116c6
Merge branch 'cde-mvp2' of https://github.com/hubmapconsortium/hra-ui…
edlu77 Oct 24, 2024
2250b90
Merge branch 'cde-mvp2' of https://github.com/hubmapconsortium/hra-ui…
edlu77 Oct 24, 2024
c45e0f4
Merge branch 'design-system-workflow-card' into cde-design-system
edlu77 Oct 24, 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: 1 addition & 2 deletions apps/cde-ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, inject } from '@angular/core';
import { Router, RouterOutlet } from '@angular/router';

import { HeaderComponent } from './components/header/header.component';
import { ScreenSizeNoticeComponent } from './components/screen-size-notice/screen-size-notice.component';

/** Max width to show screen size notice */
Expand All @@ -14,7 +13,7 @@ export const SCREEN_SIZE_NOTICE_MAX_HEIGHT = 832;
*/
@Component({
standalone: true,
imports: [RouterOutlet, HeaderComponent],
imports: [RouterOutlet],
selector: 'cde-root',
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
@if (!file && actionNotification()) {
<h3 class="action-required">
<mat-icon class="alert">settings_alert</mat-icon>
{{ actionNotification() }}
</h3>
}

@if (!file && errorMessage()) {
<div class="error">
<mat-icon class="material-symbols-rounded alert">error</mat-icon>
<div class="error-messages">
<span class="message">{{ errorMessage() }}</span>
<span class="action">{{ errorActionMessage() }}</span>
</div>
</div>
<hra-error-indicator [errors]="[errorMessage(), errorActionMessage()]"></hra-error-indicator>
}

@if (file && !errorMessage()) {
<div class="upload-success">
<div class="filename">
<span class="column-info-list mat-body-2 file-name">{{ file ? file.name : '' }}</span>
</div>
<mat-icon class="material-symbols-rounded remove-file" (click)="cancelLoad()">delete</mat-icon>
</div>
<hra-delete-file-button [fileName]="file.name" (cancelLoad)="cancelLoad()"></hra-delete-file-button>
} @else {
<button mat-flat-button class="upload" (click)="fileInput.click()" hraPrimaryButton hraButtonSize="large">
Upload CSV
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,29 @@
:host {
.upload-success {
height: 2.5rem;
display: flex;
align-items: center;
padding: 0 1rem;
background: var(--sys-surface-container);
gap: 0.5rem;
border-radius: 1rem;
font: var(--sys-label-large);
// .upload-success {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented out code please

// height: 2.5rem;
// display: flex;
// align-items: center;
// padding: 0 1rem;
// background: var(--sys-surface-container);
// gap: 0.5rem;
// border-radius: 1rem;
// font: var(--sys-label-large);

.filename {
display: flex;
}
// .filename {
// display: flex;
// }

.file-name {
color: var(--sys-primary);
}
// .file-name {
// color: var(--sys-primary);
// }

.remove-file {
color: var(--sys-secondary);
cursor: pointer;
}
}

.error {
display: flex;
gap: 0.5rem;
margin-bottom: 2rem;
padding: 0.5rem 0.75rem;
border-radius: 0.25rem;
font: var(--sys-label-large);
width: fit-content;
// .remove-file {
// color: var(--sys-secondary);
// cursor: pointer;
// }
// }

.error-messages {
display: flex;
flex-direction: column;
}
}

.action-required {
display: flex;
align-items: center;
gap: 1rem;
hra-error-indicator {
margin-bottom: 2rem;
position: relative;
left: -3rem;

mat-icon {
width: 2rem;
height: 2rem;
font-size: 2rem;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { Injector, OutputEmitterRef, signal } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { render, screen } from '@testing-library/angular';
import { render } from '@testing-library/angular';

import { FileUploadComponent } from './file-upload.component';

describe('FileUploadComponent', () => {
const loader = jest.fn();
const mockFiles = {
0: {
name: 'nodes.csv',
type: 'text/csv',
} as File,
length: 1,
} as unknown as FileList;

beforeEach(() => {
loader.mockReturnValue({
Expand All @@ -21,29 +14,12 @@ describe('FileUploadComponent', () => {
});
});

it('should load', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the tests for file loading?

const {
fixture: { componentInstance: instance },
} = await render(FileUploadComponent, {
componentInputs: {
actionNotification: 'test',
accept: 'csv',
loader: loader,
options: {},
},
});

instance.load({ files: mockFiles } as HTMLInputElement);
expect(screen.getByText(/test/i)).toBeInTheDocument();
});

it('should cancel load', async () => {
const loadCancelled = jest.fn();
const {
fixture: { componentInstance: instance },
} = await render(FileUploadComponent, {
componentInputs: {
actionNotification: 'test',
accept: 'csv',
loader: loader,
options: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, inject, Injector, input, output, Type } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { FileLoader, FileLoaderEvent } from '@hra-ui/cde-visualization';
import { DeleteFileButtonComponent } from '@hra-ui/design-system/delete-file-button';
import { ButtonModule } from '@hra-ui/design-system/button';
import { ErrorIndicatorComponent } from '@hra-ui/design-system/error-indicator';
import { reduce, Subscription } from 'rxjs';

/**
Expand Down Expand Up @@ -34,19 +36,16 @@ export type FileLoadError = FileTypeError | FileParseError;
@Component({
selector: 'cde-file-upload',
standalone: true,
imports: [CommonModule, MatIconModule, ButtonModule],
imports: [CommonModule, MatIconModule, ButtonModule, ErrorIndicatorComponent, DeleteFileButtonComponent],
templateUrl: './file-upload.component.html',
styleUrl: './file-upload.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FileUploadComponent<T, OptionsT> {
/** Notification for action required */
readonly actionNotification = input<string>();

/** Upload error message */
readonly errorMessage = input<string>();
readonly errorMessage = input<string>('');
/** Upload error action message */
readonly errorActionMessage = input<string>();
readonly errorActionMessage = input<string>('');

/** Accepted file types */
readonly accept = input.required<string>();
Expand Down
16 changes: 0 additions & 16 deletions apps/cde-ui/src/app/components/header/header.component.html

This file was deleted.

123 changes: 0 additions & 123 deletions apps/cde-ui/src/app/components/header/header.component.scss

This file was deleted.

21 changes: 0 additions & 21 deletions apps/cde-ui/src/app/components/header/header.component.spec.ts

This file was deleted.

Loading
Loading