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/redesign start page #481

Merged
merged 23 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dc621da
Web: Studio: Homepage: Added SVG illustration
dmitry-kulak Dec 8, 2021
0ab444b
Web: Studio: Homepage: Moved sub components to sub-components folder
dmitry-kulak Dec 8, 2021
9b604db
Web: Studio: Homepage: Added helper functions for links
dmitry-kulak Dec 8, 2021
b35c06f
Web: Studio: Homepage: Added styles for external link icon
dmitry-kulak Dec 8, 2021
7266679
Web: Studio: Homepage: Redesign, added illustration, refactoring
dmitry-kulak Dec 8, 2021
2e1584f
Web: Studio: HomePage: Header: Added ability to open unavailable modu…
dmitry-kulak Dec 8, 2021
d0a505b
Web: Studio: HomePage: ModuleTile: Added ability to open unavailable …
dmitry-kulak Dec 8, 2021
ed3a4c8
Web: Studio: Moved onItemClick function to utils
dmitry-kulak Dec 8, 2021
eecdc3e
Web: Studio: Refactoring
dmitry-kulak Dec 9, 2021
49061c8
Web: Studio: Homepage: Changed title to new greeting message, swapped…
dmitry-kulak Dec 10, 2021
85c55cd
Web: Studio: Homepage: Redesign
dmitry-kulak Dec 10, 2021
4e38480
Web: Studio: Homepage: Removed hamburger menu
dmitry-kulak Dec 10, 2021
729e695
Web: Studio: Moved external link icon from utils to components
dmitry-kulak Dec 10, 2021
d32dc40
Web: Studio: Fixes, refactoring
dmitry-kulak Dec 10, 2021
cf5723c
Web: Studio: Renamed function isModuleOld to checkIfModuleOld
dmitry-kulak Dec 10, 2021
464a5cd
Web: Studio: Fixed links
dmitry-kulak Dec 10, 2021
0a53e3b
Web: Studio: Homepage: Refactoring
dmitry-kulak Dec 13, 2021
6f49b68
Web: Studio: Homepage: Fixes
dmitry-kulak Dec 13, 2021
8ee3ef5
Web: Studio: Homepage: Changed logic for greeting message
dmitry-kulak Dec 13, 2021
1ea64c8
Web: Studio: Homepage: Now displayName is used in greeting message
dmitry-kulak Dec 14, 2021
a1f0c01
Web: Studio: Homepage: Fixed layout jump on load
dmitry-kulak Dec 14, 2021
e9449b5
Web: Studio: Homepage: Fixed vertical scroll appearing on mobile in l…
dmitry-kulak Dec 14, 2021
f2548e2
Web: Studio: Moved settings menu link from hamburger menu to profile …
dmitry-kulak Dec 14, 2021
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
5 changes: 5 additions & 0 deletions web/ASC.Web.Client/public/locales/en/Home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"GoodMorning": "Good morning",
"GoodAfternoon": "Good afternoon",
"GoodEvening": "Good evening"
}
5 changes: 5 additions & 0 deletions web/ASC.Web.Client/public/locales/ru/Home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"GoodMorning": "Доброе утро",
"GoodAfternoon": "Добрый день",
"GoodEvening": "Добрый вечер"
}
83 changes: 42 additions & 41 deletions web/ASC.Web.Client/src/components/NavMenu/sub-components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ import i18n from "../i18n";
import { combineUrl } from "@appserver/common/utils";
import { AppServerConfig } from "@appserver/common/constants";
import NoUserSelect from "@appserver/components/utils/commonStyles";
import {
getLink,
checkIfModuleOld,
onItemClick,
} from "@appserver/studio/src/helpers/utils";
import StyledExternalLinkIcon from "@appserver/studio/src/components/StyledExternalLinkIcon";

const { proxyURL } = AppServerConfig;

const backgroundColor = "#0F4071";
const linkColor = "#7a95b0";

const Header = styled.header`
align-items: center;
Expand Down Expand Up @@ -84,6 +91,7 @@ const Header = styled.header`
height: 24px;
position: relative;
padding: ${(props) => (!props.isPersonal ? "0 20px 0 6px" : "0")};
margin-left: ${(props) => (props.needNavMenu ? "0" : "10px")};
cursor: pointer;

@media ${tablet} {
Expand All @@ -107,22 +115,22 @@ const Header = styled.header`
const StyledLink = styled.div`
display: inline;
.nav-menu-header_link {
color: #7a95b0;
color: ${linkColor};
font-size: 13px;
}

a {
text-decoration: none;
}
:hover {
color: #7a95b0;
color: ${linkColor};
-webkit-text-decoration: underline;
text-decoration: underline;
}
`;

const versionBadgeProps = {
color: "#7A95B0",
color: linkColor,
fontWeight: "600",
fontSize: "13px",
};
Expand Down Expand Up @@ -164,15 +172,34 @@ const HeaderComponent = ({
if (item) item.onBadgeClick(e);
};

const onItemClick = (e) => {
if (!e) return;
const link = e.currentTarget.dataset.link;
history.push(link);
backdropClick();
e.preventDefault();
};

const numberOfModules = mainModules.filter((item) => !item.separator).length;
const needNavMenu = currentProductId !== "home";

const navItems = mainModules.map(
({ id, separator, iconUrl, notifications, link, title, dashed }) => {
const itemLink = getLink(link);
const shouldRenderIcon = checkIfModuleOld(link);
return (
<NavItem
separator={!!separator}
key={id}
data-id={id}
data-link={itemLink}
opened={isNavOpened}
active={id == currentProductId}
iconUrl={iconUrl}
badgeNumber={notifications}
onClick={onItemClick}
onBadgeClick={onBadgeClick}
url={itemLink}
dashed={dashed}
>
{id === "settings" ? i18n.t("Common:Settings") : title}
{shouldRenderIcon && <StyledExternalLinkIcon color={linkColor} />}
</NavItem>
);
}
);

return (
<>
Expand All @@ -182,8 +209,9 @@ const HeaderComponent = ({
isPersonal={isPersonal}
isAuthenticated={isAuthenticated}
className="navMenuHeader hidingHeader"
needNavMenu={needNavMenu}
>
{!isPersonal && (
{!isPersonal && needNavMenu && (
<NavItem
badgeNumber={totalNotifications}
onClick={onClick}
Expand Down Expand Up @@ -239,35 +267,7 @@ const HeaderComponent = ({
key={"nav-products-separator"}
data-id={"nav-products-separator"}
/>
{mainModules.map(
({
id,
separator, //iconName,
iconUrl,
notifications,
link,
title,
dashed,
}) => (
<NavItem
separator={!!separator}
key={id}
data-id={id}
data-link={link}
opened={isNavOpened}
active={id == currentProductId}
//iconName={iconName}
iconUrl={iconUrl}
badgeNumber={notifications}
onClick={onItemClick}
onBadgeClick={onBadgeClick}
url={link}
dashed={dashed}
>
{id === "settings" ? i18n.t("Common:Settings") : title}
</NavItem>
)
)}
{navItems}
<Box className="version-box">
<Link
as="a"
Expand Down Expand Up @@ -314,6 +314,7 @@ HeaderComponent.propTypes = {
version: PropTypes.string,
isAuthenticated: PropTypes.bool,
isAdmin: PropTypes.bool,
needNavMenu: PropTypes.bool,
};

export default inject(({ auth }) => {
Expand Down
13 changes: 13 additions & 0 deletions web/ASC.Web.Client/src/components/StyledExternalLinkIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import ExternalLinkIcon from "../../../../public/images/external.link.react.svg";
import styled from "styled-components";

const StyledExternalLinkIcon = styled(ExternalLinkIcon)`
height: 12px;
width: 12px;
margin: 0 4px;
path {
fill: ${(props) => props.color};
}
`;

export default StyledExternalLinkIcon;
82 changes: 0 additions & 82 deletions web/ASC.Web.Client/src/components/pages/Home/ModuleTile.js

This file was deleted.

87 changes: 0 additions & 87 deletions web/ASC.Web.Client/src/components/pages/Home/StyledModuleTile.js

This file was deleted.

Loading