Skip to content

Commit

Permalink
Merge branch 'master' into stacks-fix-build-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen authored Sep 28, 2023
2 parents 505ebbe + 873759c commit 5f8ec2c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions dashboard/src/main/home/sidebar/ProjectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ const ProjectButton: React.FC<PropsType> = (props) => {

{/* <i className="material-icons">arrow_drop_down</i> */}
</MainSelector>
{user.isPorterUser && currentProject.simplified_view_enabled &&
<PorterAppDetailContainer>
<ProjectName>(Visible to @porter.run only)</ProjectName>
<Spacer y={0.5} />
<ProjectName>Porter Apps {currentProject.validate_apply_v2 ? "V2" : "V1"}</ProjectName>
</PorterAppDetailContainer>
}
{/* {renderDropdown()} */}
</StyledProjectSection >
);
Expand Down Expand Up @@ -238,6 +245,33 @@ const MainSelector = styled.div`
}
`;

const PorterAppDetailContainer = styled.div`
display: flex;
flex-direction: column;
background: #ffffff11;
border: 1px solid #ffffff11;
font-size: 14px;
cursor: ${props => (props.projectsLength > 1 || props.isPorterUser) ? "pointer" : "default"};
padding: 10px;
position: relative;
:hover {
> i {
background: #ffffff22;
}
}
> i {
margin-left: 7px;
margin-right: 12px;
font-size: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
background: "#ffffff22"
}
`;

const ProjectName = styled.div`
overflow: hidden;
white-space: nowrap;
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/shared/Context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ class ContextProvider extends Component<PropsType, StateType> {
currentProject: null,
setCurrentProject: (currentProject: ProjectType, callback?: any) => {
if (currentProject) {
sessionStorage.setItem("currentProject", currentProject.id.toString());
localStorage.setItem("currentProject", currentProject.id.toString());
pushQueryParams(this.props, {
project_id: currentProject.id.toString(),
});
} else {
sessionStorage.removeItem("currentProject");
localStorage.removeItem("currentProject");
}
this.setState({ currentProject }, () => {
callback && callback();
Expand Down

0 comments on commit 5f8ec2c

Please sign in to comment.