Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file removed assets/gates-icon.png
Binary file not shown.
Binary file removed assets/workflow-icon.png
Binary file not shown.
29 changes: 5 additions & 24 deletions components/AppSelectionDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { combineClassNames } from '../../javascript-functions/general';
import { AppSelectionDropdownProps } from '../types/dropdown';
import kernLogo from '../assets/kern-icon.png';
import refineryLogo from '../assets/refinery-icon.png';
import gatesLogo from '../assets/gates-icon.png';

export default function PlatformWelcomeDropdown(props: AppSelectionDropdownProps) {
return (
Expand All @@ -32,26 +31,8 @@ export default function PlatformWelcomeDropdown(props: AppSelectionDropdownProps
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
<Menu.Items className="fixed bottom-[74px] left-20 z-50 w-40 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<Menu.Items className="fixed bottom-[70px] left-14 z-50 w-40 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<div className="py-1">
{props.cockpit ? (
<Menu.Item>
{({ active }) => (
<a
href="/welcome"
rel="noopener noreferrer"
className={combineClassNames(
active ? 'bg-gray-100 text-gray-900' : 'text-gray-700',
'group flex items-center px-4 py-2 text-sm cursor-pointer font-mono'
)}
>
<Image src={kernLogo} width="21" height="21" alt='cockpit' />
<span className='ml-2'>cockpit</span>
</a>
)}
</Menu.Item>
) : null}

{props.refinery ? (
<Menu.Item>
{({ active }) => (
Expand All @@ -71,19 +52,19 @@ export default function PlatformWelcomeDropdown(props: AppSelectionDropdownProps
) : null}


{props.gates ? (
{props.cognition ? (
<Menu.Item>
{({ active }) => (
<a
href="/gates"
href="/cognition"
rel="noopener noreferrer"
className={combineClassNames(
active ? 'bg-gray-100 text-gray-900' : 'text-gray-700',
'group flex items-center px-4 py-2 text-sm cursor-pointer font-mono'
)}
>
<Image src={gatesLogo} width="21" height="21" alt='gates' />
<span className='ml-2'>gates</span>
<Image src={kernLogo} width="21" height="21" alt='cognition' />
<span className='ml-2'>cognition</span>
</a>
)}
</Menu.Item>
Expand Down
14 changes: 0 additions & 14 deletions components/KernDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export default function KernDropdown(props: KernDropdownProps) {
{props.onClickDelete && <div className="ml-auto flex items-center cursor-pointer hover:bg-gray-200" onClick={(e) => { e.stopPropagation(); props.onClickDelete(option) }}><IconTrashXFilled size={20} /></div>}
{props.optionsHaveLink && <a href={props.linkList[index]} target="_blank" className="h-4 w-4 mr-2 ml-auto flex items-center cursor-pointer"><IconExternalLink size={16} /></a>}
</label>
{index == props.lineSeparatorIndex && <hr className="my-2 border-t border-dashed h-px border-gray-700" onMouseEnter={() => setHoverBoxPosition(null)}></hr>}
</Tooltip>
</div>
)}
Expand All @@ -263,19 +262,6 @@ function HoverBox(props: { position: any, hoverBox: any }) {
<div className="flex justify-center">
<span className="card-title mb-2 label-text">Info</span>
</div>
<div className="grid grid-cols-2 gap-2 items-center" style={{ gridTemplateColumns: 'max-content auto' }}>
{props.hoverBox.avgTime && <Fragment>
<span className="label-text text-sm font-bold">Avg Time</span>
<span className="label-text text-sm">{props.hoverBox.avgTime}</span></Fragment>}
{props.hoverBox.base && <Fragment>
<span className="label-text text-sm font-bold">Based on</span>
<span className="label-text text-sm">{props.hoverBox.base}</span>
</Fragment>}
{props.hoverBox.size && <Fragment>
<span className="label-text text-sm font-bold">Size</span>
<span className="label-text text-sm">{props.hoverBox.size}</span>
</Fragment>}
</div>
{!props.hoverBox.avgTime && !props.hoverBox.base && !props.hoverBox.size && <Fragment>
<span className="label-text text-sm">{props.hoverBox}</span>
</Fragment>}
Expand Down
33 changes: 1 addition & 32 deletions hooks/web-socket/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export enum Application {
REFINERY = 'REFINERY',
COGNITION = 'COGNITION',
GATES = 'GATES',
WELCOME_SCREEN = 'WELCOME_SCREEN',
ENTRY = 'ENTRY',
ADMIN_DASHBOARD = 'ADMIN_DASHBOARD',
}
Expand All @@ -15,18 +13,14 @@ export enum CurrentPage {
DATA_BROWSER = 'DATA_BROWSER',
LABELING = 'LABELING',
HEURISTICS = 'HEURISTICS',
ADMIN_PAGE = 'ADMIN_PAGE',
USERS = 'USERS',
UPLOAD_RECORDS = 'UPLOAD_RECORDS',
PROJECT_SETTINGS = "PROJECT_SETTINGS",
MODELS_DOWNLOAD = "MODELS_DOWNLOAD",
ATTRIBUTE_CALCULATION = "ATTRIBUTE_CALCULATION",
LOOKUP_LISTS_DETAILS = "LOOKUP_LISTS_DETAILS",
MODEL_CALLBACKS = "MODEL_CALLBACKS",
LABELING_FUNCTION = "LABELING_FUNCTION",
ACTIVE_LEARNING = "ACTIVE_LEARNING",
ZERO_SHOT = "ZERO_SHOT",
CROWD_LABELER = "CROWD_LABELER",
RECORD_IDE = "RECORD_IDE",
EDIT_RECORDS = "EDIT_RECORDS",
NOTIFICATION_CENTER = "NOTIFICATION_CENTER",
Expand All @@ -35,8 +29,6 @@ export enum CurrentPage {
BRICKS_INTEGRATOR = "BRICKS_INTEGRATOR",
CONFIG = "CONFIG",
COGNITION_LAYOUT = "COGNITION_LAYOUT",
GATES_LAYOUT = "GATES_LAYOUT",
WELCOME_SCREEN_LAYOUT = "WELCOME_SCREEN_LAYOUT",
ENTRY_LAYOUT = "ENTRY_LAYOUT",
ADMIN_DASHBOARD_LAYOUT = "ADMIN_DASHBOARD_LAYOUT",
}
Expand Down Expand Up @@ -74,17 +66,14 @@ export const WHITELIST_LOOKUP_REFINERY = {
[CurrentPageSubKey.NONE]: ['label_created', 'label_deleted', 'labeling_task_deleted', 'labeling_task_updated', 'labeling_task_created', 'weak_supervision_finished', 'data_slice_created', 'data_slice_updated', 'data_slice_deleted']
},
[CurrentPage.PROJECT_SETTINGS]: {
[CurrentPageSubKey.NONE]: ['project_update', 'tokenization', 'calculate_attribute', 'embedding', 'attributes_updated', 'gates_integration', 'information_source_deleted', 'information_source_updated', 'embedding_deleted', 'embedding_updated', 'upload_embedding_payload', 'label_created', 'label_deleted', 'labeling_task_deleted', 'labeling_task_updated', 'labeling_task_created'],
[CurrentPageSubKey.NONE]: ['project_update', 'tokenization', 'calculate_attribute', 'embedding', 'attributes_updated', 'information_source_deleted', 'information_source_updated', 'embedding_deleted', 'embedding_updated', 'upload_embedding_payload', 'label_created', 'label_deleted', 'labeling_task_deleted', 'labeling_task_updated', 'labeling_task_created'],
[CurrentPageSubKey.SNAPSHOT_EXPORT]: ['project_updated', 'project_export'],
[CurrentPageSubKey.EMBEDDINGS]: ['embedding_updated', 'upload_embedding_payload']

},
[CurrentPage.EXPORT]: {
[CurrentPageSubKey.NONE]: ['record_export', 'calculate_attribute', 'labeling_task_deleted', 'labeling_task_created', 'data_slice_created', 'data_slice_deleted', 'information_source_created', 'information_source_deleted']
},
[CurrentPage.MODEL_CALLBACKS]: {
[CurrentPageSubKey.NONE]: ['information_source_created', 'information_source_updated', 'information_source_deleted', 'labeling_task_deleted', 'labeling_task_updated', 'labeling_task_created', 'model_callback_update_statistics']
},
[CurrentPage.LOOKUP_LISTS_DETAILS]: {
[CurrentPageSubKey.NONE]: ['knowledge_base_updated', 'knowledge_base_deleted', 'knowledge_base_term_updated']
},
Expand All @@ -95,15 +84,9 @@ export const WHITELIST_LOOKUP_REFINERY = {
[CurrentPageSubKey.NONE]: ['attributes_updated', 'calculate_attribute', 'payload_finished', 'weak_supervision_finished', 'record_deleted', 'rla_created', 'rla_deleted', 'access_link_changed', 'access_link_removed', 'label_created', 'label_deleted', 'labeling_task_deleted', 'labeling_task_updated', 'labeling_task_created'],

},
[CurrentPage.ZERO_SHOT]: {
[CurrentPageSubKey.NONE]: ['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted', 'labeling_task_deleted', 'information_source_deleted', 'information_source_updated', 'payload_update_statistics', 'payload_finished', 'payload_failed', 'payload_created', 'zero-shot', 'zero_shot_download']
},
[CurrentPage.LABELING_FUNCTION]: {
[CurrentPageSubKey.NONE]: ['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted', 'labeling_task_deleted', 'information_source_deleted', 'information_source_updated', 'model_callback_update_statistics', 'payload_progress', 'payload_finished', 'payload_failed', 'payload_created', 'payload_update_statistics'],
},
[CurrentPage.CROWD_LABELER]: {
[CurrentPageSubKey.NONE]: ['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted', 'labeling_task_deleted', 'information_source_deleted', 'information_source_updated', 'model_callback_update_statistics']
},
[CurrentPage.ACTIVE_LEARNING]: {
[CurrentPageSubKey.NONE]: ['labeling_task_updated', 'labeling_task_created', 'label_created', 'label_deleted', 'labeling_task_deleted', 'information_source_deleted', 'information_source_updated', 'model_callback_update_statistics', 'embedding_deleted', 'embedding', 'payload_finished', 'payload_failed', 'payload_created', 'payload_update_statistics']
},
Expand All @@ -122,9 +105,6 @@ export const WHITELIST_LOOKUP_REFINERY = {
[CurrentPageSubKey.NONE]: ['attributes_updated', 'calculate_attribute', 'tokenization', 'knowledge_base_updated', 'knowledge_base_deleted', 'knowledge_base_created'],

},
[CurrentPage.ADMIN_PAGE]: {
[CurrentPageSubKey.NONE]: ['pat']
},
[CurrentPage.NOTIFICATION_CENTER]: {
[CurrentPageSubKey.NONE]: ['notification_created', 'project_deleted', 'config_updated', 'admin_message'],

Expand All @@ -137,17 +117,6 @@ export const WHITELIST_LOOKUP_COGNITION = {
}
}

export const WHITELIST_LOOKUP_GATES = {
[CurrentPage.GATES_LAYOUT]: {
[CurrentPageSubKey.NONE]: ['admin_message']
}
}

export const WHITE_LIST_LOOKUP_WELCOME_SCREEN = {
[CurrentPage.WELCOME_SCREEN_LAYOUT]: {
[CurrentPageSubKey.NONE]: ['admin_message']
}
}

export const WHITE_LIST_LOOKUP_ENTRY = {
[CurrentPage.ENTRY_LAYOUT]: {
Expand Down
4 changes: 1 addition & 3 deletions hooks/web-socket/web-sockets-helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, CurrentPage, CurrentPageSubKey, WHITELIST_LOOKUP_COGNITION, WHITELIST_LOOKUP_GATES, WHITELIST_LOOKUP_REFINERY, WHITE_LIST_LOOKUP_ADMIN_DASHBOARD, WHITE_LIST_LOOKUP_ENTRY, WHITE_LIST_LOOKUP_WELCOME_SCREEN } from "./constants";
import { Application, CurrentPage, CurrentPageSubKey, WHITELIST_LOOKUP_COGNITION, WHITELIST_LOOKUP_REFINERY, WHITE_LIST_LOOKUP_ADMIN_DASHBOARD, WHITE_LIST_LOOKUP_ENTRY } from "./constants";

export type NotificationSubscription = {
projectId?: string;
Expand Down Expand Up @@ -29,8 +29,6 @@ export function getConstWhitelist(application: Application) {
switch (application) {
case Application.REFINERY: whiteListString = WHITELIST_LOOKUP_REFINERY; break;
case Application.COGNITION: whiteListString = WHITELIST_LOOKUP_COGNITION; break;
case Application.GATES: whiteListString = WHITELIST_LOOKUP_GATES; break;
case Application.WELCOME_SCREEN: whiteListString = WHITE_LIST_LOOKUP_WELCOME_SCREEN; break;
case Application.ENTRY: whiteListString = WHITE_LIST_LOOKUP_ENTRY; break;
case Application.ADMIN_DASHBOARD: whiteListString = WHITE_LIST_LOOKUP_ADMIN_DASHBOARD; break;
}
Expand Down
7 changes: 1 addition & 6 deletions types/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* @linkList {string[]} - The array of links that will be applied to the dropdown items (needs to be the exact same length as the optionArray)
* @optionsHaveHoverBox {boolean} - If the dropdown options have a hover box
* @hoverBoxList {string[]} - The array of hover boxes that will be applied to the dropdown items (needs to be the exact same length as the optionArray)
* @addLineSeparator {boolean} - If the dropdown should have a line separator
* @lineSeparatorIndex {number} - The index of the dropdown item that will have a line separator
* @iconsArray {string[]} - The array of icons that will be applied to the dropdown items (needs to be the exact same length as the optionArray)
* @valuePropertyPath {string, optional} - if undefined option text is returned, else (e.g. name.tmp.xyz) the path is split and used to access the object property
* @useFillForIcons {boolean[], optional} - if true, the icon will be filled with the color of the option
Expand Down Expand Up @@ -76,8 +74,6 @@ export type KernDropdownProps = {
linkList?: string[];
optionsHaveHoverBox?: boolean;
hoverBoxList?: string[];
addLineSeparator?: boolean;
lineSeparatorIndex?: number;
iconsArray?: string[];
valuePropertyPath?: string;
useFillForIcons?: boolean[];
Expand All @@ -88,7 +84,6 @@ export type KernDropdownProps = {
}

export type AppSelectionDropdownProps = {
cockpit?: boolean;
refinery?: boolean;
gates?: boolean;
cognition?: boolean;
};