Skip to content

Commit

Permalink
chore(POC Shim): Remove unneeded iconfont shim for the webId POC
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Apr 23, 2019
1 parent a586511 commit eb8ba8e
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 1,666 deletions.
613 changes: 0 additions & 613 deletions app/extensions/safe/iconfont/iconfont.css

This file was deleted.

Binary file removed app/extensions/safe/iconfont/iconfont.eot
Binary file not shown.
927 changes: 0 additions & 927 deletions app/extensions/safe/iconfont/iconfont.svg

This file was deleted.

90 changes: 0 additions & 90 deletions app/extensions/safe/iconfont/iconfont.ts

This file was deleted.

Binary file removed app/extensions/safe/iconfont/iconfont.ttf
Binary file not shown.
Binary file removed app/extensions/safe/iconfont/iconfont.woff
Binary file not shown.
2 changes: 1 addition & 1 deletion app/extensions/safe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { handleSafeBrowserStoreChanges } from './safeBrowserApplication';
import blockNonSAFERequests from './blockNonSafeReqs';
import registerSafeAuthProtocol from './protocols/safe-auth';
import registerSafeProtocol from './protocols/safe';
import setupRoutes from './server-routes';
import { setupRoutes } from './server-routes';
import * as ffiLoader from './auth-api/ffiLoader';

const onWebviewPreload = ( store ) => webviewPreload( store );
Expand Down
39 changes: 4 additions & 35 deletions app/extensions/safe/server-routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
import { logger } from '$Logger';
import {
isRunningPackaged,
isRunningSpectronTestProcess,
isRunningSpectronTestProcessingPackagedApp
} from '$Constants';
import path from 'path';
import url from 'url';

import safeRoute from './safe';
import authRoute from './auth';

const setupRoutes = ( server, store ) => {
export const setupRoutes = ( server, store ): void => {
const routes = [safeRoute( store ), authRoute];

// TODO: Remove serving onf antd files when we can package
// webId manager properly.
server.get( /dummy/, ( request, res ) => {
const { link } = request.params;
const linkUrl = url.parse( link );

let safeFolder = isRunningPackaged
? '../extensions/safe/'
: './extensions/safe/';
safeFolder =
isRunningSpectronTestProcess &&
!isRunningSpectronTestProcessingPackagedApp
? 'extensions/safe/'
: safeFolder;

const antdIcons = path.resolve( __dirname, safeFolder, 'iconfont/' );
const finalPath = path.resolve( antdIcons, link );
res
.sendFile( finalPath, { confine: false } )
.header( 'Access-Control-Allow-Origin', '*' );
} );

routes.forEach( route => {
routes.forEach( ( route ) => {
try {
server.get( route.path, route.handler );
} catch ( e ) {
logger.error( 'Problem initing a route.', route, e );
} catch ( error ) {
logger.error( 'Problem initing a route.', route, error );
}
} );
};

export default setupRoutes;

0 comments on commit eb8ba8e

Please sign in to comment.