Skip to content

Commit

Permalink
Merge pull request #739 from hubmapconsortium/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
axdanbol authored Sep 26, 2024
2 parents d174d38 + 17bd9c8 commit b1764d9
Show file tree
Hide file tree
Showing 34 changed files with 597 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/production-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
app-configuration: production
nx-command: run-many
build-compodoc: false
build-storybook: false

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -37,6 +36,7 @@ jobs:
- name: Deploy to S3
run: |
aws s3 sync --delete deploy/apps/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ui/
aws s3 sync deploy/storybook/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ui/storybook/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/ui/*"
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_HUMANATLAS_IO_DISTRIBUTION_ID }} --paths "/*"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
app-configuration: staging
nx-command: run-many
build-compodoc: false
build-storybook: false

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -37,6 +36,7 @@ jobs:
- name: Deploy to S3
run: |
aws s3 sync --delete deploy/apps/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ui--staging/
aws s3 sync deploy/storybook/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ui--staging/storybook/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/ui--staging/*"
- name: Publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { mockDeep } from 'jest-mock-extended';
import embed, { Result } from 'vega-embed';

import { provideScrolling } from '@hra-ui/design-system/scrolling';
import { rgbToHex } from '../models/color';
import { rgbToHex } from '@hra-ui/design-system/color-picker';
import { ColorMapEntry, DEFAULT_COLOR_MAP_KEY, DEFAULT_COLOR_MAP_VALUE_KEY } from '../models/color-map';
import { EdgeEntry } from '../models/edge';
import { DEFAULT_NODE_TARGET_KEY, DEFAULT_NODE_TARGET_VALUE, NodeEntry } from '../models/node';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MetadataComponent } from '../components/metadata/metadata.component';
import { NodeDistVisualizationComponent } from '../components/node-dist-visualization/node-dist-visualization.component';
import { VisualizationHeaderComponent } from '../components/visualization-header/visualization-header.component';
import { CellTypeEntry } from '../models/cell-type';
import { rgbToHex } from '../models/color';
import { rgbToHex } from '@hra-ui/design-system/color-picker';
import {
ColorMapColorKey,
ColorMapEntry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ScrollingModule } from '@hra-ui/design-system/scrolling';
import { ColorPickerModule } from 'ngx-color-picker';
import { map } from 'rxjs';
import { CellTypeEntry } from '../../models/cell-type';
import { Rgb } from '../../models/color';
import { Rgb } from '@hra-ui/design-system/color-picker';
import { TOOLTIP_POSITION_RIGHT_SIDE } from '../../shared/tooltip-position';
import { ColorPickerLabelComponent } from '../color-picker-label/color-picker-label.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, effect, input, model, output, signal } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { ColorPickerDirective, ColorPickerModule } from 'ngx-color-picker';
import { Rgb, colorEquals, hexToRgb, rgbToHex } from '../../models/color';
import { Rgb, colorEquals, hexToRgb, rgbToHex } from '@hra-ui/design-system/color-picker';
import { TOOLTIP_POSITION_COLOR_PICKER_LABEL } from '../../shared/tooltip-position';

/** Maximum cell width for the cell type label */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import userEvent from '@testing-library/user-event';
import { mockClear, mockDeep } from 'jest-mock-extended';
import embed, { Result } from 'vega-embed';
import { CellTypeEntry } from '../../models/cell-type';
import { Rgb } from '../../models/color';
import { Rgb } from '@hra-ui/design-system/color-picker';
import { EdgeEntry } from '../../models/edge';
import { DEFAULT_NODE_TARGET_KEY, NodeEntry } from '../../models/node';
import { FileSaverService } from '../../services/file-saver/file-saver.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { ColorPickerDirective, ColorPickerModule } from 'ngx-color-picker';
import { View } from 'vega';
import embed, { VisualizationSpec } from 'vega-embed';
import { CellTypeEntry } from '../../models/cell-type';
import { Rgb, colorEquals, rgbToHex } from '../../models/color';
import { Rgb, colorEquals, rgbToHex } from '@hra-ui/design-system/color-picker';
import { EdgeEntry, EdgeIndex, edgeDistance } from '../../models/edge';
import { NodeEntry, NodeTargetKey } from '../../models/node';
import { FileSaverService } from '../../services/file-saver/file-saver.service';
Expand Down
2 changes: 1 addition & 1 deletion libs/cde-visualization/src/lib/models/cell-type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Rgb } from './color';
import { Rgb } from '@hra-ui/design-system/color-picker';

/** Interface representing a cell type entry */
export interface CellTypeEntry {
Expand Down
2 changes: 1 addition & 1 deletion libs/cde-visualization/src/lib/models/color-map.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Brand } from './brand';
import { Rgb } from './color';
import { Rgb } from '@hra-ui/design-system/color-picker';

/** Type representing a key for color map types, enhanced with a branding mechanism */
export type ColorMapTypeKey = string & Brand<'ColorMapTypeKey'>;
Expand Down
2 changes: 1 addition & 1 deletion libs/cde-visualization/src/lib/shared/color-generator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Rgb, hexToRgb } from '../models/color';
import { Rgb, hexToRgb } from '@hra-ui/design-system/color-picker';

/** Array of predefined colors in RGB format */
const COLORS: Rgb[] = [
Expand Down
1 change: 0 additions & 1 deletion libs/design-system/button/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from './lib/providers';
export * from './lib/button.module';
export * from './lib/button-size/button-size.directive';
export * from './lib/directives/call-to-action-button.directive';
export * from './lib/directives/nav-item-button.directive';
export * from './lib/directives/navigation-category-button.directive';
export * from './lib/directives/primary-button.directive';
export * from './lib/directives/secondary-button.directive';
Original file line number Diff line number Diff line change
@@ -1,62 +1,19 @@
import { computed, Directive, input } from '@angular/core';
import { Directive, input } from '@angular/core';

/** Input options for icon button size */
export type ButtonSize = 'small' | 'medium' | 'large';

/** Interface for button size and font variable */
interface ButtonConfig {
/** Size of the button */
size: number;
/** Font variable for the button */
font: string;
/** Padding for the current button size */
horizontalPadding: number;
}

/** Record of button sizes (number in rem) */
const BUTTON_CONFIG: Record<ButtonSize, ButtonConfig> = {
small: {
size: 1.75,
font: '--sys-label-small',
horizontalPadding: 0.5,
},
medium: {
size: 2,
font: '--sys-label-medium',
horizontalPadding: 0.75,
},
large: {
size: 2.5,
font: '--sys-label-large',
horizontalPadding: 1,
},
};

/**
* Directive for button sizes
*/
@Directive({
selector: '[hraButtonSize]',
standalone: true,
host: {
'[style.--mdc-text-button-container-height.rem]': 'buttonSize()',
'[style.font]': 'fontVar()',
'[style.--mat-text-button-horizontal-padding.rem]': 'padding()',
'[style.--mdc-filled-button-container-height.rem]': 'buttonSize()',
'[style.--mat-filled-button-horizontal-padding.rem]': 'padding()',
'[style.--mat-standard-button-toggle-height.rem]': 'buttonSize()',
'[class]': '"button-size-"+size()',
},
})
export class ButtonSizeDirective {
/** Size of icon button to use */
readonly size = input.required<ButtonSize>({ alias: 'hraButtonSize' });

/** Gets size of button in rem */
protected readonly buttonSize = computed(() => BUTTON_CONFIG[this.size()].size);

/** Gets the font variable for the current button size */
protected readonly fontVar = computed(() => `var(${BUTTON_CONFIG[this.size()].font})`);

/** Gets the horizontal padding for the current button size */
protected readonly padding = computed(() => BUTTON_CONFIG[this.size()].horizontalPadding);
}
Loading

0 comments on commit b1764d9

Please sign in to comment.