Skip to content

Commit

Permalink
Merge pull request #11 from firecamp-io/ui/storybook
Browse files Browse the repository at this point in the history
feat(ui): new table component
  • Loading branch information
Nishchit14 authored Nov 2, 2022
2 parents 9553fa4 + b1bf253 commit b99aac5
Show file tree
Hide file tree
Showing 116 changed files with 3,275 additions and 1,623 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"Auths"
"Auths",
"testid"
],
"[javascript]": {
"editor.formatOnSave": true,
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@babel/register": "^7.0.0",
"@types/ramda": "^0.28.15",
"babel-eslint": "^7.1.0",
"babel-loader": "^8.2.4",
"babel-plugin-add-module-exports": "^1.0.4",
Expand All @@ -68,6 +69,7 @@
"chai": "^3.5.0",
"circular-dependency-plugin": "^5.2.0",
"colors": "^1.4.0",
"compression-webpack-plugin": "^10.0.0",
"copy-webpack-plugin": "^10.2.4",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
Expand All @@ -90,7 +92,6 @@
"jest-css-modules-transform": "^4.4.2",
"lerna": "^5.4.3",
"lint-staged": "^12.3.7",
"monaco-editor-webpack-plugin": "4.2.0",
"node-polyfill-webpack-plugin": "^2.0.0",
"postcss-loader": "^6.2.1",
"prettier": "^2.6.2",
Expand Down Expand Up @@ -126,6 +127,7 @@
"prettify-xml": "^1.2.0",
"pug-cli": "^1.0.0-alpha6",
"querystring": "^0.2.1",
"ramda": "^0.28.0",
"react-file-drop": "^3.1.5"
},
"workspaces": [
Expand Down
2 changes: 1 addition & 1 deletion packages/firecamp-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"react-dnd": "^16.0.0",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "17.0.2",
"react-error-boundary": "^3.1.3",
"react-error-boundary": "^3.1.4",
"react-file-drop": "^3.1.5",
"react-ga": "^3.1.2",
"react-hook-form": "^6.8.1",
Expand Down
1 change: 0 additions & 1 deletion packages/firecamp-core/public/views/background.html

This file was deleted.

8 changes: 0 additions & 8 deletions packages/firecamp-core/public/views/background.pug

This file was deleted.

7 changes: 0 additions & 7 deletions packages/firecamp-core/public/views/identity.html

This file was deleted.

23 changes: 0 additions & 23 deletions packages/firecamp-core/public/views/identity.pug

This file was deleted.

7 changes: 0 additions & 7 deletions packages/firecamp-core/public/views/index.html

This file was deleted.

23 changes: 0 additions & 23 deletions packages/firecamp-core/public/views/index.pug

This file was deleted.

1 change: 0 additions & 1 deletion packages/firecamp-core/public/views/window.html

This file was deleted.

12 changes: 0 additions & 12 deletions packages/firecamp-core/public/views/window.pug

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ import { VscNewFolder } from '@react-icons/all-files/vsc/VscNewFolder';
// import { VscFileSymlinkFile } from '@react-icons/all-files/vsc/VscFileSymlinkFile';
import { VscFolder } from '@react-icons/all-files/vsc/VscFolder';

import { useTabStore } from '../../../store/tab';
import { useWorkspaceStore } from '../../../store/workspace';
import { WorkspaceCollectionsProvider } from './WorkspaceCollectionsProvider';
import treeRenderer from './treeItemRenderer';
import AppService from '../../../services/app';
import { RE } from '../../../types'
import { platformEmitter as emitter } from '../../../services/platform-emitter'
import { EPlatformTabs } from '../../../services/platform-emitter/events'

const Explorer: FC<any> = () => {
const environmentRef = useRef();
const treeRef = useRef();

const { openSavedTab } = useTabStore((s) => ({ openSavedTab: s.open.saved }), shallow);

let {
workspace,
explorer,
Expand Down Expand Up @@ -115,31 +114,30 @@ const Explorer: FC<any> = () => {
};

const _openReqInTab = (request: any) => {
// console.log(`node`, request);
openSavedTab(request);
console.log(`node`, request);
emitter.emit(EPlatformTabs.openSaved, request);
};

const _onNodeSelect = (nodeIdxs: TreeItemIndex[]) => {
// console.log({ nodeIdxs });
const _onNodeSelect = (nodeIndexes: TreeItemIndex[]) => {
// console.log({ nodeIndexes });
// return

let nodeIndex = nodeIdxs[0];
let colItem = [...collections, ...folders, ...requests].find(
let nodeIndex = nodeIndexes[0];
let nodeItem = [...collections, ...folders, ...requests].find(
(c) => c._meta.id == nodeIndex
);
// console.log({ colItem });
// console.log({ nodeItem });
if (
colItem &&
nodeItem &&
[
ERequestTypes.Rest,
ERequestTypes.GraphQL,
ERequestTypes.SocketIO,
ERequestTypes.WebSocket,
].includes(colItem.meta.type)
].includes(nodeItem.meta.type)
) {
// console.log({ colItem });

_openReqInTab(colItem);
// console.log({ nodeItem });
_openReqInTab(nodeItem);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,7 @@ const EnvironmentDD: FC<IEnvironmentDD> = ({
? 'Manage Workspace Environment'
: 'Manage Collection Environment',
onClick: () => {
// if (scope === EEnvironmentScope.Workspace) {
// F.appStore.environment.update.activeProject('global');
// F.ModalService.open(
// EModals.WORKSPACE_SETTING,
// EWorkspaceSettingTabs.ENVIRONMENT
// );
// } else {
// F.appStore.environment.update.activeProject(collectionId);
// F.ModalService.open(
// EModals.PROJECT_SETTING,
// ECollectionSettingTabs.ENVIRONMENT,
// { collectionId }
// );
// }

},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,7 @@ const WorkspaceEnvDD: FC<IWorkspaceEnvDD> = ({
? 'Manage Workspace Environment'
: 'Manage Collection Environment',
onClick: () => {
// if (scope === EEnvironmentScope.Workspace) {
// F.appStore.environment.update.activeProject('global');
// F.ModalService.open(
// EModals.WORKSPACE_SETTING,
// EWorkspaceSettingTabs.ENVIRONMENT
// );
// } else {
// F.appStore.environment.update.activeProject(id);
// F.ModalService.open(
// EModals.PROJECT_SETTING,
// ECollectionSettingTabs.ENVIRONMENT,
// { id }
// );
// }

},
},
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { FC, useState } from 'react';
import { FallbackProps } from 'react-error-boundary';
import { Modal } from '@firecamp/ui-kit';

import './ErrorPopup.sass';

const ErrorPopup: FC<IErrorPopup> = ({
message = `An unexpected error occurs.
We'll surely fix it out for you soon. We appreciate your patience.`,
onClose = () => {},
}) => {
// console.log(`in error popup`, message, isOpen)

const ErrorPopup: FC<FallbackProps> = ({ error }) => {
const bg = {
modal: {
background: '#c84a1782',
Expand All @@ -21,7 +16,7 @@ We'll surely fix it out for you soon. We appreciate your patience.`,

let _onClose = async () => {
// on close, refresh app
onClose();
// onClose();
// await initApp();
toggleOpen(false);
};
Expand All @@ -40,24 +35,10 @@ We'll surely fix it out for you soon. We appreciate your patience.`,
paddingRight: '60px',
}}
>
{message || ''}
{error.message || ''}
</div>
</Modal>
);
};

export default ErrorPopup;

/**
* Handle firecamp errors and show popup menu to instruct users about the same
*/
interface IErrorPopup {
/**
* Error message
*/
message?: string;
/**
* Close error popup
*/
onClose?: () => void;
}
Loading

0 comments on commit b99aac5

Please sign in to comment.