File tree Expand file tree Collapse file tree 4 files changed +20
-6
lines changed
GeneralEntity/Slots/ToolbarUploadLayerButton Expand file tree Collapse file tree 4 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ var shogunApplicationConfig = {
2121 geoserver : {
2222 base : '/geoserver' ,
2323 upload : {
24+ buttonVisible : false ,
2425 workspace : 'SHOGUN' ,
2526 limit : 200000000 // ~200MB
2627 }
Original file line number Diff line number Diff line change 22 useContext
33} from 'react' ;
44
5+ import config from 'shogunApplicationConfig' ;
6+
57import UploadLayerButton , {
68 UploadLayerButtonProps
79} from '../../../UploadLayerButton/UploadLayerButton' ;
@@ -15,6 +17,10 @@ export const ToolbarUploadLayerButton: React.FC<UploadLayerButtonProps> = () =>
1517 generalEntityRootContext ?. fetchEntities ?.( ) ;
1618 } ;
1719
20+ if ( ! config . geoserver ?. upload ?. buttonVisible ) {
21+ return < > </ >
22+ }
23+
1824 return (
1925 < UploadLayerButton
2026 onSuccess = { onSuccess }
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export const UploadLayerButton: React.FC<UploadLayerButtonProps> = ({
8383 } = useTranslation ( ) ;
8484
8585 const onBeforeFileUpload = ( file : RcFile ) => {
86- const maxSize = config . geoserver ?. upload ?. limit || ' 200000000' ;
86+ const maxSize = config . geoserver ?. upload ?. limit || 200000000 ;
8787 const fileType = file . type ;
8888 const fileSize = file . size ;
8989
Original file line number Diff line number Diff line change @@ -15,16 +15,23 @@ declare module 'shogunApplicationConfig' {
1515 resourcePath ?: string ;
1616 exposedPaths ?: string [ ] ;
1717 }
18-
18+ interface GeoServerConfiguration {
19+ base ?: string ;
20+ upload ?: {
21+ buttonVisible ?: boolean ;
22+ workspace ?: string ;
23+ limit ?: number ;
24+ } ;
25+ }
1926 /**
2027 * Config object which contains the settings to adapt the admin client
2128 * to your application.
2229 */
2330 interface AdminConfiguration {
24- /**
25- * Geoserver configuration object.
26- */
27- geoserver ?;
31+ /**
32+ * Geoserver configuration object.
33+ */
34+ geoserver ?: GeoServerConfiguration ;
2835 /**
2936 * The path to the admin client on your host, e.g. '/admin'
3037 */
You can’t perform that action at this time.
0 commit comments