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

Rui update application r8 #832

Merged
merged 27 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
640a63a
Left sidebar changes
edlu77 Nov 19, 2024
e49d59b
Clean up left sidebar styles
edlu77 Nov 19, 2024
26e8cd6
Styling and removing old theming files
edlu77 Nov 20, 2024
aa76bac
Right side cosmetic changes
edlu77 Nov 22, 2024
03d1e7c
Update styles in Anatomical Structure Tags
edlu77 Nov 22, 2024
46783fa
Merge branch 'hra-r7-rui' of https://github.com/hubmapconsortium/hra-…
edlu77 Nov 22, 2024
8327529
Update usage tracking popup
edlu77 Nov 26, 2024
9664943
Remove obsolete styling files / components
edlu77 Nov 26, 2024
ea83540
Fix unwanted block movement during form inputs
edlu77 Nov 26, 2024
389f0d5
Update checkbox focus color
edlu77 Nov 26, 2024
183a166
Fix broken theming file in EUI
edlu77 Nov 27, 2024
c0b113d
Add updated rotation slider
edlu77 Nov 27, 2024
b10cd49
Add updated rotation slider
edlu77 Nov 27, 2024
af88bde
Rotation slider and keyboard-ui fixes
edlu77 Nov 27, 2024
5245b62
Merge branch 'rui-update-application-r7' of https://github.com/hubmap…
edlu77 Nov 27, 2024
77e6c0c
Fix
edlu77 Nov 27, 2024
8029328
Rotation slider updates
edlu77 Nov 30, 2024
b7e6a6f
Update opacity flyout
edlu77 Nov 30, 2024
dd210a7
Remove HostListener, other improvements
edlu77 Dec 6, 2024
3dcf370
Separate slider box into separate component
edlu77 Dec 6, 2024
1694f6e
Fix options in Tissue Block Settings
edlu77 Dec 6, 2024
d23f084
Add dividers to menus
edlu77 Dec 6, 2024
be785d0
Fix registration and help menu options
edlu77 Dec 7, 2024
ce7d95d
CSS fixes
edlu77 Dec 7, 2024
ba27ab0
Display block properly on initial load
edlu77 Dec 7, 2024
5a4f499
Merge branch 'hra-r7-rui' of https://github.com/hubmapconsortium/hra-…
edlu77 Dec 7, 2024
6fa38f7
Fix for visibility menu icons and opacity settings
edlu77 Dec 7, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ For detailed information, please refer to the documentation for each app.
- [CCF Body UI Web Component](./apps/ccf-body-ui-wc/README.md) - A web component used in Exploration User Interface.
- [Exploration User Interface](./apps/ccf-eui/README.md) - An interactive tool for exploring and validating spatially registered tissue blocks and cell-type populations.
- [CCF Organ Info](./apps/ccf-organ-info/README.md) - User Interface for Organ Information.
- [Registration User Interfce](./apps/ccf-rui/README.md) - An interactive tool for registering tissue blocks spatially and annotating them semantically using ASCT+B Table terms.
- [Registration User Interface](./apps/ccf-rui/README.md) - An interactive tool for registering tissue blocks spatially and annotating them semantically using ASCT+B Table terms.
- [Cell Distance Explorer](./apps/cde-ui/README.md) - Compute, visualize, and explore distance distributions between different cells, cell types, anatomical structures, and more.
- [Cell Distance Explorer Visualization Web Component](./apps/cde-visualization-wc/README.md) - A web component used in Cell Distance Explorer.
- [HRA Dashboards](./apps/dashboard-ui/README.md) - Explore usage statistics of atlas data and code.
Expand Down
3 changes: 0 additions & 3 deletions apps/ccf-eui/src/themes/common/_theming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
@use '../../app/shared/components/spatial-search-ui/spatial-search-ui.component.theme' as spatialSearchUi;
@use '../../app/shared/components/tissue-block-list/tissue-block-list.component.theme' as tissueBlockList;
@use '../../app/shared/components/term-occurence-list/term-occurrence.component.theme.scss' as termOccurrenceList;
@use '../../../../../libs/ccf-shared/src/lib//components/spatial-search-keyboard-ui/spatial-search-keyboard-ui.component.theme'
as spatialSearchKeyboardUi;
@use '../../app/shared/components/spinner-overlay/spinner-overlay.theme' as spinner;
@use '../../app/shared/components/thumbnail-carousel/thumbnail-carousel.theme' as thumbnailCarousel;
@use '../../app/modules/ontology-exploration/ontology-exploration.theme' as ontologyExploration;
Expand Down Expand Up @@ -50,7 +48,6 @@
@include spatialSearchUi.theme($theme);
@include tissueBlockList.theme($theme);
@include termOccurrenceList.theme($theme);
@include spatialSearchKeyboardUi.theme($theme);
@include spinner.theme($theme);
@include thumbnailCarousel.theme($theme);
@include filters.theme($theme);
Expand Down
37 changes: 13 additions & 24 deletions apps/ccf-rui/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
<ccf-registration-modal></ccf-registration-modal>
<hra-nav-header-buttons
[app]="'rui'"
[appLink]="'https://apps.humanatlas.io/rui/'"
[appTitle]="'Registration User Interface'"
app="rui"
appLink="https://apps.humanatlas.io/rui/"
appTitle="Registration User Interface"
[brandmark]="true"
></hra-nav-header-buttons>
<ccf-left-sidebar [modalClosed]="registrationStarted"> </ccf-left-sidebar>
<hra-expansion-panel [title]="'Registration'" disabled class="registration">
<hra-expansion-panel title="Registration" disabled class="registration">
<hra-expansion-panel-actions>
<button
mat-icon-button
[matMenuTriggerFor]="menu"
[hraIconButtonSize]="'large'"
aria-label="Icon to open nested menu"
>
<button mat-icon-button [matMenuTriggerFor]="menu" hraIconButtonSize="large" aria-label="Icon to open nested menu">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu" [class]="'reg-overlay'">
<mat-menu #menu="matMenu">
<button mat-menu-item matRipple matRippleColor="#201E3D14" (click)="resetStage()">Reset all</button>
<button mat-menu-item matRipple matRippleColor="#201E3D14">Reset camera view</button>
<button mat-menu-item matRipple matRippleColor="#201E3D14">Reset tissue block</button>
<button mat-menu-item matRipple matRippleColor="#201E3D14">Reset registration metadata</button>
<mat-divider class="menu-divider"></mat-divider>
<button mat-menu-item matRipple matRippleColor="#201E3D14" (click)="resetCamera()">Reset camera view</button>
<button mat-menu-item matRipple matRippleColor="#201E3D14" (click)="resetBlock()">Reset tissue block</button>
<mat-divider class="menu-divider"></mat-divider>
<button mat-menu-item matRipple matRippleColor="#201E3D14" (click)="resetMetadata()">
Reset registration metadata
</button>
</mat-menu>
</hra-expansion-panel-actions>
<hra-expansion-panel-header-content>
Expand Down Expand Up @@ -53,13 +52,3 @@
[modalClosed]="registrationStarted"
(registrationExpanded)="registrationToggle($event)"
></ccf-right-sidebar>
<!-- <ccf-header
[class.header-hidden]="(header$ | async) === false"
[logoTooltip]="(logoTooltip$ | async) ?? ''"
[homeUrl]="(homeUrl$ | async) ?? ''"
></ccf-header> -->

<!-- <ccf-drawer-container>
<ccf-drawer-content>
</ccf-drawer-content>
</ccf-drawer-container> -->
142 changes: 3 additions & 139 deletions apps/ccf-rui/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:host {
display: grid;
grid-template-columns: 21rem minmax(586px, calc(100vw - 43.25rem)) 22.25rem;
grid-template-columns: 21rem minmax(586px, calc(100vw - 44.25rem)) 22.25rem;
grid-template-rows: 4.5rem auto;
grid-template-areas:
'header registration metadata'
Expand Down Expand Up @@ -40,9 +40,11 @@

hra-expansion-panel {
padding: 1rem;

::ng-deep .title {
font: var(--sys-label-large);
}

hra-expansion-panel-header-content {
display: flex;
gap: 1rem;
Expand All @@ -52,141 +54,3 @@
}
}
}

// :host {
// display: flex;
// flex-direction: column;
// height: 100%;
// overflow: hidden;
// font-size: 1rem;
// color: black;

// hra-nav-header-buttons {
// margin: 0.75rem;
// }

// hra-expansion-panel {
// padding: 1rem;
// ::ng-deep .title {
// font: var(--sys-label-large);
// }
// hra-expansion-panel-header-content {
// display: flex;
// gap: 1rem;
// mat-button-toggle-group {
// --mat-standard-button-toggle-height: auto;
// }
// }
// }

// .header-hidden {
// display: none;
// }

// ccf-drawer-container {
// height: 100%;

// ccf-drawer {
// width: 25.5rem;
// }

// ccf-drawer-content {
// position: relative;
// z-index: 1;

// .selector-drawer {
// top: 0rem;
// display: flex;
// flex-direction: column;
// position: relative;
// height: 5.688rem;
// transition: all 0.5s ease-in-out;

// &.expanded {
// height: 15rem;
// }

// ccf-organ-selector {
// height: 100%;
// padding-top: 0.5rem;
// transition: all 0.5s;

// &.closed {
// padding-top: 0;
// }
// }

// .close-button-wrapper {
// display: flex;
// justify-content: center;
// height: 0;
// z-index: 2;

// .close-button {
// cursor: pointer;
// transition: 0.6s;

// .expand-collapse-icon {
// width: 3rem;
// height: 1.2rem;
// display: flex;
// justify-content: center;
// align-items: center;
// cursor: pointer;
// background-color: white;
// border-bottom-left-radius: 0.2rem;
// border-bottom-right-radius: 0.2rem;
// transition: 0.6s;

// &:hover {
// background-color: #ececec;
// }
// }
// }
// }

// &.closed {
// height: 3rem;
// top: -2.9rem;
// }
// }

// .stage-content {
// border-radius: 0.5rem;
// height: calc(100% - 4.5rem);
// top: 4.5rem;
// }

// .expanded-stage {
// height: calc(100% - 1.5rem);
// padding-bottom: 1rem;
// }

// .retracted-stage {
// height: calc(100% - 2.688rem - 14rem);
// }
// }

// ccf-content {
// // top: 0rem;
// position: absolute;
// transition-duration: 0.5s;
// transition-timing-function: ease-in-out;
// transition-property: all;
// bottom: 1.5rem;
// z-index: 1;
// }
// }
// }

::ng-deep {
.mdc-snackbar__surface {
box-shadow: none !important;
}

.reg-overlay {
button.mat-mdc-menu-item .mat-mdc-menu-item-text {
font: var(--sys-label-medium);
}
}
}
72 changes: 27 additions & 45 deletions apps/ccf-rui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ChangeDetectorRef,
Component,
ElementRef,
HostListener,
Injector,
Input,
OnDestroy,
Expand Down Expand Up @@ -34,7 +33,6 @@ import { ThemingService } from './core/services/theming/theming.service';
import { ModelState, ViewSide, ViewType } from './core/store/model/model.state';
import { PageState } from './core/store/page/page.state';
import { RegistrationState } from './core/store/registration/registration.state';
import { Side } from './modules/content/stage-nav/stage-nav.component';
import {
DEFAULT_SCREEN_SIZE_NOTICE_STORAGE_KEY,
SCREEN_SIZE_NOTICE_MAX_HEIGHT,
Expand Down Expand Up @@ -85,6 +83,9 @@ export function openScreenSizeNotice(dialog: MatDialog): Subscription {
});
}

/** Valid values for side. */
export type Side = 'left' | 'right' | 'anterior' | 'posterior' | '3D';

/**
* App component
*/
Expand All @@ -93,6 +94,9 @@ export function openScreenSizeNotice(dialog: MatDialog): Subscription {
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
'(document:mousedown)': 'handleClick($event.target)',
},
})
export class AppComponent implements OnDestroy, OnInit {
/** False until the initial registration modal is closed */
Expand Down Expand Up @@ -181,7 +185,9 @@ export class AppComponent implements OnDestroy, OnInit {
snackBar.dismiss();
},
},

duration: this.consentService.consent === 'not-set' ? Infinity : 3000,
panelClass: 'usage-snackbar',
});

this.themeMode$.next('light');
Expand All @@ -203,53 +209,13 @@ export class AppComponent implements OnDestroy, OnInit {
}
}

/**
* Shifts block position when certain keys are pressed
*
* @param target The keyboard event
*/
@HostListener('document:keydown', ['$event'])
handleKey(target: KeyboardEvent): void {
const oldPosition = this.model.snapshot.position;
if (this.disablePositionChange || !this.registrationStarted) {
return;
}
target.preventDefault();
const delta = target.repeat ? 1.0 : 0.5;
let newPosition = oldPosition;
switch (target.key) {
case 'q':
newPosition = { ...oldPosition, z: oldPosition.z + delta };
break;
case 'e':
newPosition = { ...oldPosition, z: oldPosition.z - delta };
break;
case 'w':
newPosition = { ...oldPosition, y: oldPosition.y + delta };
break;
case 's':
newPosition = { ...oldPosition, y: oldPosition.y - delta };
break;
case 'a':
newPosition = { ...oldPosition, x: oldPosition.x - delta };
break;
case 'd':
newPosition = { ...oldPosition, x: oldPosition.x + delta };
break;
default:
break;
}
this.model.setPosition(newPosition);
}

/**
* Disables block position change if an input element is clicked
*
* @param target The element clicked
*/
@HostListener('document:mousedown', ['$event.target'])
handleClick(target: HTMLElement): void {
const disableWhenClicked = ['mat-mdc-input-element', 'form-input-label'];
const disableWhenClicked = ['mat-mdc-input-element', 'mat-mdc-form-field', 'form-input-label'];
for (const className of disableWhenClicked) {
if (typeof target.className === 'string' && target.className.includes(className)) {
this.disablePositionChange = true;
Expand Down Expand Up @@ -291,12 +257,28 @@ export class AppComponent implements OnDestroy, OnInit {
}

resetStage(): void {
this.resetMetadata();
this.resetCamera();
}

resetCamera(): void {
this.model.setViewSide('anterior');
this.model.setViewType('register');
}

resetMetadata(): void {
if (this.registration.snapshot.initialRegistration) {
this.registration.setToInitialRegistration();
} else {
this.model.setOrganDefaults();
}
this.model.setViewSide('anterior');
this.model.setViewType('register');
}

resetBlock(): void {
if (this.registration.snapshot.initialRegistration) {
this.registration.resetPosition();
} else {
this.model.setDefaultPosition();
}
}
}
Loading
Loading