From 4c1b1979b8c4aa513a3547dc738c514d5265b0a6 Mon Sep 17 00:00:00 2001 From: Roy Moran Date: Tue, 6 Oct 2020 01:17:21 -0500 Subject: [PATCH] remove launch date field (#305) * remove launch date field * refactor test * bump version -> 1.0.74 --- package-lock.json | 2 +- package.json | 2 +- src/api/types/project-detailed.ts | 1 - src/api/types/project.ts | 1 - .../project-workspace/project-workspace.tsx | 8 +++---- .../projects-gallery/__tests__/card.spec.tsx | 1 - .../projects-gallery/__tests__/panel.spec.tsx | 1 - .../form/__tests__/create-project.spec.tsx | 8 +------ src/components/shared/form/create-project.tsx | 21 +------------------ src/mocks/responses/create-project.ts | 1 - src/mocks/responses/get-project-response.ts | 1 - src/mocks/responses/get-projects-response.ts | 14 ------------- .../responses/updated-project-response.ts | 1 - 13 files changed, 8 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index 54ec639e0..a04670444 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pub", - "version": "1.0.73", + "version": "1.0.74", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6447e07e3..e778431cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pub", - "version": "1.0.73", + "version": "1.0.74", "private": true, "scripts": { "build": "gatsby build --prefix-paths", diff --git a/src/api/types/project-detailed.ts b/src/api/types/project-detailed.ts index 9f4d1912b..6f2ddec7c 100644 --- a/src/api/types/project-detailed.ts +++ b/src/api/types/project-detailed.ts @@ -11,7 +11,6 @@ export interface ProjectDetailed { communicationPlatformUrl: string; lookingForMembers: boolean; communicationPlatform: string; - launchDate: Date; projectTechnologies: ProjectTechnology[]; projectUsers: ProjectUserDetailed[]; projectCollaboratorSuggestions: ProjectCollaboratorSuggestion[]; diff --git a/src/api/types/project.ts b/src/api/types/project.ts index 51cf8e423..0b523de23 100644 --- a/src/api/types/project.ts +++ b/src/api/types/project.ts @@ -5,7 +5,6 @@ export interface Project { id?: string; name: string; description: string; - launchDate: Date; repositoryUrl: string; communicationPlatformUrl: string; lookingForMembers: boolean; diff --git a/src/components/projects/project-workspace/project-workspace.tsx b/src/components/projects/project-workspace/project-workspace.tsx index 3b9f690b8..05fae12a6 100644 --- a/src/components/projects/project-workspace/project-workspace.tsx +++ b/src/components/projects/project-workspace/project-workspace.tsx @@ -188,6 +188,10 @@ export const ProjectWorkspace: FC = (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 @@ -198,10 +202,6 @@ export const ProjectWorkspace: FC = (props) => { setWorkspaceInfo(workspaceInfo); } - setProject(project); - setProjectOwner(projectOwner); - setMarkdownDescription(project.extendedMarkdownDescription); - if (!UserAuthHelper.isUserAuthenticated()) { return; } diff --git a/src/components/projects/projects-gallery/__tests__/card.spec.tsx b/src/components/projects/projects-gallery/__tests__/card.spec.tsx index a38a09990..3577a9ca2 100644 --- a/src/components/projects/projects-gallery/__tests__/card.spec.tsx +++ b/src/components/projects/projects-gallery/__tests__/card.spec.tsx @@ -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, diff --git a/src/components/projects/projects-gallery/__tests__/panel.spec.tsx b/src/components/projects/projects-gallery/__tests__/panel.spec.tsx index 2eb88b09f..2a7d1d9cb 100644 --- a/src/components/projects/projects-gallery/__tests__/panel.spec.tsx +++ b/src/components/projects/projects-gallery/__tests__/panel.spec.tsx @@ -19,7 +19,6 @@ test('renders correctly', () => { { name: 'Awesome Project', description: '', - launchDate: new Date(), repositoryUrl: '', communicationPlatform: '', communicationPlatformUrl: '', diff --git a/src/components/shared/form/__tests__/create-project.spec.tsx b/src/components/shared/form/__tests__/create-project.spec.tsx index 0001ea3d8..5838fffc7 100644 --- a/src/components/shared/form/__tests__/create-project.spec.tsx +++ b/src/components/shared/form/__tests__/create-project.spec.tsx @@ -17,7 +17,7 @@ beforeEach(() => { }); test('shows all the required inputs', async () => { - expect.assertions(10); + expect.assertions(8); const { findByLabelText } = render( @@ -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', }); @@ -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(); diff --git a/src/components/shared/form/create-project.tsx b/src/components/shared/form/create-project.tsx index fdf1d6f61..04643032c 100644 --- a/src/components/shared/form/create-project.tsx +++ b/src/components/shared/form/create-project.tsx @@ -78,7 +78,6 @@ interface FormInput { pDesc: FormValue; pTech: FormValue; pRepo: FormValue; - pLaunch: FormValue; pComm: FormValue; [key: string]: FormValue; } @@ -91,7 +90,6 @@ export const CreateProjectForm: FC = () => { pDesc: { val: '', required: true }, pTech: { val: [], required: true }, pRepo: { val: '', required: false }, - pLaunch: { val: '', required: true }, pComm: { val: '', required: true }, }); @@ -168,7 +166,7 @@ export const CreateProjectForm: FC = () => { 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]); @@ -176,7 +174,6 @@ export const CreateProjectForm: FC = () => { const formData: Project = { name: pName.val, description: pDesc.val, - launchDate: new Date(pLaunch.val), repositoryUrl: pRepo.val, communicationPlatformUrl: pComm.val, communicationPlatform: getPlatformName(), @@ -267,22 +264,6 @@ export const CreateProjectForm: FC = () => { Share your project repo (GitHub, GitLab etc), optional - Launch Date - - {formErrors.includes('pLaunch') && ( - - )} - - Keep you and your team accountable with a launch date - - Workspace Invitation Link diff --git a/src/mocks/responses/create-project.ts b/src/mocks/responses/create-project.ts index 33a042bdc..6bd742c62 100644 --- a/src/mocks/responses/create-project.ts +++ b/src/mocks/responses/create-project.ts @@ -5,7 +5,6 @@ export const createProject: ApiResponse = { data: { name: '', description: '', - launchDate: new Date(), repositoryUrl: '', communicationPlatform: '', communicationPlatformUrl: '', diff --git a/src/mocks/responses/get-project-response.ts b/src/mocks/responses/get-project-response.ts index ff6942a8b..2caf4c2a1 100644 --- a/src/mocks/responses/get-project-response.ts +++ b/src/mocks/responses/get-project-response.ts @@ -8,7 +8,6 @@ export const getProject: ApiResponse = { 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, diff --git a/src/mocks/responses/get-projects-response.ts b/src/mocks/responses/get-projects-response.ts index 07f0d0a19..6bb2d794d 100644 --- a/src/mocks/responses/get-projects-response.ts +++ b/src/mocks/responses/get-projects-response.ts @@ -8,7 +8,6 @@ export const getProjects: ApiResponse = { 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, @@ -78,7 +77,6 @@ export const getProjects: ApiResponse = { 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, @@ -145,7 +143,6 @@ export const getProjects: ApiResponse = { 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, @@ -173,7 +170,6 @@ export const getProjects: ApiResponse = { 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, @@ -289,7 +285,6 @@ export const getProjects: ApiResponse = { 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, @@ -379,7 +374,6 @@ export const getProjects: ApiResponse = { 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, @@ -407,7 +401,6 @@ export const getProjects: ApiResponse = { 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, @@ -473,7 +466,6 @@ export const getProjects: ApiResponse = { 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, @@ -494,7 +486,6 @@ export const getProjects: ApiResponse = { 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, @@ -529,7 +520,6 @@ export const getProjects: ApiResponse = { 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, @@ -578,7 +568,6 @@ export const getProjects: ApiResponse = { 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, @@ -599,7 +588,6 @@ export const getProjects: ApiResponse = { 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, @@ -627,7 +615,6 @@ export const getProjects: ApiResponse = { 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, @@ -655,7 +642,6 @@ export const getProjects: ApiResponse = { name: 'Mentrship', description: 'A mentoring platform to connect industry professionals with students.', - launchDate: new Date(), repositoryUrl: 'null', communicationPlatformUrl: '', lookingForMembers: true, diff --git a/src/mocks/responses/updated-project-response.ts b/src/mocks/responses/updated-project-response.ts index 5b5199ed1..6b6f8d228 100644 --- a/src/mocks/responses/updated-project-response.ts +++ b/src/mocks/responses/updated-project-response.ts @@ -8,7 +8,6 @@ export const updatedProject: ApiResponse = { 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,