Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d460368
context manager tab
May 24, 2022
933d7d5
component boxes
May 25, 2022
31a5201
Merge pull request #1 from oslabs-beta/contextTab
huypham048 May 25, 2022
d81e577
Co-authored-by: Sal Saluga SalSaluga@gmail.com
huypham048 May 25, 2022
62211d0
finished creating layout for 3 tabs
huypham048 May 26, 2022
0cc13ea
Merge pull request #2 from oslabs-beta/contextTab
huypham048 May 26, 2022
600582e
connect to redux store
May 27, 2022
904f870
add data to redux form
May 27, 2022
5d9edde
added context to redux store
huypham048 May 28, 2022
1b0da98
context dropdown and key pair
May 28, 2022
dcfb38b
finished tab 1
huypham048 May 28, 2022
32887be
code cleanup and refactoring
ken-Bains May 28, 2022
9c85451
polished context creator
May 28, 2022
fc1eb42
refactoring code for contextApi. moved and renamed all files. deleted…
ken-Bains May 29, 2022
380fdc8
file renaming
ken-Bains May 30, 2022
aba81bc
css refractoring on create context form. Also clearing existing errors.
ken-Bains May 31, 2022
6065fa0
display tree frameworks working. added google charts dependancy to pa…
ken-Bains May 31, 2022
8db4e7c
added context dropdown for assignment tab
huypham048 May 31, 2022
eb11042
Merge branch 'display' of https://github.com/oslabs-beta/ReacType int…
huypham048 May 31, 2022
54b1e09
Display tab fully functioning.
ken-Bains May 31, 2022
7a82780
Merge branch 'display' of https://github.com/oslabs-beta/ReacType int…
huypham048 Jun 1, 2022
3e059ef
added component table
huypham048 Jun 1, 2022
6eeaa01
finished mvp
huypham048 Jun 2, 2022
34a6031
Merge pull request #3 from oslabs-beta/assignTab
huypham048 Jun 2, 2022
c8a1241
minor bug fixes on create tab. Created data table heading.
ken-Bains Jun 2, 2022
ccf3ca4
delete context
Jun 9, 2022
b5d0cef
Merge pull request #4 from oslabs-beta/deleteContext
BiancaPicasso Jun 9, 2022
70f8c65
adding delete context functionality
huypham048 Jun 10, 2022
f977eaf
Merge branch 'devContext' of https://github.com/oslabs-beta/ReacType …
huypham048 Jun 10, 2022
fb568b5
added Jest testing for context slice
huypham048 Jun 11, 2022
387a1d7
modified test scritp
huypham048 Jun 13, 2022
d6bb891
integrated code preview functionality for adding context
huypham048 Jun 15, 2022
2494646
Merge pull request #7 from oslabs-beta/huyBranch
BiancaPicasso Jun 15, 2022
625c609
finshed OSP, ready for launch
huypham048 Jun 15, 2022
9bc2c48
finalized README and CHANGELOG
huypham048 Jun 15, 2022
00ea81e
Merge pull request #8 from oslabs-beta/huyBranch
BiancaPicasso Jun 16, 2022
dc5b7e8
Merge pull request #9 from oslabs-beta/devContext
BiancaPicasso Jun 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGE_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
<h1 align="center">ReacType Change Log</h1>
</p>

**Version 12.0.0 Changes**

-Context Visualizer: You can now visually see what component is consuming which context. As you click on the interactive tree, the component assigned to the context will be revealed.
-React 18: Updated to React 18
-Export Feature: Created an exportable context file, integrated with original codebase.
Ready to go code: Added boilerplate codes to components based on which contexts they are consuming.

**A note to future contributors**

Attempted to implement Facebook and Google OAuth via passport but as of Electron’s current version, neither of them not compatible with electron.

**Version 11.0.0 Changes:**

- Added Next.js functionality
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ How to use
- **Start a project (only after registration)**: Registered users can create a new project and select whether they want their project to be a Next.js, Gatsby.js, or classic React project. Also, registered users can save projects to return to them at a later time.
- **Add Components**: Create components on the right panel. Components can be associated with a route, or they can be used within other components.
- **Delete Components**: Delete components after focusing on them in the right panel. Be careful when deleting components: Upon deletion, all instances of the component will be removed within the application/project.
- **Context Visualizer**: You can now visually see what component is consuming which context. As you click on the interactive tree, the component assigned to the context will be revealed.
- **Context Code Preview**: Once contexts have been assigned to the desired components, click ‘Export’ to incorporate context into your existing codebase so you can save it as a file.
- **Ready to go code**: Added boilerplate codes to components based on which contexts they are consuming.
- **Add Custom Elements**: Create custom elements or add provided HTML elements into the application. Once the project is exported, the HTML tags generated in the code preview will function as expected. You can specify functionality for custom elements in the code preview. The tutorial on HTML Elements explains more on how to do this.
- **Delete Custom HTML Elements**: Delete custom HTML elements by clicking on the ‘X’ button adjacent to the element. Be careful when deleting custom elements: All instances of the element will be deleted within the application/project.
- **Create Instances on the Canvas**: Each component has its own canvas. Add an element to a component by dragging it onto the canvas. Div components are arbitrarily nestable and useful for complex layouts. Next.js and Gatsby.js projects have Link components to enable client-side navigation to other routes.
Expand Down Expand Up @@ -107,6 +110,8 @@ How to use

[Anthony Torrero](https://www.linkedin.com/in/anthony-torrero-4b8798159/) [@Anthonytorrero](https://github.com/Anthonytorrero)

[Bianca Picasso](linkedin.com/in/bianca-picasso) [@BiancaPicasso](https://github.com/BiancaPicasso)

[Brian Han](https://www.linkedin.com/in/brianjisoohan/) [@brianjshan](https://github.com/brianjshan)

[Bryan Chau](https://www.linkedin.com/in/chaubryan1/) [@bchauu](https://github.com/bchauu)
Expand Down Expand Up @@ -139,6 +144,8 @@ How to use

[Fredo Chen](https://www.linkedin.com/in/fredochen/) [@fredosauce](https://github.com/fredosauce)

[Huy Pham](linkedin.com/in/huypham048) [@huypham048](https://github.com/huypham048)

[Jonathan Calvo Ramirez](https://www.linkedin.com/in/jonathan-calvo/) [@jonocr](https://github.com/jonocr)

[Jesse Zuniga](https://linkedin.com/in/jesse-zuniga) [@jzuniga206](https://github.com/jzuniga206)
Expand All @@ -149,6 +156,8 @@ How to use

[Katrina Henderson](https://www.linkedin.com/in/katrinahenderson/) [@kchender](https://github.com/kchender)

[Ken Bains](linkedin.com/in/ken-bains) [@ken-Bains](https://github.com/ken-Bains)

[Kevin Park](https://www.linkedin.com/in/xkevinpark/) [@xkevinpark](https://github.com/xkevinpark)

[Khuong Nguyen](https://www.linkedin.com/in/khuong-nguyen/) [@khuongdn16](https://github.com/khuongdn16)
Expand All @@ -171,6 +180,8 @@ How to use

[Ron Fu](https://www.linkedin.com/in/ronfu)[@rfvisuals](https://github.com/rfvisuals)

[Salvatore Saluga](linkedin.com/in/salvatore-saluga) [@SalSaluga](https://github.com/SalSaluga)

[Sean Sadykoff](https://www.linkedin.com/in/sean-sadykoff/) [@sean1292](https://github.com/sean1292)

[Shana Hoehn](https://www.linkedin.com/in/shana-hoehn-70297b169/) [@slhoehn](https://github.com/slhoehn)
Expand Down
165 changes: 165 additions & 0 deletions __tests__/contextReducer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
import subject from '../app/src/redux/reducers/slice/contextReducer';

describe('Context Reducer', () => {
let state;

beforeEach(() => {
state = {
allContext: []
};
});

describe('default state', () => {
it('should return a default state when given an undefined input', () => {
expect(subject(undefined, { type: undefined })).toEqual(state);
});
});

describe('unrecognized action types', () => {
it('should return the original state without any duplication', () => {
expect(subject(state, { type: 'REMOVE_STATE' })).toBe(state);
});
});

describe('ADD_CONTEXT', () => {
const action = {
type: 'ADD_CONTEXT',
payload: {
name: 'Theme Context'
}
};

it('adds a context', () => {
const { allContext } = subject(state, action);
expect(allContext[0]).toEqual({
name: 'Theme Context',
values: [],
components: []
});
});

it('returns a state object not strictly equal to the original', () => {
const newState = subject(state, action);
expect(newState).not.toBe(state);
});

it('should immutably update the nested state object', () => {
const { allContext } = subject(state, action);
expect(allContext).not.toBe(state.allContext);
});
});

describe('ADD_CONTEXT_VALUES', () => {
beforeEach(() => {
state = {
allContext: [
{
name: 'Theme Context',
values: [],
components: []
}
]
};
});

const action = {
type: 'ADD_CONTEXT_VALUES',
payload: {
name: 'Theme Context',
inputKey: 'Theme Color',
inputValue: 'Dark'
}
};

it('adds a key-value pair to values array of the specified context', () => {
const { allContext } = subject(state, action);
expect(allContext[0].values.length).toEqual(1);
expect(allContext[0].values[0].key).toEqual('Theme Color');
expect(allContext[0].values[0].value).toEqual('Dark');
});

it('includes an allContext not strictly equal to the original', () => {
const { allContext } = subject(state, action);

expect(allContext).not.toBe(state.allContext);
});
});

describe('DELETE CONTEXT', () => {
let action;
beforeEach(() => {
state = {
allContext: [
{
name: 'Theme Context',
values: [],
components: []
},
{
name: 'To be deleted',
values: [],
components: []
}
]
};

action = {
type: 'DELETE_CONTEXT',
payload: {
name: 'Theme Context'
}
};
});

it('removes specified context from the state', () => {
const { allContext } = subject(state, action);

expect(allContext.length).toEqual(1);
});

it('includes an allContext not strictly equal to the original', () => {
const { allContext } = subject(state, action);

expect(allContext).not.toBe(state.allContext);
});
});

describe('ADD_COMPONENT_TO_CONTEXT', () => {
beforeEach(() => {
state = {
allContext: [
{
name: 'Theme Context',
values: [],
components: []
}
]
};
});

const action = {
type: 'ADD_COMPONENT_TO_CONTEXT',
payload: {
context: {
name: 'Theme Context'
},
component: {
name: 'Main Component'
}
}
};

it('adds a new component to the specified context', () => {
const { allContext } = subject(state, action);

expect(allContext[0].components.length).toEqual(1);
expect(allContext[0].components[0]).toEqual('Main Component');
});

it('includes an allContext not strictly equal to the original', () => {
const { allContext } = subject(state, action);

expect(allContext).not.toBe(state.allContext);
});
});
});
165 changes: 165 additions & 0 deletions __tests__/contextReducer.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
import subject from '../app/src/redux/reducers/slice/contextReducer';

describe('Context Reducer', () => {
let state;

beforeEach(() => {
state = {
allContext: []
};
});

describe('default state', () => {
it('should return a default state when given an undefined input', () => {
expect(subject(undefined, { type: undefined })).toEqual(state);
});
});

describe('unrecognized action types', () => {
it('should return the original state without any duplication', () => {
expect(subject(state, { type: 'REMOVE_STATE' })).toBe(state);
});
});

describe('ADD_CONTEXT', () => {
const action = {
type: 'ADD_CONTEXT',
payload: {
name: 'Theme Context'
}
};

it('adds a context', () => {
const { allContext } = subject(state, action);
expect(allContext[0]).toEqual({
name: 'Theme Context',
values: [],
components: []
});
});

it('returns a state object not strictly equal to the original', () => {
const newState = subject(state, action);
expect(newState).not.toBe(state);
});

it('should immutably update the nested state object', () => {
const { allContext } = subject(state, action);
expect(allContext).not.toBe(state.allContext);
});
});

describe('ADD_CONTEXT_VALUES', () => {
beforeEach(() => {
state = {
allContext: [
{
name: 'Theme Context',
values: [],
components: []
}
]
};
});

const action = {
type: 'ADD_CONTEXT_VALUES',
payload: {
name: 'Theme Context',
inputKey: 'Theme Color',
inputValue: 'Dark'
}
};

it('adds a key-value pair to values array of the specified context', () => {
const { allContext } = subject(state, action);
expect(allContext[0].values.length).toEqual(1);
expect(allContext[0].values[0].key).toEqual('Theme Color');
expect(allContext[0].values[0].value).toEqual('Dark');
});

it('includes an allContext not strictly equal to the original', () => {
const { allContext } = subject(state, action);

expect(allContext).not.toBe(state.allContext);
});
});

describe('DELETE CONTEXT', () => {
let action;
beforeEach(() => {
state = {
allContext: [
{
name: 'Theme Context',
values: [],
components: []
},
{
name: 'To be deleted',
values: [],
components: []
}
]
};

action = {
type: 'DELETE_CONTEXT',
payload: {
name: 'Theme Context'
}
};
});

it('removes specified context from the state', () => {
const { allContext } = subject(state, action);

expect(allContext.length).toEqual(1);
});

it('includes an allContext not strictly equal to the original', () => {
const { allContext } = subject(state, action);

expect(allContext).not.toBe(state.allContext);
});
});

describe('ADD_COMPONENT_TO_CONTEXT', () => {
beforeEach(() => {
state = {
allContext: [
{
name: 'Theme Context',
values: [],
components: []
}
]
};
});

const action = {
type: 'ADD_COMPONENT_TO_CONTEXT',
payload: {
context: {
name: 'Theme Context'
},
component: {
name: 'Main Component'
}
}
};

it('adds a new component to the specified context', () => {
const { allContext } = subject(state, action);

expect(allContext[0].components.length).toEqual(1);
expect(allContext[0].components[0]).toEqual('Main Component');
});

it('includes an allContext not strictly equal to the original', () => {
const { allContext } = subject(state, action);

expect(allContext).not.toBe(state.allContext);
});
});
});
Loading