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

New desktop header #4598

Merged
merged 54 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
baa3794
Feature/home page react (#1)
nick-next Sep 3, 2024
1738d8c
This push addresses a number of comments in the PR:
nick-next Sep 5, 2024
4393072
File, path and import renaming.
nick-next Sep 5, 2024
8b3ac39
File formatting, tagged the homepage metadata data container as "meta…
nick-next Sep 5, 2024
547bf5e
To keep full backwards compatibility with templates using the old hom…
nick-next Sep 5, 2024
8758913
Following up from the previous commit, the .ts file for v2 (the new v…
nick-next Sep 5, 2024
3b788c1
Factored out the calls to `document.getElementById` so that it is onl…
nick-next Sep 5, 2024
d468964
Commenting of interfaces, interface properties and files.
nick-next Sep 5, 2024
ea913a3
This push brings back the application container for the original home…
nick-next Sep 5, 2024
db7146f
Used macros to help render the label and route data containers.
nick-next Sep 5, 2024
4bf9b18
Updating the label and route proxy objects to take the type as a gene…
nick-next Sep 5, 2024
8ff02ae
The label proxy object now emits a log when the requested label does …
nick-next Sep 5, 2024
9d35401
Template routes must now be wrapped in `{}` in order to be resolved, …
nick-next Sep 5, 2024
6ea848f
WIP: A functional implementation of the rich menu. A note that this h…
nick-next Sep 6, 2024
12abba5
WIP We now have the ability to put direct links in the header menu (s…
nick-next Sep 6, 2024
c6b98d5
Menu Styles WIP
pablonoel Sep 6, 2024
859a19f
better search bar
pablonoel Sep 6, 2024
baeeb68
Added in {} tags to remaining routes, and removed an extra logo from …
nick-next Sep 6, 2024
1edc0e6
Menu WIP shadow + arrows
pablonoel Sep 6, 2024
585cc29
Menu item link coloring update.
nick-next Sep 6, 2024
8991754
Improvement over menu item behaviour
pablonoel Sep 6, 2024
166e32e
Animated icon when page is open.
nick-next Sep 6, 2024
dfe6c21
WIP improvements for the menu
pablonoel Sep 6, 2024
17a6c45
Added in TODOs to be resolved before the final PR.
nick-next Sep 6, 2024
37ef92a
Improvements on menu structure and sizes
pablonoel Sep 6, 2024
8c97b7b
Cleaned up the menu sliding action so that it has the appearance of a…
nick-next Sep 6, 2024
6e6c296
Update header content to include missing links.
nick-next Sep 6, 2024
bdbd474
Minor tweaks to the header styles.
nick-next Sep 6, 2024
149f0fe
Temporarily removed the stand-in for the mobile menu toggle button.
nick-next Sep 6, 2024
6eae1b4
Breakpoints and responsive spacing
pablonoel Sep 6, 2024
676d0c8
Merge branch 'feature/header' of https://github.com/Half-Integer/data…
pablonoel Sep 6, 2024
b449369
Removal of stray console log and some formatting.
nick-next Sep 6, 2024
1162697
Merge branch 'feature/homepage-revamp' into feature/header
nick-next Sep 6, 2024
a425a31
Refactor search bar component to fix Firefox Issue
pablonoel Sep 6, 2024
bc80cda
Merge branch 'feature/header' of https://github.com/Half-Integer/data…
pablonoel Sep 6, 2024
1466751
new desktop header
jenibelle08 Sep 6, 2024
49aed83
WIP: implementation of the mobile menu version of the rich menu. A no…
nick-next Sep 7, 2024
63423d2
Some refactoring of how the header CSS is applied, so that it is avai…
nick-next Sep 7, 2024
50d4966
Added in a missing route resolver.
nick-next Sep 7, 2024
52e4993
If the user scrolls and the desktop rich menu is open, it now closes …
nick-next Sep 7, 2024
c30cf86
better styles for mobile menu
pablonoel Sep 7, 2024
34e917f
Some component renaming
nick-next Sep 7, 2024
16c4fde
Mobile Menu Design Details
pablonoel Sep 7, 2024
41fe22e
Merge branch 'feature/header-mobile' of https://github.com/Half-Integ…
pablonoel Sep 7, 2024
f914dd1
Small fix on hamburger menu icon font size
pablonoel Sep 7, 2024
34b79ea
Removal of unused prop.
nick-next Sep 7, 2024
e77f40d
Visual fixes
pablonoel Sep 7, 2024
012278b
Merge branch 'new-homepage' into feature/header-mobile
nick-next Sep 7, 2024
027772c
Removal of unneeded files and imports, as well as an unneeded prop.
nick-next Sep 7, 2024
112c9c9
SCSS cleanup (formatting fixes) as well as a fix to the height of the…
nick-next Sep 8, 2024
a786739
Added in a timer (with a TODO to review the length of it) to delay th…
nick-next Sep 8, 2024
476a2e9
Added in a TODO on the server side for moving to version two of the h…
nick-next Sep 8, 2024
3ac04d6
Directory refactor (placing the header-related components in their ow…
nick-next Sep 8, 2024
0e28fcc
Added in a TODO for the potential to fold the rich desktop and rich m…
nick-next Sep 8, 2024
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
4 changes: 3 additions & 1 deletion server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,10 @@ def add_language_code(endpoint, values):
@app.context_processor
def inject_common_parameters():
common_variables = {
#TODO: replace HEADER_MENU with V2
'HEADER_MENU': json.dumps(libutil.get_json("config/base/header.json")),
'FOOTER_MENU': json.dumps(libutil.get_json("config/base/footer.json"))
'FOOTER_MENU': json.dumps(libutil.get_json("config/base/footer.json")),
'HEADER_MENU_V2': json.dumps(libutil.get_json("config/base/header_v2.json")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a todo here to replace HEADER_MENU

}
locale_variable = dict(locale=get_locale())
return {**common_variables, **locale_variable}
Expand Down
203 changes: 203 additions & 0 deletions server/config/base/header_v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to think about a good way to add translations to these strings (in a follow-up pr)

{
"label": "Overview",
"ariaLabel": "Data Commons overview",
"introduction": "Data Commons is an open-source platform aggregating global public data for easy exploration using natural language.",
"primarySectionGroups": [
{
"title": "Key Features",
"items": [
{
"title": "Large harmonized public dataset",
"description": "240 billion data points across 260K statistical variables, harmonized from governmental, inter-governmental, academic and non-profit organizations"
},
{
"title": "Natural language interface",
"description": "Data Commons uses AI for natural language queries, making public data accessible and useful to all"
}
]
},
{
"title": "Build your Data Commons",
"items": [
{
"title": "Tailor your own Data Commons",
"description": "Launch your own Data Commons and customize it with your own data to better engage your specific audience"
},
{
"title": "Explore your data with natural language",
"description": "Ask questions in your own words and get answers directly from your data"
},
{
"title": "Actionable Insights",
"description": "Gain actionable insights from your data in connection to global data",
"links": [
{
"title": "Learn more & build yours today",
"url": "{place.place}"
}
]
}
]
}
],
"secondarySectionGroups": [
{
"title": "Other Data Commons",
"items": [
{
"title": "Partners",
"description": "Featured organizations who organizations have tailored their own Data Commons to meet their specific needs and goals",
"links": [
{
"title": "United Nations",
"url": "https://www.un.org",
"linkType": "external"
},
{
"title": "One.org",
"url": "https://one.org",
"linkType": "external"
}
]
}
]
}
]
},
{
"label": "Tools",
"ariaLabel": "Show exploration tools",
"introduction": "Explore a variety of tools to visualize, analyze, and interact with the Data Commons knowledge graph and its extensive datasets.",
"primarySectionGroups": [
{
"items": [
{
"title": "Knowledge Graph",
"url": "{browser.browser_main}",
"description": "Explore what data is available and understand the graph structure"
},
{
"title": "Statistical Variable Explorer",
"url": "{tools.stat_var}",
"description": "Explore statistical variable details including metadata and observations"
},
{
"title": "Data Download Tool",
"url": "{tools.download}",
"description": "Download data for selected statistical variables"
}
]
},
{
"items": [
{
"title": "Map Explorer",
"url": "{tools.visualization}#visType=map",
"description": "Study how a selected statistical variable can vary across geographic regions"
},
{
"title": "Scatter Plot Explorer",
"url": "{tools.visualization}#visType=scatter",
"description": "Visualize the correlation between two statistical variables"
},
{
"title": "Timelines Explorer",
"url": "{tools.visualization}#visType=timeline",
"description": "See trends over time for selected statistical variables"
}
]
}
]
},
{
"label": "Documentation",
"ariaLabel": "Show documentation links",
"introduction": "Access in-depth tutorials, guides, and API references to unlock the full potential of Data Commons and integrate it into your projects.",
"primarySectionGroups": [
{
"items": [
{
"title": "Docs",
"url": "https://docs.datacommons.org",
"description": "Learn how to leverage the Data Commons unified database with comprehensive documentation, tutorials, and guides."
},
{
"title": "API",
"url": "https://docs.datacommons.org/api",
"description": "Access a unified knowledge graph with standardized data from diverse sources using Data Commons APIs."
}
]
},
{
"items": [
{
"title": "Tutorials",
"url": "https://docs.datacommons.org/tutorials",
"description": "Get familiar with the Data Commons Knowledge Graph and APIs using analysis examples in Google Colab notebooks written in Python."
},
{
"title": "Contributions",
"url": "https://docs.datacommons.org/contributing/",
"description": "Become part of Data Commons by contributing data, tools, educational materials, or sharing your analysis and insights. Collaborate and help expand the knowledge graph!"
}
]
}
]
},
{
"label": "About",
"ariaLabel": "Show about links",
"introduction": "Data Commons is an initiative from Google. Discover how Data Commons is changing data analysis. Explore diverse data, learn to use its tools through Python examples, and stay updated on the latest news and research.",
"primarySectionGroups": [
{
"items": [
{
"title": "Why Data Commons",
"url": "{static.about}",
"description": "Discover why Data Commons is revolutionizing data access and analysis. Learn how its unified knowledge graph empowers you to explore diverse, standardized data."
},
{
"title": "Data Sources",
"url": "https://docs.datacommons.org/datasets/",
"description": "Get familiar with the Data Commons Knowledge Graph and APIs using analysis examples in Google Colab notebooks written in Python.",
"links": [
{
"title": "Data Updates",
"url": "https://www.datacommons.org/rss",
"linkType": "rss"
}
]
}
]
},
{
"items": [
{
"title": "FAQ",
"url": "{static.faq}",
"description": "Find quick answers to common questions about Data Commons, its usage, data sources, and available resources."
},
{
"title": "Blog",
"url": "https://blog.datacommons.org/",
"description": "Stay up-to-date with the latest news, updates, and insights from the Data Commons team. Explore new features, research, and educational content related to the project.",
"links": [
{
"title": "Blog posts",
"url": "https://blog.datacommons.org/rss",
"linkType": "rss"
}
]
}
]
}
]
},
{
"label": "Feedback",
"ariaLabel": "Give feedback",
"url": "{static.feedback}",
"exposeInMobileBanner": true
}
]
3 changes: 2 additions & 1 deletion server/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<link href="https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;700&family=Google+Sans+Text:wght@300;400;500;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined&display=block">
<link rel="stylesheet" href={{url_for('static', filename='css/core.min.css', t=config['VERSION'])}}>
{% block head %}
{% endblock %}
{% if OVERRIDE_CSS_PATH %}
Expand Down Expand Up @@ -95,7 +96,7 @@

<body>
<div id="metadata-base" class="d-none"
data-header="{{ HEADER_MENU }}"
data-header="{{ HEADER_MENU_V2 }}"
data-footer="{{ FOOTER_MENU }}"
data-logo-path="{{ LOGO_PATH }}"
data-name="{{ NAME }}"
Expand Down
Loading