Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #553 from govau/develop
Browse files Browse the repository at this point in the history
Rever main nav active item to a link
  • Loading branch information
sukhrajghuman committed Nov 20, 2018
2 parents f3a2e4a + 2d0db0c commit 7cf962b
Show file tree
Hide file tree
Showing 18 changed files with 335 additions and 50 deletions.
51 changes: 38 additions & 13 deletions .circleci/config.yml
Expand Up @@ -7,7 +7,8 @@ jobs:
# installing dependencies, building assets and deploying to staging
build-and-test-uikit:
docker:
- image: circleci/node:8.11.4 # NodeLTS as of 09/2018
- image: circleci/node:8.12.0 # NodeLTS as of 10/2018
working_directory: ~/uikit
steps:
- checkout # get the files from the repo (why would you ever not want the files????)
- run:
Expand All @@ -27,7 +28,7 @@ jobs:
name: Run all tests
command: npm test
- persist_to_workspace:
root: ~/project # /home/circleci/project
root: ~/uikit
paths:
- packages/*/tests/
- .deploy/
Expand All @@ -39,40 +40,64 @@ jobs:
- image: govau/cf-cli
steps:
- attach_workspace:
at: ~/project # /home/root/project
- run: echo 'uikit:$apr1$1L7jRN5s$rZ1johNREOkXwc7pGWxZK1' > Staticfile.auth # the password and username is not a secret. It is just to prevent spiders from indexing
at: ~/uikit
- run:
name: Deploying to y.cld.gov.au
command: |
cf login -a api.system.y.cld.gov.au -o $CF_ORG_STAGING -s $CF_SPACE_STAGING -u $CF_USER_STAGING -p $CF_PASSWORD_STAGING
cf zero-downtime-push uikit -f .deploy/manifest-staging.yml
cd ~/uikit
mkdir -p site/
cp .deploy/nginx/mime.types site/
cp .deploy/nginx/.htpasswd site/
mv .deploy/nginx/nginx-staging.conf site/nginx.conf
mv packages/ site/
mv index.html site/
mv .deploy/manifest-staging.yml site/
cd site/
cf login -a $CF_API_STAGING -o $CF_ORG_STAGING -s $CF_SPACE_STAGING -u $CF_USER_STAGING -p $CF_PASSWORD_STAGING
cf zero-downtime-push uikit -f manifest-staging.yml
deploy-testing:
docker:
- image: govau/cf-cli
steps:
- attach_workspace:
at: ~/project # /home/root/project
- run: echo 'uikit:$apr1$1L7jRN5s$rZ1johNREOkXwc7pGWxZK1' > Staticfile.auth # the password and username is not a secret. It is just to prevent spiders from indexing
at: ~/uikit
- run:
name: Deploying to y.cld.gov.au
command: |
cf login -a api.system.y.cld.gov.au -o $CF_ORG_STAGING -s $CF_SPACE_STAGING -u $CF_USER_STAGING -p $CF_PASSWORD_STAGING
cf zero-downtime-push uikit-$CIRCLE_BRANCH -f .deploy/manifest-testing.yml
cd ~/uikit
mkdir -p site/
cp .deploy/nginx/mime.types site/
cp .deploy/nginx/.htpasswd site/
mv .deploy/nginx/nginx-testing.conf site/nginx.conf
mv packages/ site/
mv index.html site/
mv .deploy/manifest-testing.yml site/
cd site/
cf login -a $CF_API_STAGING -o $CF_ORG_STAGING -s $CF_SPACE_STAGING -u $CF_USER_STAGING -p $CF_PASSWORD_STAGING
cf zero-downtime-push uikit -f manifest-testing.yml
deploy-prod:
docker:
- image: govau/cf-cli
steps:
- attach_workspace:
at: ~/project # /home/root/project
at: ~/uikit
- run:
name: Deploying to b.cld.gov.au
command: |
cf login -a api.system.b.cld.gov.au -o $CF_ORG_PROD -s $CF_SPACE_PROD -u $CF_USER_PROD -p $CF_PASSWORD_PROD
cf zero-downtime-push uikit -f .deploy/manifest-production.yml
cd ~/uikit
mkdir -p site/
cp .deploy/nginx/mime.types site/
mv .deploy/nginx/nginx-production.conf site/nginx.conf
mv packages/ site/
mv index.html site/
mv .deploy/manifest-production.yml site/
cd site/
cf login -a $CF_API_PROD -o $CF_ORG_PROD -s $CF_SPACE_PROD -u $CF_USER_PROD -p $CF_PASSWORD_PROD
cf zero-downtime-push uikit -f manifest-production.yml
# OUR WORKFLOW
Expand Down
3 changes: 3 additions & 0 deletions .deploy/buildpack.yml
@@ -0,0 +1,3 @@
---
nginx:
version: mainline
6 changes: 3 additions & 3 deletions .deploy/manifest-production.yml
@@ -1,9 +1,9 @@
---
applications:
- name: uikit
buildpack: staticfile_buildpack
buildpack: nginx_buildpack
memory: 64M
instances: 1

instances: 2
path: ./
routes:
- route: uikit.service.gov.au
4 changes: 2 additions & 2 deletions .deploy/manifest-staging.yml
@@ -1,9 +1,9 @@
---
applications:
- name: uikit
buildpack: staticfile_buildpack
buildpack: nginx_buildpack
memory: 64M
instances: 1

path: ./
routes:
- route: uikit.staging.service.gov.au
3 changes: 2 additions & 1 deletion .deploy/manifest-testing.yml
@@ -1,6 +1,7 @@
---
applications:
- name: uikit
buildpack: staticfile_buildpack
buildpack: nginx_buildpack
memory: 64M
instances: 1
path: ./
1 change: 1 addition & 0 deletions .deploy/nginx/.htpasswd
@@ -0,0 +1 @@
uikit:$apr1$1L7jRN5s$rZ1johNREOkXwc7pGWxZK1
78 changes: 78 additions & 0 deletions .deploy/nginx/mime.types
@@ -0,0 +1,78 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;
font/ttf ttf;
font/woff woff;
font/woff2 woff2;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
text/cache-manifest manifest;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg svgz;
image/webp webp;
application/java-archive jar war ear;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.ms-excel xls;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream eot;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/json json;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
47 changes: 47 additions & 0 deletions .deploy/nginx/nginx-production.conf
@@ -0,0 +1,47 @@

worker_processes 1;
daemon off;

error_log stderr;
events { worker_connections 1024; }

http {
charset utf-8;
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
access_log /dev/stdout cloudfoundry;
default_type application/octet-stream;
include mime.types;
sendfile on;

gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gunzip on;
gzip_static always;
gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss;

tcp_nopush on;
keepalive_timeout 30;
port_in_redirect off; # Ensure that redirects don't include the internal container PORT - <%= ENV["PORT"] %>
server_tokens off;

server {
# Required for nginx-buildpack, interpolates value of $PORT.
listen {{port}};

server_name designsystem.gov.au

add_header X-Frame-Options "SAMEORIGIN";

# adding some custom rules to strip out the html extension
index index.html;

location / {
root ./;
try_files $uri $uri.html $uri/ $uri/index.html =404;
}
}
}
54 changes: 54 additions & 0 deletions .deploy/nginx/nginx-staging.conf
@@ -0,0 +1,54 @@
worker_processes 1;
daemon off;

error_log stderr;
events { worker_connections 1024; }

http {
charset utf-8;
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
access_log /dev/stdout cloudfoundry;
default_type application/octet-stream;
include mime.types;
sendfile on;

gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gunzip on;
gzip_static always;
gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss;

tcp_nopush on;
keepalive_timeout 30;
port_in_redirect off; # Ensure that redirects don't include the internal container PORT - <%= ENV["PORT"] %>
server_tokens off;

server {
# Required for nginx-buildpack, interpolates value of $PORT.
listen {{port}};

server_name uikit.staging.service.gov.au;

add_header X-Frame-Options "SAMEORIGIN";

auth_basic "Restricted";
auth_basic_user_file .htpasswd;

# adding some custom rules to strip out the html extension
index index.html;

location / {
root ./;
try_files $uri $uri.html $uri/ $uri/index.html =404;
}

location /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: *";
}
}
}
54 changes: 54 additions & 0 deletions .deploy/nginx/nginx-testing.conf
@@ -0,0 +1,54 @@
worker_processes 1;
daemon off;

error_log stderr;
events { worker_connections 1024; }

http {
charset utf-8;
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
access_log /dev/stdout cloudfoundry;
default_type application/octet-stream;
include mime.types;
sendfile on;

gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gunzip on;
gzip_static always;
gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss;

tcp_nopush on;
keepalive_timeout 30;
port_in_redirect off; # Ensure that redirects don't include the internal container PORT - <%= ENV["PORT"] %>
server_tokens off;

server {
# Required for nginx-buildpack, interpolates value of $PORT.
listen {{port}};

server_name localhost;

add_header X-Frame-Options "SAMEORIGIN";

auth_basic "Restricted";
auth_basic_user_file .htpasswd;

# adding some custom rules to strip out the html extension
index index.html;

location / {
root ./;
try_files $uri $uri.html $uri/ $uri/index.html =404;
}

location /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: *";
}
}
}
6 changes: 6 additions & 0 deletions packages/main-nav/CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@

## Versions

* [v1.0.0 - Wrap active item in main-nav in an `<a>` and add `aria-current="page"`](#v100)
* [v0.2.0 - Active items are no longer wrapped in `<a>` for accessibility](#v020)
* [v0.1.4 - Fix passing props to main nav react component](#v014)
* [v0.1.3 - Added an aria-label attribute to the nav element](#v013)
Expand All @@ -28,6 +29,11 @@

## Release History

### v1.0.0

- Wrap active item in main-nav in an `<a>` and add `aria-current="page"`


### v0.2.0

- Active items are no longer wrapped in `<a>` for accessibility
Expand Down

0 comments on commit 7cf962b

Please sign in to comment.