Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/edit company profile page 299 #325

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
ports:
- ${HOST_PORT}:3000
environment:
- PORT=3000
- PORT=3000
5,448 changes: 1,903 additions & 3,545 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"audit": "npm audit --production --audit-level=high"
},
"dependencies": {
"@babel/preset-env": "^7.13.15",
"@babel/preset-env": "^7.23.9",
"@date-io/date-fns": "^1.3.13",
"@hookform/resolvers": "^2.8.3",
"@material-ui/core": "^4.12.3",
Expand Down
20 changes: 20 additions & 0 deletions src/AppRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import EditOfferPage from "./pages/EditOfferPage";
import PrivacyPolicyPage from "./pages/PrivacyPolicyPage";
import TermsAndConditionsPage from "./pages/TermsAndConditionsPage";
import ChangeLogPage from "./pages/ChangeLogPage";
import EditCompanyProfilePage from "./pages/EditCompanyProfilePage";
import { EditCompanyController, EditCompanyControllerContext } from "./components/Company/Edit/EditCompanyProfileForm";

/**
*
Expand Down Expand Up @@ -188,6 +190,24 @@ const AppRouter = () => (
<CompanyOffersManagementPage />
</PageLayout>
</ProtectedRoute>
<ProtectedRoute
exact
key="/company/:id/edit"
path="/company/:id/edit"
unauthorizedRedirectPath="/"
unauthorizedRedirectMessage="You are not allowed to edit this company"
authorize={(user) => !!(user?.company || user?.isAdmin)}
context={EditCompanyControllerContext}
controller={EditCompanyController}
>
<PageLayout
key="/company/:id/edit"
pageTitle="Edit Profile"
layout={LayoutType.DESKTOP}
>
<EditCompanyProfilePage />
</PageLayout>
</ProtectedRoute>
<ProtectedRoute
exact
path="/offer/:id/edit"
Expand Down
15 changes: 15 additions & 0 deletions src/components/Company/Company.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default class Company {
constructor({
_id, name, bio, contacts, hasFinishedRegistration,
isBlocked, isDisabled, logo
}) {
this._id = _id;
this.name = name;
this.bio = bio;
this.contacts = contacts;
this.hasFinishedRegistration = hasFinishedRegistration;
this.isBlocked = isBlocked;
this.isDisabled = isDisabled;
this.logo = logo;
}
}
Loading
Loading