-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,118 additions
and
1,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import RpcMethodType from './RpcMethodType' | ||
import { renameRegionsIfNeeded } from '../util' | ||
import SerializableFilterChain from './renderers/util/serializableFilterChain' | ||
|
||
import type { RenderArgs } from '@jbrowse/core/rpc/coreRpcMethods' | ||
|
||
export default abstract class RpcMethodTypeWithFiltersAndRenameRegions extends RpcMethodType { | ||
async deserializeArguments(args: any, rpcDriverClassName: string) { | ||
const l = await super.deserializeArguments(args, rpcDriverClassName) | ||
return { | ||
...l, | ||
filters: args.filters | ||
? new SerializableFilterChain({ | ||
filters: args.filters, | ||
}) | ||
: undefined, | ||
} | ||
} | ||
|
||
async serializeArguments( | ||
args: RenderArgs & { | ||
stopToken?: string | ||
statusCallback?: (arg: string) => void | ||
}, | ||
rpcDriverClassName: string, | ||
) { | ||
const pm = this.pluginManager | ||
const assemblyManager = pm.rootModel?.session?.assemblyManager | ||
if (!assemblyManager) { | ||
throw new Error('no assembly manager') | ||
} | ||
|
||
const renamedArgs = await renameRegionsIfNeeded(assemblyManager, { | ||
...args, | ||
filters: args.filters?.toJSON().filters, | ||
}) | ||
|
||
return super.serializeArguments(renamedArgs, rpcDriverClassName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
plugins/linear-genome-view/src/BaseLinearDisplay/components/BlockError.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react' | ||
|
||
import ErrorMessageStackTraceDialog from '@jbrowse/core/ui/ErrorMessageStackTraceDialog' | ||
import { getSession } from '@jbrowse/core/util' | ||
import RefreshIcon from '@mui/icons-material/Refresh' | ||
import ReportIcon from '@mui/icons-material/Report' | ||
import { IconButton, Tooltip } from '@mui/material' | ||
import { observer } from 'mobx-react' | ||
|
||
import BlockMsg from './BlockMsg' | ||
|
||
const BlockError = observer(function ({ model }: { model: any }) { | ||
return ( | ||
<BlockMsg | ||
message={`${model.error}`} | ||
severity="error" | ||
action={ | ||
<> | ||
<Tooltip title="Reload track"> | ||
<IconButton | ||
data-testid="reload_button" | ||
onClick={() => { | ||
model.reload() | ||
}} | ||
> | ||
<RefreshIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
<Tooltip title="Show stack trace"> | ||
<IconButton | ||
onClick={() => { | ||
getSession(model).queueDialog(onClose => [ | ||
ErrorMessageStackTraceDialog, | ||
{ onClose, error: model.error as Error }, | ||
]) | ||
}} | ||
> | ||
<ReportIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
</> | ||
} | ||
/> | ||
) | ||
}) | ||
|
||
export default BlockError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.