Skip to content

Commit

Permalink
remove launch date field (#305)
Browse files Browse the repository at this point in the history
* remove launch date field

* refactor test

* bump version -> 1.0.74
  • Loading branch information
roymoran authored Oct 6, 2020
1 parent 7d9c898 commit 4c1b197
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 54 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pub",
"version": "1.0.73",
"version": "1.0.74",
"private": true,
"scripts": {
"build": "gatsby build --prefix-paths",
Expand Down
1 change: 0 additions & 1 deletion src/api/types/project-detailed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export interface ProjectDetailed {
communicationPlatformUrl: string;
lookingForMembers: boolean;
communicationPlatform: string;
launchDate: Date;
projectTechnologies: ProjectTechnology[];
projectUsers: ProjectUserDetailed[];
projectCollaboratorSuggestions: ProjectCollaboratorSuggestion[];
Expand Down
1 change: 0 additions & 1 deletion src/api/types/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface Project {
id?: string;
name: string;
description: string;
launchDate: Date;
repositoryUrl: string;
communicationPlatformUrl: string;
lookingForMembers: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ export const ProjectWorkspace: FC<ProjectWorkspaceProps> = (props) => {
const project = response.data as ProjectDetailed;
const projectOwner = project.projectUsers.find((p) => p.isOwner);

setProject(project);
setProjectOwner(projectOwner);
setMarkdownDescription(project.extendedMarkdownDescription);

if (project.communicationPlatform !== 'other') {
// workspace does not have associated workspace app if
// project.communicationPlatform so don't execute this api
Expand All @@ -198,10 +202,6 @@ export const ProjectWorkspace: FC<ProjectWorkspaceProps> = (props) => {
setWorkspaceInfo(workspaceInfo);
}

setProject(project);
setProjectOwner(projectOwner);
setMarkdownDescription(project.extendedMarkdownDescription);

if (!UserAuthHelper.isUserAuthenticated()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ test('display project details', () => {
const project: Project = {
name: 'Grocerhub',
description: 'Grocery list application',
launchDate: new Date(),
repositoryUrl: '',
communicationPlatformUrl: 'https://slack.com',
lookingForMembers: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test('renders correctly', () => {
{
name: 'Awesome Project',
description: '',
launchDate: new Date(),
repositoryUrl: '',
communicationPlatform: '',
communicationPlatformUrl: '',
Expand Down
8 changes: 1 addition & 7 deletions src/components/shared/form/__tests__/create-project.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ beforeEach(() => {
});

test('shows all the required inputs', async () => {
expect.assertions(10);
expect.assertions(8);

const { findByLabelText } = render(
<MockThemeProvider>
Expand All @@ -37,10 +37,6 @@ test('shows all the required inputs', async () => {
selector: 'input',
});

const launchDate = await findByLabelText(/launch date/i, {
selector: 'input',
});

const commPlatform = await findByLabelText(/workspace/i, {
selector: 'input',
});
Expand All @@ -52,8 +48,6 @@ test('shows all the required inputs', async () => {
expect(description).toBeInTheDocument();
expect(projectRepo).toBeInTheDocument();
expect(projectRepo).toHaveAttribute('type', 'text');
expect(launchDate).toBeInTheDocument();
expect(launchDate).toHaveAttribute('type', 'date');
expect(commPlatform).toBeInTheDocument();
expect(commPlatform).toHaveAttribute('type', 'text');
expect(technologies).toBeInTheDocument();
Expand Down
21 changes: 1 addition & 20 deletions src/components/shared/form/create-project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ interface FormInput {
pDesc: FormValue;
pTech: FormValue<ProjectTechnology[]>;
pRepo: FormValue;
pLaunch: FormValue;
pComm: FormValue;
[key: string]: FormValue<FormInputIndexPropType>;
}
Expand All @@ -91,7 +90,6 @@ export const CreateProjectForm: FC<CreateProjectFormProps> = () => {
pDesc: { val: '', required: true },
pTech: { val: [], required: true },
pRepo: { val: '', required: false },
pLaunch: { val: '', required: true },
pComm: { val: '', required: true },
});

Expand Down Expand Up @@ -168,15 +166,14 @@ export const CreateProjectForm: FC<CreateProjectFormProps> = () => {
const handleClick = async () => {
const api = ServiceResolver.apiResolver();

const { pName, pDesc, pTech, pRepo, pLaunch, pComm } = formInputs;
const { pName, pDesc, pTech, pRepo, pComm } = formInputs;
const errors = validation.checkValidation(formInputs);

if (errors.length) return setFormErrors([...errors]);

const formData: Project = {
name: pName.val,
description: pDesc.val,
launchDate: new Date(pLaunch.val),
repositoryUrl: pRepo.val,
communicationPlatformUrl: pComm.val,
communicationPlatform: getPlatformName(),
Expand Down Expand Up @@ -267,22 +264,6 @@ export const CreateProjectForm: FC<CreateProjectFormProps> = () => {
<FormHint>
Share your project repo (GitHub, GitLab etc), optional
</FormHint>
<FormLabel htmlFor="launch-date">Launch Date</FormLabel>
<FormInput
name="pLaunch"
id="launch-date"
type="date"
onChange={handleChange}
onBlur={handleBlur}
hasError={formErrors.includes('pLaunch')}
/>
{formErrors.includes('pLaunch') && (
<Message variant="error" value="Launch Date Required" />
)}
<FormHint>
Keep you and your team accountable with a launch date
</FormHint>

<FormLabel htmlFor="communication-platform">
Workspace Invitation Link
</FormLabel>
Expand Down
1 change: 0 additions & 1 deletion src/mocks/responses/create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const createProject: ApiResponse<Project> = {
data: {
name: '',
description: '',
launchDate: new Date(),
repositoryUrl: '',
communicationPlatform: '',
communicationPlatformUrl: '',
Expand Down
1 change: 0 additions & 1 deletion src/mocks/responses/get-project-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const getProject: ApiResponse<ProjectDetailed> = {
description:
'A frontend to streamline the starting and joining of projects on the project unicorn slack team.',
extendedMarkdownDescription: '**Bold description**',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: 'https://slack.com',
lookingForMembers: true,
Expand Down
14 changes: 0 additions & 14 deletions src/mocks/responses/get-projects-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Project Unicorn UI',
description:
'A frontend to streamline the starting and joining of projects on the project unicorn slack team. ',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: 'https://slack.com',
lookingForMembers: true,
Expand Down Expand Up @@ -78,7 +77,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Puzzle',
description:
'Puzzle is a highly customizable CMS that allows you to build websites from scratch without any code.',
launchDate: new Date(),
repositoryUrl: 'https://github.com/projectunic0rn/Puzzle',
communicationPlatformUrl: 'https://discordapp.com',
lookingForMembers: true,
Expand Down Expand Up @@ -145,7 +143,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Motivware',
description:
'Motivware is an open source customer relationship management application to assist auto-mechanic shops with organization and business process improvements. ',
launchDate: new Date(),
repositoryUrl: 'https://github.com/projectunic0rn/Motivware',
communicationPlatformUrl: 'https://slack.com',
lookingForMembers: true,
Expand Down Expand Up @@ -173,7 +170,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Travel Map',
description:
'Full-screen, modern map which lets you see where you and your friends have been or plan to go in the world. ',
launchDate: new Date(),
repositoryUrl: 'https://github.com/projectunic0rn/Travel-Map',
communicationPlatformUrl: 'https://slack.com',
lookingForMembers: true,
Expand Down Expand Up @@ -289,7 +285,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Remote Hackathon',
description:
'Software to help organizers setup and execute a hackathon for 100% remote teams and communities. ',
launchDate: new Date(),
repositoryUrl: 'https://github.com/projectunic0rn/remote-hackathon',
communicationPlatformUrl: 'https://discord.gg',
lookingForMembers: true,
Expand Down Expand Up @@ -379,7 +374,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Stjorn',
description:
"Stjorn is (actually will be) a task management app. It's built with microservices written in various languages.\nApp is using many different technologies, at this moment:\nFrontend:\n-Vue.js\n-Apollo\n-GraphQL\nBackend:\nAPI Gateway:\n-graphql-tools (apollo)\n-Node.js\nAuth-service:\n-Golang\n-Ginkgo (test framework)\n-REST\nTask-management-service:\n-Ruby on Rails\n-GraphQL\n-Rspec (test framework)\nUser-service:\n-Ruby on Rails\n-GraphQL\n-Rspec (test framework)\nThere are a lot of services without choosen language, including notification-service and mailing-service, later maybe also chat-service. If you want to contribute project you will probably find whatever you are looking for, even if you don't have skills you are thinking we are looking for. At this moment, when I write these features we have 5 people in project, 4 programmers and one UI/UX designer.\ngithub: github.com/stjorn",
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand Down Expand Up @@ -407,7 +401,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Action Events',
description:
'Life Planner to get your life on track and measure your progress',
launchDate: new Date(),
repositoryUrl: 'https://github.com/projectunic0rn/action-events',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand Down Expand Up @@ -473,7 +466,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Detrashed',
description:
'A website where visitors can view, create, and join meetups planned to ‘detrash’ (cleanup) an area.',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand All @@ -494,7 +486,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Warmr',
description:
'Mobile app to encourage people to find and interact with people/places/things, by allowing users to create location based, categorical, and social alerts.',
launchDate: new Date(),
repositoryUrl: 'https://github.com/projectunic0rn/warmr',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand Down Expand Up @@ -529,7 +520,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Petomo',
description:
"A web app to streamline pet adoption process. With good UI/UX and one centralized location pets will have a better reach and better chances of going to a loving owner. (psst it's Tinder for pet adoption)",
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand Down Expand Up @@ -578,7 +568,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Nuevo Foundation ',
description:
'Nuevo Foundation is a 501c3 non-profit. One of the challenges underserved communities face is the unequal distribution of opportunity. With Nuevo Foundation, we are making an effort to expose students in these communities to careers in STEM, and give them the opportunity to be excited about technology. The site is currently active at https://www.nuevofoundation.org. ',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand All @@ -599,7 +588,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'F-Droid Kotlin Apps',
description:
'An app that lets you find android apps listed in F-Droid that use the Kotlin programming language.',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand Down Expand Up @@ -627,7 +615,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'FoundIT',
description:
'FoundIT allows users to post lost or found items in hope that it gets returned back to its original owners.',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand Down Expand Up @@ -655,7 +642,6 @@ export const getProjects: ApiResponse<Project[]> = {
name: 'Mentrship',
description:
'A mentoring platform to connect industry professionals with students.',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: '',
lookingForMembers: true,
Expand Down
1 change: 0 additions & 1 deletion src/mocks/responses/updated-project-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const updatedProject: ApiResponse<ProjectDetailed> = {
description:
'A frontend to streamline the starting and joining of projects on the project unicorn slack team.',
extendedMarkdownDescription: '**Bold description**',
launchDate: new Date(),
repositoryUrl: 'null',
communicationPlatformUrl: 'https://slack.com',
lookingForMembers: true,
Expand Down

0 comments on commit 4c1b197

Please sign in to comment.