chore: cleanup

This commit is contained in:
Anoop M D 2022-10-14 01:59:24 +05:30
parent 410bc70318
commit d49eb4df33
3 changed files with 0 additions and 177 deletions

View File

@ -93,16 +93,6 @@ const Wrapper = styled.div`
}
}
}
&.has-chevrons {
ul {
li:first-child {
.tab-container {
border-left: 1px solid #dcdcdc;
}
}
}
}
`;
export default Wrapper;

View File

@ -1,103 +0,0 @@
const collection = {
"id": uuid(),
"name": "spacex",
"items": [
{
"id": uuid(),
"name": "Launches",
"depth": 1,
"items": [
{
"id": uuid(),
"depth": 2,
"name": "Capsules",
"request": {
"type": "graphql",
"url": "https://api.spacex.land/graphql/",
"method": "POST",
"headers": [],
"body": {
"mimeType": "application/graphql",
"graphql": {
"query": "{\n launchesPast(limit: 10) {\n mission_name\n launch_date_local\n launch_site {\n site_name_long\n }\n links {\n article_link\n video_link\n }\n rocket {\n rocket_name\n first_stage {\n cores {\n flight\n core {\n reuse_count\n status\n }\n }\n }\n second_stage {\n payloads {\n payload_type\n payload_mass_kg\n payload_mass_lbs\n }\n }\n }\n ships {\n name\n home_port\n image\n }\n }\n}",
"variables": ""
}
}
},
"response": null
},
{
"id": uuid(),
"depth": 2,
"name": "Missions",
"request": {
"type": "graphql",
"url": "https://api.spacex.land/graphql/",
"method": "POST",
"headers": [],
"body": {
"mimeType": "application/graphql",
"graphql": {
"query": "{\n launches {\n launch_site {\n site_id\n site_name\n }\n launch_success\n }\n}",
"variables": ""
}
}
},
"response": null
}
]
}
]
};
const collection2 = {
"id": uuid(),
"name": "notebase",
"items": [
{
"id": uuid(),
"name": "Notes",
"depth": 1,
"items": [
{
"id": uuid(),
"depth": 2,
"name": "Create",
"request": {
"type": "graphql",
"url": "https://api.spacex.land/graphql/",
"method": "POST",
"headers": [],
"body": {
"mimeType": "application/graphql",
"graphql": {
"query": "{\n launchesPast(limit: 10) {\n mission_name\n launch_date_local\n launch_site {\n site_name_long\n }\n links {\n article_link\n video_link\n }\n rocket {\n rocket_name\n first_stage {\n cores {\n flight\n core {\n reuse_count\n status\n }\n }\n }\n second_stage {\n payloads {\n payload_type\n payload_mass_kg\n payload_mass_lbs\n }\n }\n }\n ships {\n name\n home_port\n image\n }\n }\n}",
"variables": ""
}
}
},
"response": null
},
{
"id": uuid(),
"depth": 2,
"name": "Update",
"request": {
"type": "graphql",
"url": "https://api.spacex.land/graphql/",
"method": "POST",
"headers": [],
"body": {
"mimeType": "application/graphql",
"graphql": {
"query": "{\n launches {\n launch_site {\n site_id\n site_name\n }\n launch_success\n }\n}",
"variables": ""
}
}
},
"response": null
}
]
}
]
};

View File

@ -1,64 +0,0 @@
import produce from 'immer';
import union from 'lodash/union';
import find from 'lodash/find';
import actions from './actions';
import {
flattenItems,
findItem,
cloneItem,
updateRequestTabAsChanged,
findCollectionByUid
} from './utils';
const reducer = (state, action) => {
switch (action.type) {
case actions.IDB_CONNECTION_READY: {
return produce(state, (draft) => {
draft.idbConnection = action.connection;
});
}
case actions.REQUEST_GQL_QUERY_CHANGED: {
return produce(state, (draft) => {
const collection = findCollectionByUid(draft.collections, action.collectionUid);
if(collection) {
let flattenedItems = flattenItems(collection.items);
let item = findItem(flattenedItems, action.requestTab.id);
if(item) {
item.request.body.graphql.query = action.query;
}
}
});
}
case actions.ADD_NEW_GQL_REQUEST: {
return produce(state, (draft) => {
const uid = uuid();
draft.requestTabs.push({
uid: uid,
name: 'New Tab',
type: 'graphql',
request: {
method: 'GET',
url: 'https://api.spacex.land/graphql/',
body: {
graphql: {
query: '{}'
}
}
},
collectionUid: null
});
draft.activeRequestTabUid = uid;
});
}
default: {
return state;
}
}
}
export default reducer;