mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-12 11:17:01 +00:00

* Releases updated version of datahub-web client UI code * Fix typo in yarn lock * Change yarn lock to match yarn registry directories * Previous commit missed some paths * Even more changes to yarnlock missing in previous commit * Include codegen file for typings * Add files to get parity for datahub-web and current OS datahub-midtier * Add in typo fix from previous commit - change to proper license * Implement proper OS fix for person entity picture url * Workarounds for open source DH issues * Fixes institutional memory api and removes unopensourced tabs for datasets * Fixes search dataset deprecation and user search issue as a result of changes * Remove internal only options in the avatar menu
67 lines
1.9 KiB
TypeScript
67 lines
1.9 KiB
TypeScript
import Component from '@glimmer/component';
|
|
import { noop } from 'lodash';
|
|
import { ITabProperties } from '@datahub/data-models/types/entity/rendering/entity-render-props';
|
|
|
|
interface ITabContentModalModalArgs {
|
|
/**
|
|
* The title displayed in the header of the modal
|
|
*/
|
|
title: string;
|
|
|
|
/**
|
|
* Action triggered when closing the modal
|
|
*/
|
|
onCloseTabContentModal?: () => void;
|
|
|
|
/**
|
|
* Action triggered when selecting a different tab in the modal
|
|
*/
|
|
tabSelectionDidChange?: (tab: string) => void;
|
|
|
|
/**
|
|
* An array of tab properties so the modal knows what the current tab will render
|
|
*/
|
|
tabs: Array<ITabProperties>;
|
|
|
|
/**
|
|
* The current tab that the modal is displaying content for
|
|
*/
|
|
currentTab: string;
|
|
}
|
|
|
|
export const modalClass = 'tab-content-modal';
|
|
|
|
/**
|
|
* The Tab Content Modal is a modal with tab states, where the content displayed depends on the current tab selected.
|
|
* This component is agnostic to the content that is rendered, and only renders off the tab properties.
|
|
*
|
|
* If the tab property do not contain sufficient attributes for the rendering of the desired content, this component
|
|
* yields out a contextual component so this component does not get passed business logic specifics.
|
|
* Example:
|
|
*
|
|
* <TabContentModal
|
|
* @tabs={{this.tabs}}
|
|
* @currentTab={{this.tabSelected}}
|
|
* @tabSelectionDidChange={{fn this.tabSelectionDidChange}}
|
|
* as |Modal|
|
|
* >
|
|
* <Modal.content />
|
|
* </TabContentModal>
|
|
*/
|
|
export default class TabContentModalModal extends Component<ITabContentModalModalArgs> {
|
|
/**
|
|
* Declared for convenient access in the template
|
|
*/
|
|
modalClass = modalClass;
|
|
|
|
/**
|
|
* Action triggered when closing the modal
|
|
*/
|
|
onCloseTabContentModal: () => void = this.args.onCloseTabContentModal || noop;
|
|
|
|
/**
|
|
* Action triggered when selecting a different tab in the modal
|
|
*/
|
|
tabSelectionDidChange: (tab: string) => void = this.args.tabSelectionDidChange || noop;
|
|
}
|