Skip to content

Commit ee6f738

Browse files
authored
Merge pull request #67 from tsully/testfolder
Final release 3.0 clean-up
2 parents de66102 + 6941c98 commit ee6f738

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed
File renamed without changes.
File renamed without changes.

app/src/components/left/ComponentPanelRoutingItem.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,22 @@ const ComponentPanelRoutingItem: React.FC<{}> = () => {
2222
const [route, setRoute] = useState(navigableComponents[0]);
2323

2424
// TODO: Add a useMemo so that this isn't recalculated on every render
25-
const routeId = state.components.find(comp => comp.name === route).id;
25+
let routeId;
26+
// check if the component in the drop down still references an existing component
27+
const referencedComponent = state.components.find(
28+
comp => comp.name === route
29+
);
30+
// if so, set the route id for that component to the id of the referenced compnent
31+
if (referencedComponent) routeId = referencedComponent.id;
32+
// otherwise, set the component name and and id to the root component
33+
else {
34+
setRoute(state.components[0].name);
35+
routeId = 1;
36+
}
2637

2738
const handleRouteChange = event => {
2839
setRoute(event.target.value);
2940
};
30-
3141

3242
// useDrag hook allows components in left panel to be drag source
3343

app/src/components/right/ProjectManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const ProjectManager = () => {
164164
) : null}
165165
{!state.name && state.isLoggedIn ? (
166166
<p style={{ color: 'white' }}>
167-
Project will not be saved until it is named!!!
167+
Select "Save project as" to create and save a project
168168
</p>
169169
) : null}
170170

app/src/helperFunctions/projectGetSaveDel.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export const deleteProject = (project: any): Promise<Object> => {
6666
})
6767
.then(res => res.json())
6868
.then(data => {
69-
console.log('deleted project at end of fetch', data);
7069
return data;
7170
})
7271
.catch(err => console.log(`Error deleting project ${err}`));

server/controllers/projectController.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ projectController.getProjects = (req, res, next) => {
5555
// delete project from database **currently not integrated into app**
5656

5757
projectController.deleteProject = (req, res, next) => {
58-
console.log('In delete projects controller');
5958
// pull project name and userId from req.body
6059
const { name, userId } = req.body;
6160
Projects.findOneAndDelete({ name, userId }, (err, deleted) => {

0 commit comments

Comments
 (0)