Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN addgroup --gid 1006 developers \
USER python
RUN mkdir ~/app && mkdir ~/.vscode-server
WORKDIR /home/python/app
COPY ./assets/requirements.txt ./
COPY ./requirements.txt ./
COPY ./src/co2calculator/requirements.txt ./requirements_co2calculator.txt
ENV PATH="/home/python/.local/bin:${PATH}"
RUN pip install -r requirements.txt
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/data/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const routes = {
travelPlanner: { name: "Travel Planner", link: "/travel-planner"},
contact: { name: "Contact", link: "/contact" },
impressum: { name: "Impressum", link: "/impressum" },
privacyPolicy: { name: "Privacy Policy", link: "/privacy-policy" }
privacyPolicy: { name: "Privacy Policy", link: "/privacy-policy" },
addEmissions: { name: "Add Emissions", link: "/dataforms"}
}

export const prodRoutes: Route[] = [
Expand All @@ -38,7 +39,8 @@ export const unauthenticatedRoutes: Route[] = [
export const authenticatedRoutes: Route[] = [
routes.dashboard,
routes.travelPlanner,
routes.addEmissions,
routes.workingGroup,
routes.methodology,
routes.aboutUs
routes.aboutUs,
]
14 changes: 7 additions & 7 deletions frontend/src/views/DataForms/DataFormView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function DataFormView(){

const authContext = useContext(AuthContext);
const { data } = useQuery(getUserProfile);
const showAllTabs = !authContext.isAuthenticated|| data?.me?.isRepresentative
const showAllTabs = !authContext.isAuthenticated || data?.me?.isRepresentative
const [value, setValue] = useState(showAllTabs ? 0 : 2)

const handleChange = (_event: React.ChangeEvent<{}>, newValue: number)=>{
Expand Down Expand Up @@ -52,13 +52,13 @@ export default function DataFormView(){
return <React.Fragment>
<Tabs value={value} onChange={handleChange} aria-label="forms tabs">
{showAllTabs && (
<>
<Tab label="Electricity" {...a11yProps(0)} />
<Tab label="Heating" {...a11yProps(1)} />
</>
<Tab label="Electricity" {...a11yProps(0)} value={0}/>
)}
<Tab label="Commuting" {...a11yProps(2)} />
<Tab label="Business Trip" {...a11yProps(3)} />
{showAllTabs && (
<Tab label="Heating" {...a11yProps(1)} value={1}/>
)}
<Tab label="Commuting" {...a11yProps(2)} value={2}/>
<Tab label="Business Trip" {...a11yProps(3)} value={3}/>
</Tabs>
{
tabContents.map((content, index) => {
Expand Down