Skip to content

Commit

Permalink
Merge branch 'master' into cdcUpdateTest
Browse files Browse the repository at this point in the history
  • Loading branch information
hqpho authored Nov 11, 2024
2 parents 9541760 + bbfaf23 commit 6519c6b
Show file tree
Hide file tree
Showing 23 changed files with 817 additions and 335 deletions.
104 changes: 104 additions & 0 deletions scripts/create_customdc_stable_update_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Opens a PR to merge new changes into the custom DC stable branch.

set -e

MASTER_BRANCH=master
STABLE_BRANCH=customdc_stable
UPDATE_BRANCH=cdcStableUpdate

# Check if GitHub CLI is installed
if ! command -v gh &> /dev/null; then
echo "GitHub CLI is not installed. Please install it to continue."
echo "You can find installation instructions at https://cli.github.com"
exit 1
fi

# Check if the user is authorized with GitHub CLI
if ! gh auth status &> /dev/null; then
echo "You are not logged in to GitHub CLI."
echo "Please run 'gh auth login' to authenticate."
exit 1
fi

# Check if GitHub CLI default repository is set
if gh repo set-default --view 2>&1 >/dev/null | grep "no default repository"; then
# No default repository is set for GitHub CLI.
# We don't have to print an error message because the above already prints one.
echo "Choose your *forked repo* as the default."
exit 1
fi

# Find the remote associated with the main repo
upstream_name=$(git remote -v | grep "datacommonsorg" | awk '{print $1}' | head -n 1)
if [ -z "$upstream_name" ]; then
echo "No remote found with 'datacommonsorg' in its URL."
exit 1
fi
echo "Remote for main repo is '${upstream_name}'".

# Find the remote associated with the forked repo
fork_name=$(git remote -v | grep -v "datacommonsorg" | awk '{print $1}' | head -n 1)
if [ -z "$fork_name" ]; then
echo "No remote found without 'datacommonsorg' in its URL."
exit 1
fi
echo "Remote for forked repo is '${fork_name}'".

# Check whether a local update branch already exists.
if git show-ref --verify --quiet "refs/heads/${UPDATE_BRANCH}"; then
echo "A local branch named '${UPDATE_BRANCH}' already exists."
echo "Delete it, then re-run this script."
exit 1
fi

# Check whether a remote update branch already exists.
if git ls-remote --heads "$fork_name" "$UPDATE_BRANCH" | grep -q "$UPDATE_BRANCH"; then
echo "A branch named '${UPDATE_BRANCH}' already exists on remote '${fork_name}'".
echo "Delete it, then re-run this script."
exit 1
fi

# Fetch relevant branches from the main repo
git fetch $upstream_name $MASTER_BRANCH $STABLE_BRANCH

# Show the user the commits that are in master but not in customdc_stable
echo ""
echo "The following commits are in ${MASTER_BRANCH} but not in ${STABLE_BRANCH}:"
echo ""
git log --pretty=format:"%h %s" ${upstream_name}/${STABLE_BRANCH}..${upstream_name}/${MASTER_BRANCH} --reverse
echo ""

# Ask the user to select a commit
read -p "Enter the commit hash to create the branch from: " commit_hash

# Create a new branch at the selected commit
git checkout -b "$UPDATE_BRANCH" "$commit_hash"

# Get the current date in YYYY-MM-DD format
current_date=$(date +%Y-%m-%d)

echo "Creating PR..."

# Open a draft PR using GitHub CLI
gh pr create \
--repo datacommonsorg/website \
--base customdc_stable \
--head "${fork_name}:${UPDATE_BRANCH}" \
--title "$current_date Custom DC stable release" \
--body "TODO: Summarize changes since last stable release." \
--draft
29 changes: 0 additions & 29 deletions scripts/update_customdc_stable_tag.sh

This file was deleted.

1 change: 1 addition & 0 deletions server/templates/explore_landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{% set main_id = 'explore-landing' %}
{% set page_id = 'explore-landing-page' %}
{% set title = 'Explore ' + topic | title %}
{% set is_show_header_search_bar = true %}

{% block head %}
<link rel="stylesheet" href={{url_for('static', filename='css/explore_landing.min.css', t=config['VERSION'])}} >
Expand Down
119 changes: 119 additions & 0 deletions static/css/content/brick_wall.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
Styles for a brick wall component that displays a given list of
arbitrary elements in an interlocking wall of bricks.
*/

.brick-wall-block {
display: grid;
grid-template-columns: 1fr 1fr;
gap: calc(#{var.$spacing} * 3);
@include media-breakpoint-down(md) {
grid-template-columns: 1fr;
}
h3 {
@include var.title_lg;
grid-column: 1 / span 2;
max-width: 750px;
@include media-breakpoint-down(md) {
grid-column: 1;
}
}
}

.brick-wall-section {
margin: 0;
padding: 0;
display: grid;
grid-template-columns: 1fr 1fr;
&.row-count-0 {
grid-template-columns: 1fr;
grid-template-rows: max-content;
}
&.row-count-1 {
grid-template-rows: 1fr;
}
&.row-count-2 {
grid-template-rows: repeat( 2, min-content );
}
&.row-count-3 {
grid-template-rows: repeat( 3, min-content );
}
&.row-count-4 {
grid-template-rows: repeat( 4, min-content );
}
&.row-count-5 {
grid-template-rows: repeat( 5, min-content );
}
&.row-count-6 {
grid-template-rows: repeat( 6, min-content );
}
gap: calc(#{var.$spacing} * 3);
align-items: start;
justify-content: start;
@include media-breakpoint-down(sm) {
grid-template-columns: 1fr;
}
.brick-wall-item {
display: block;
list-style: none;
a {
@include var.white-box;
@include var.shadow;
@include var.text_xl;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 10px;
padding: calc(#{var.$spacing} * 3);
border-radius: calc(#{var.$spacing} * 4);
}
}
&:nth-of-type(1) {
.brick-wall-item {
&:nth-of-type(3), &:nth-of-type(4) {
grid-column: 1 / span 2;
@include media-breakpoint-down(sm) {
grid-column: 1;
}
}
&:nth-of-type(7), &:nth-of-type(8) {
grid-column: 1 / span 2;
@include media-breakpoint-down(sm) {
grid-column: 1;
}
}
}
}
&:nth-of-type(2) {
.brick-wall-item {
&:nth-of-type(1), &:nth-of-type(4) {
grid-column: 1 / span 2;
@include media-breakpoint-down(sm) {
grid-column: 1;
}
}
&:nth-of-type(5), &:nth-of-type(8) {
grid-column: 1 / span 2;
@include media-breakpoint-down(sm) {
grid-column: 1;
}
}
}
}
}
28 changes: 22 additions & 6 deletions static/css/content/chips.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,35 @@
.chip-item {
display: block;
list-style: none;
&.elevated {
a {
@include var.white-box;
@include var.shadow;
color: var.$color-blue;

.icon svg {
fill: var.$color-blue;
}
}
}
&.flat {
a {
@include var.blue-box;
color: var.$color-black;

.icon svg {
fill: var.$color-black;
}
}
}
a {
@include var.white-box;
@include var.text_sm;
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
border-radius: calc(#{var.$spacing} * 10);
padding: 10px calc(#{var.$spacing} * 3) 10px calc(#{var.$spacing} * 2);

.icon svg {
fill: #007bff;
}
}
}
}
}
33 changes: 33 additions & 0 deletions static/css/content/intro_text.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.a
*/

.intro-text {
.container {
display: grid;
grid-template-columns: 6fr 4fr;
gap: calc(#{var.$spacing} * 2) calc(#{var.$spacing} * 6);
@include media-breakpoint-down(md) {
grid-template-columns: 1fr;
}
@include media-breakpoint-down(sm) {
display: block;
}
}
h1 {
@include var.title_lg;
margin-bottom: calc(#{var.$spacing} * 3);
}
}
1 change: 1 addition & 0 deletions static/css/content/sample_questions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
list-style: none;
a {
@include var.white-box;
@include var.shadow;
display: flex;
flex-direction: column;
align-items: flex-start;
Expand Down
1 change: 1 addition & 0 deletions static/css/content/tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
}
a {
@include var.white-box;
@include var.shadow;
@include var.title_xs;
display: flex;
width: 100%;
Expand Down
Loading

0 comments on commit 6519c6b

Please sign in to comment.