File tree Expand file tree Collapse file tree 4 files changed +11
-13
lines changed
packages/jbrowse-plugin-apollo/src
LinearApolloDisplay/glyphs
LinearApolloSixFrameDisplay/glyphs Expand file tree Collapse file tree 4 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -842,7 +842,7 @@ function getContextMenuItems(
842842 const currentAssemblyId = display . getAssemblyId ( region . assemblyName )
843843 const menuItems : MenuItem [ ] = [ ]
844844 const role = internetAccount ? internetAccount . role : 'admin'
845- const admin = role === 'admin'
845+ const readOnly = ! ( role && [ 'admin' , 'user' ] . includes ( role ) )
846846 if ( ! hoveredFeature ) {
847847 return menuItems
848848 }
@@ -902,7 +902,7 @@ function getContextMenuItems(
902902 contextMenuItemsForFeature . push (
903903 {
904904 label : 'Merge exons' ,
905- disabled : ! admin ,
905+ disabled : readOnly ,
906906 onClick : ( ) => {
907907 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
908908 ( doneCallback ) => [
@@ -926,7 +926,7 @@ function getContextMenuItems(
926926 } ,
927927 {
928928 label : 'Split exon' ,
929- disabled : ! admin ,
929+ disabled : readOnly ,
930930 onClick : ( ) => {
931931 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
932932 ( doneCallback ) => [
Original file line number Diff line number Diff line change @@ -859,7 +859,7 @@ function getContextMenuItems(
859859 const currentAssemblyId = display . getAssemblyId ( region . assemblyName )
860860 const menuItems : MenuItem [ ] = [ ]
861861 const role = internetAccount ? internetAccount . role : 'admin'
862- const admin = role === 'admin'
862+ const readOnly = ! ( role && [ 'admin' , 'user' ] . includes ( role ) )
863863 if ( ! hoveredFeature ) {
864864 return menuItems
865865 }
@@ -928,7 +928,7 @@ function getContextMenuItems(
928928 contextMenuItemsForFeature . push (
929929 {
930930 label : 'Merge exons' ,
931- disabled : ! admin ,
931+ disabled : readOnly ,
932932 onClick : ( ) => {
933933 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
934934 ( doneCallback ) => [
@@ -952,7 +952,7 @@ function getContextMenuItems(
952952 } ,
953953 {
954954 label : 'Split exon' ,
955- disabled : ! admin ,
955+ disabled : readOnly ,
956956 onClick : ( ) => {
957957 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
958958 ( doneCallback ) => [
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ export function featureContextMenuItems(
3232) {
3333 const internetAccount = getApolloInternetAccount ( session )
3434 const role = internetAccount ? internetAccount . role : 'admin'
35- const admin = role === 'admin'
3635 const readOnly = ! ( role && [ 'admin' , 'user' ] . includes ( role ) )
3736 const menuItems : MenuItem [ ] = [ ]
3837 if ( feature ) {
@@ -102,7 +101,7 @@ export function featureContextMenuItems(
102101 } ,
103102 {
104103 label : 'Delete feature' ,
105- disabled : ! admin ,
104+ disabled : readOnly ,
106105 onClick : ( ) => {
107106 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
108107 ( doneCallback ) => [
@@ -124,7 +123,7 @@ export function featureContextMenuItems(
124123 } ,
125124 {
126125 label : 'Merge transcripts' ,
127- disabled : ! admin ,
126+ disabled : readOnly ,
128127 onClick : ( ) => {
129128 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
130129 ( doneCallback ) => [
@@ -146,7 +145,7 @@ export function featureContextMenuItems(
146145 } ,
147146 {
148147 label : 'Merge exons' ,
149- disabled : ! admin ,
148+ disabled : readOnly ,
150149 onClick : ( ) => {
151150 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
152151 ( doneCallback ) => [
@@ -168,7 +167,7 @@ export function featureContextMenuItems(
168167 } ,
169168 {
170169 label : 'Split exon' ,
171- disabled : ! admin ,
170+ disabled : readOnly ,
172171 onClick : ( ) => {
173172 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
174173 ( doneCallback ) => [
Original file line number Diff line number Diff line change @@ -288,7 +288,6 @@ export function getContextMenuItemsForFeature(
288288 } = display
289289 const menuItems : MenuItem [ ] = [ ]
290290 const role = internetAccount ? internetAccount . role : 'admin'
291- const admin = role === 'admin'
292291 const readOnly = ! ( role && [ 'admin' , 'user' ] . includes ( role ) )
293292 const [ region ] = regions
294293 const sourceAssemblyId = display . getAssemblyId ( region . assemblyName )
@@ -341,7 +340,7 @@ export function getContextMenuItemsForFeature(
341340 } ,
342341 {
343342 label : 'Delete feature' ,
344- disabled : ! admin ,
343+ disabled : readOnly ,
345344 onClick : ( ) => {
346345 ; ( session as unknown as AbstractSessionModel ) . queueDialog (
347346 ( doneCallback ) => [
You can’t perform that action at this time.
0 commit comments