...
 
Commits (19)
......@@ -4,24 +4,86 @@ services:
- docker:dind
stages:
- test
- test:unit
- build
- prepare
- deploy
- review
- deploy:staging
- test:e2e
- deploy:canary
- deploy:production
variables:
CYPRESS_INSTALL_BINARY: 0 # Speeds up the install process
npm_config_cache: "$CI_PROJECT_DIR/.npm"
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
test:
image: circleci/node:8-browsers
stage: test
stage: test:unit
script:
- npm install # Should be cached...
- npm ci
- npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
e2e:base:
image: cypress/base:10
stage: test:e2e
variables:
CYPRESS_INSTALL_BINARY: 3.4.1
script:
- npm ci
- >
if [ "$CI_BUILD_REF_NAME" == "master" ]; then
export E2E_DOMAIN=https://www.minds.com
else
export E2E_DOMAIN=https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
fi
- export CYPRESS_baseUrl=$E2E_DOMAIN
- echo "E2E tests for $CI_BUILD_REF_NAME running against $E2E_DOMAIN with user $CYPRESS_username"
- $(npm bin)/cypress run --record --key $CYPRESS_RECORD_ID --config CYPRESS_baseUrl=$E2E_DOMAIN
artifacts:
when: always
paths:
- cypress/screenshots/**/*.mp4
- cypress/videos/**/*.mp4
cache:
paths:
- .npm
- cache/Cypress
allow_failure: true #manual inspection in case of timeouts
e2e:chrome:
image: cypress/browsers:chrome67
stage: test:e2e
variables:
CYPRESS_INSTALL_BINARY: 3.4.1
script:
- npm ci
- >
if [ "$CI_BUILD_REF_NAME" == "master" ]; then
export E2E_DOMAIN=https://www.minds.com
else
export E2E_DOMAIN=https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
fi
- export CYPRESS_baseUrl=$E2E_DOMAIN
- echo "E2E tests for $CI_BUILD_REF_NAME running against $E2E_DOMAIN with user $CYPRESS_username"
- $(npm bin)/cypress run --browser chrome --record --key $CYPRESS_RECORD_ID --config CYPRESS_baseUrl=$E2E_DOMAIN
artifacts:
when: always
paths:
- cypress/screenshots/**/*.mp4
- cypress/videos/**/*.mp4
cache:
paths:
- .npm
- cache/Cypress
allow_failure: true #manual inspection in case of timeouts
build:review:
stage: build
script:
- npm install # TODO: Why is this needed?
- npm ci && npm install -g gulp-cli
- npm run postinstall
- npm install -g gulp-cli
- gulp build.sass && gulp build.sass ##weird build needs to be run twice for now
- sh build/base-locale.sh dist
artifacts:
......@@ -36,9 +98,8 @@ build:review:
build:production:en:
stage: build
script:
- npm install # TODO: Why is this needed?
- npm ci && npm install -g gulp-cli
- npm run postinstall
- npm install -g gulp-cli
- gulp build.sass --deploy-url=https://cdn-assets.minds.com/front/dist/en && gulp build.sass --deploy-url=https://cdn-assets.minds.com/front/dist/en ##weird build needs to be run twice for now
- sh build/base-locale.sh dist https://cdn-assets.minds.com/front/dist
artifacts:
......@@ -53,9 +114,8 @@ build:production:en:
build:production:i18n:
stage: build
script:
- npm install # TODO: Why is this needed?
- npm ci && npm install -g gulp-cli
- npm run postinstall
- npm install -g gulp-cli
- gulp build.sass --deploy-url=https://cdn-assets.minds.com/front/dist/en && gulp build.sass --deploy-url=https://cdn-assets.minds.com/front/dist/en ##weird build needs to be run twice for now
- sh build/i18n-locales-all.sh dist https://cdn-assets.minds.com/front/dist
artifacts:
......@@ -67,7 +127,7 @@ build:production:i18n:
- master
- test/gitlab-ci
prepare:
prepare:review:
stage: prepare
image: minds/ci:latest
script:
......@@ -81,8 +141,23 @@ prepare:
- master
- test/gitlab-ci
deploy:review:
stage: deploy
prepare:production:
stage: prepare
image: minds/ci:latest
script:
- docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
- docker build -t $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF -f containers/front-init/Dockerfile dist/.
- docker push $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF
only:
refs:
- master
- test/gitlab-ci
dependencies:
- build:production:en
- build:production:i18n
review:start:
stage: review
image: minds/helm-eks:latest
script:
- aws eks update-kubeconfig --name=sandbox
......@@ -100,14 +175,14 @@ deploy:review:
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
on_stop: deploy:review:stop
on_stop: review:stop
except:
refs:
- master
- test/gitlab-ci
deploy:review:stop:
stage: deploy
review:stop:
stage: review
image: minds/helm-eks:latest
script:
- aws eks update-kubeconfig --name=sandbox
......@@ -124,13 +199,73 @@ deploy:review:stop:
- master
- test/gitlab-ci
staging:fpm:
stage: deploy:staging
image: minds/ci:latest
script:
- IMAGE_LABEL="staging"
## Sync assets with CDN
- aws s3 sync dist $S3_REPOSITORY_URL
- $(aws ecr get-login --no-include-email --region us-east-1)
## Update docker front-init container
- docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
- docker pull $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF
- docker tag $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF $ECR_REPOSITORY_URL:$IMAGE_LABEL
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_STAGING_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
only:
refs:
- master
- test/gitlab-ci
dependencies:
- build:production:en
- build:production:i18n
environment:
name: staging
url: https://www.minds.com # requires staging cookie
deploy:canary:
stage: deploy:canary
image: minds/ci:latest
script:
- IMAGE_LABEL="canary"
## Sync assets with CDN
- aws s3 sync dist $S3_REPOSITORY_URL
- $(aws ecr get-login --no-include-email --region us-east-1)
## Update docker front-init container
- docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
- docker pull $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF
- docker tag $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF $ECR_REPOSITORY_URL:$IMAGE_LABEL
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_CANARY_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
only:
refs:
- master
- test/gitlab-ci
dependencies:
- build:production:en
- build:production:i18n
environment:
name: canary
url: https://www.minds.com/?canary=1 # requires canary cookie
when: manual
allow_failure: false # prevents auto deploy to full production
deploy:production:
stage: deploy
stage: deploy:production
image: minds/ci:latest
script:
- aws s3 sync dist $REPOSITORY_URL
- aws ecs update-service --service=$SERVICE --force-new-deployment --region us-east-1 --cluster=$CLUSTER
- IMAGE_LABEL="production"
- $(aws ecr get-login --no-include-email --region us-east-1)
## Update docker front-init container
- docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
- docker pull $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF
- docker tag $CI_REGISTRY_IMAGE/front-init:$CI_BUILD_REF $ECR_REPOSITORY_URL:$IMAGE_LABEL
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_PRODUCTION_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
only:
refs:
- master
......@@ -140,3 +275,6 @@ deploy:production:
- build:production:i18n
environment:
name: production
url: https://www.minds.com
when: delayed
start_in: 2 hours # reduce? can always be deployed manually earlier too
......@@ -2,8 +2,8 @@ context('Blogs', () => {
beforeEach(() => {
cy.login(true);
cy.location('pathname').should('eq', `/newsfeed/subscriptions`);
cy.location('pathname', { timeout: 30000 })
.should('eq', `/newsfeed/subscriptions`);
})
it('should not be able to create a new blog if no title or banner are specified', () => {
......@@ -46,7 +46,7 @@ context('Blogs', () => {
// click on hashtags dropdown
cy.get('.m-category-info m-hashtags-selector .m-dropdown--label-container').click();
// select #ART
cy.get('.m-category-info m-dropdown m-form-tags-input > div:nth-child(1) > span').contains('#art').click();
cy.get('.m-category-info m-dropdown m-form-tags-input > div > span').contains('#art').click();
// type in another hashtag manually
cy.get('.m-category-info m-hashtags-selector m-form-tags-input input').type('hashtag{enter}').click();
......@@ -73,11 +73,12 @@ context('Blogs', () => {
cy.wait(1000);
cy.get('.m-button--submit').click();
cy.get('.m-button--submit').click({ force: true }); // TODO: Investigate why disabled flag is being detected
cy.wait(100);
// Blogs will not save, nor return error, if a user doesn't have an avatar
cy.location('pathname').should('contains', `/${Cypress.env().username}/blog`);
cy.location('pathname', { timeout: 30000})
.should('contains', `/${Cypress.env().username}/blog`);
cy.get('.m-blog--title').contains('Title');
cy.get('.minds-blog-body p').contains('Content');
......@@ -88,7 +89,7 @@ context('Blogs', () => {
//open dropdown
cy.get('m-post-menu button.minds-more').click();
cy.get('m-post-menu ul.minds-dropdown-menu li:nth-child(3)').contains('Delete').click();
cy.get('m-post-menu ul.minds-dropdown-menu li').contains('Delete').click();
cy.get('m-post-menu m-modal-confirm .mdl-button--colored').click();
})
......
context('Discovery', () => {
beforeEach(() => {
cy.login(true);
cy.location('pathname').should('eq', `/newsfeed/subscriptions`);
cy.location('pathname', { timeout: 30000 })
.should('eq', `/newsfeed/subscriptions`);
});
it('should allow a user to post on the discovery page', () => {
......@@ -57,7 +59,6 @@ context('Discovery', () => {
.click()
.should('have.css', 'color', 'rgb(70, 144, 223)'); // selected color
cy.get('.m-newsfeed__entity .m-owner-block a > span:nth-child(1)');
cy.url().should('include', '/latest');
});
......@@ -116,10 +117,12 @@ context('Discovery', () => {
});
it('should allow the user to filter by a single hashtag', () => {
cy.get('.m-hashtagsSidebarSelector__list > ul > li:nth-child(1) .m-hashtagsSidebarSelectorList__visibility > i').click();
cy.get('.m-hashtagsSidebarSelector__list > ul > li:nth-child(1) .m-hashtagsSidebarSelectorList__visibility > i')
.click(); // Will fail on non-configured users
});
it('should allow the user to turn off single hashtag filter and view all posts', () => {
cy.get('.m-hashtagsSidebarSelector__list > ul > li:nth-child(1) .m-hashtagsSidebarSelectorList__visibility > i').click();
cy.get('.m-hashtagsSidebarSelector__list > ul > li:nth-child(1) .m-hashtagsSidebarSelectorList__visibility > i')
.click();
})
})
\ No newline at end of file
context('Groups', () => {
beforeEach(() => {
cy.login(true);
cy.location('pathname', { timeout: 30000 })
.should('eq', `/newsfeed/subscriptions`);
})
it('should create and edit a group', () => {
......@@ -20,7 +23,7 @@ context('Groups', () => {
// click on hashtags dropdown
cy.get('m-hashtags-selector .m-dropdown--label-container').click();
// select #ART
cy.get('m-hashtags-selector m-dropdown m-form-tags-input > div:nth-child(1) > span').contains('#art').click();
cy.get('m-hashtags-selector m-dropdown m-form-tags-input > div > span').contains('#art').click();
// type in another hashtag manually
cy.get('m-hashtags-selector m-form-tags-input input').type('hashtag{enter}').click();
// click away
......@@ -54,9 +57,9 @@ context('Groups', () => {
})
it('should be able to toggle conversation and comment on it', () => {
cy.get('m-group--sidebar-markers li:nth-child(2)').contains('test group').click();
cy.wait(1000);
cy.get('m-group--sidebar-markers li:nth-child(3)').contains('test group').click();
// toggle the conversation
cy.get('.m-groupGrid__right').should('be.visible');
......@@ -88,7 +91,7 @@ context('Groups', () => {
})
it('should post an activity inside the group and record the view when scrolling', () => {
cy.get('m-group--sidebar-markers li:nth-child(2)').contains('test group').click();
cy.get('m-group--sidebar-markers li:nth-child(3)').contains('test group').click();
cy.wait(1000);
......@@ -122,7 +125,7 @@ context('Groups', () => {
});
it('should delete a group', () => {
cy.get('m-group--sidebar-markers li:nth-child(2)').contains('test group').click();
cy.get('m-group--sidebar-markers li:nth-child(3)').contains('test group').click();
cy.wait(1000);
......
......@@ -4,7 +4,7 @@ context('Login', () => {
})
it('should login', () => {
cy.get('.m-btn--login').click();
cy.get('.m-v2-topbar__Container__LoginWrapper > a').click();
cy.location('pathname').should('eq', '/login');
......@@ -17,11 +17,12 @@ context('Login', () => {
cy.get('minds-form-login .m-btn--login').click();
cy.location('pathname').should('eq', '/newsfeed/subscriptions');
cy.location('pathname', { timeout: 10000 })
.should('eq', '/newsfeed/subscriptions');
})
it('should fail to login because of incorrect password', () => {
cy.get('.m-btn--login').click();
cy.get('.m-v2-topbar__Container__LoginWrapper > a').click();
cy.location('pathname').should('eq', '/login');
......
......@@ -2,8 +2,10 @@ context('Newsfeed', () => {
beforeEach(() => {
cy.login(true);
cy.location('pathname', { timeout: 5000 }).should('eq', '/newsfeed/subscriptions');
cy.location('pathname', { timeout: 30000 })
.should('eq', '/newsfeed/subscriptions');
})
it('should post an activity picking hashtags from the dropdown', () => {
cy.get('minds-newsfeed-poster').should('be.visible');
......@@ -13,7 +15,7 @@ context('Newsfeed', () => {
cy.get('minds-newsfeed-poster m-hashtags-selector .m-dropdown--label-container').click();
// select #ART
cy.get('minds-newsfeed-poster m-hashtags-selector m-dropdown m-form-tags-input > div:nth-child(1) > span').contains('#art').click();
cy.get('minds-newsfeed-poster m-hashtags-selector m-dropdown m-form-tags-input > div > span').contains('#art').click();
// type in another hashtag manually
cy.get('minds-newsfeed-poster m-hashtags-selector m-form-tags-input input').type('hashtag{enter}').click();
......@@ -127,10 +129,10 @@ context('Newsfeed', () => {
})
it('should have an "Upgrade to Plus" button and it should redirect to /plus', () => {
cy.get('.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:first-child span')
cy.get('.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:nth-child(2) span')
.contains('Upgrade to Plus');
cy.get('.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:first-child').should('have.attr', 'href', '/plus')
cy.get('.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:nth-child(2)').should('have.attr', 'href', '/plus')
.click();
cy.location('pathname').should('eq', '/plus');
......@@ -155,7 +157,7 @@ context('Newsfeed', () => {
})
it('clicking on "create blog" button in poster should prompt a confirm dialog and open a new blog with the currently inputted text', () => {
cy.get('minds-newsfeed-poster textarea').type('#thegreatmigration');
cy.get('minds-newsfeed-poster textarea').type('thegreatmigration'); // TODO: fix UX issue when hashtag element is overlapping input
const stub = cy.stub();
cy.on('window:confirm', stub);
......@@ -167,7 +169,7 @@ context('Newsfeed', () => {
cy.location('pathname').should('eq', '/blog/edit/new');
cy.get('m-inline-editor .medium-editor-element.medium-editor-insert-plugin p').contains('#thegreatmigration');
cy.get('m-inline-editor .medium-editor-element.medium-editor-insert-plugin p').contains('thegreatmigration');
})
it('should record a view when the user scrolls and an activity is visible', () => {
......@@ -182,6 +184,8 @@ context('Newsfeed', () => {
cy.scrollTo(0, '20px');
cy.wait(600);
cy.wait('@view', { requestTimeout: 2000 }).then((xhr) => {
expect(xhr.status).to.equal(200);
expect(xhr.response.body).to.deep.equal({ status: 'success' });
......@@ -201,112 +205,4 @@ context('Newsfeed', () => {
cy.location('pathname').should('eq', '/groups/create');
})
it("clicking on the dropdown on the right should allow to go to the user's channel", () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(1)')
.contains('View Channel')
.click();
cy.location('pathname').should('eq', `/${Cypress.env().username}`);
})
it('clicking on the dropdown on the right should allow to go to settings', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(2)')
.contains('Settings')
.click();
cy.location('pathname').should('eq', '/settings/general');
})
it('clicking on the dropdown on the right should allow to go to the boost console', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(3)')
.contains('Boost Console')
.click();
cy.location('pathname').should('eq', '/boost/console/newsfeed/history');
})
it('clicking on the dropdown on the right should allow to go to the boost console', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(4)')
.contains('Help Desk')
.click();
cy.location('pathname').should('eq', '/help');
})
it('clicking on the dropdown on the right should allow to view the whitepaper', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(5)')
.contains('Whitepaper');
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(5) a')
.should('have.attr', 'href')
.and('include', '/assets/documents/Whitepaper-v0.3.pdf');
})
it('clicking on the dropdown on the right should redirect to /canary', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(6)')
.contains('Canary')
.click();
cy.location('pathname').should('eq', '/canary');
})
it('clicking on the dropdown on the right should allow to toggle Dark Mode', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('body.m-theme__light').should('be.visible');
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(7)')
.contains('Dark Mode')
.click();
cy.get('body.m-theme__dark').should('be.visible');
cy.get('m-user-menu .m-user-menu__Dropdown li:nth-child(7)')
.contains('Light Mode')
.click();
cy.get('body.m-theme__light').should('be.visible');
})
it('clicking on the bulb on the topbar should redirect to /newsfeed/subscriptions', () => {
cy.get('.m-v2-topbarNavItem__Logo img').should('be.visible');
cy.get('.m-v2-topbarNavItem__Logo').click();
cy.location('pathname').should('eq', '/newsfeed/subscriptions');
})
it('clicking on the bell should open the notifications dropdown, and allow to view all notifications by redirecting to /notifications', () => {
cy.get('.m-v2-topbar__UserMenu m-notifications--flyout').should('not.be.visible');
cy.get('.m-v2-topbar__UserMenu a.m-notifications--topbar-toggle--icon')
.should('be.visible')
.click();
cy.get('.m-v2-topbar__UserMenu m-notifications--flyout').should('be.visible');
cy.get('.m-notifications--flyout--bottom-container a')
.click();
cy.location('pathname').should('eq', '/notifications');
})
})
context('Topbar', () => {
beforeEach(() => {
cy.login(true);
cy.location('pathname', { timeout: 30000 })
.should('eq', '/newsfeed/subscriptions');
})
it("clicking on the dropdown on the right should allow to go to the user's channel", () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li')
.contains('View Channel')
.click();
cy.location('pathname').should('eq', `/${Cypress.env().username}`);
})
it('clicking on the dropdown on the right should allow to go to settings', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li')
.contains('Settings')
.click();
cy.location('pathname').should('eq', '/settings/general');
})
it('clicking on the dropdown on the right should allow to go to the boost console', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li')
.contains('Boost Console')
.click();
// TOFIX: no boost redirects to create
// cy.location('pathname').should('eq', '/boost/console/newsfeed/history');
})
it('clicking on the dropdown on the right should allow to go to the boost console', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li')
.contains('Help Desk')
.click();
cy.location('pathname').should('eq', '/help');
})
it('clicking on the dropdown on the right should redirect to /canary', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('m-user-menu .m-user-menu__Dropdown li')
.contains('Canary')
.click();
cy.location('pathname').should('eq', '/canary');
})
it('clicking on the dropdown on the right should allow to toggle Dark Mode', () => {
// open the menu
cy.get('m-user-menu .m-user-menu__Anchor').click();
cy.get('body.m-theme__light').should('be.visible');
cy.get('m-user-menu .m-user-menu__Dropdown li')
.contains('Dark Mode')
.click();
cy.get('body.m-theme__dark').should('be.visible');
cy.get('m-user-menu .m-user-menu__Dropdown li')
.contains('Light Mode')
.click();
cy.get('body.m-theme__light').should('be.visible');
})
it('clicking on the bulb on the topbar should redirect to /newsfeed/subscriptions', () => {
cy.get('.m-v2-topbarNavItem__Logo img').should('be.visible');
cy.get('.m-v2-topbarNavItem__Logo').click();
cy.location('pathname').should('eq', '/newsfeed/subscriptions');
})
it('clicking on the bell should open the notifications dropdown, and allow to view all notifications by redirecting to /notifications', () => {
cy.get('.m-v2-topbar__UserMenu m-notifications--flyout').should('not.be.visible');
cy.get('.m-v2-topbar__UserMenu a.m-notifications--topbar-toggle--icon')
.should('be.visible')
.click();
cy.get('.m-v2-topbar__UserMenu m-notifications--flyout').should('be.visible');
cy.get('.m-notifications--flyout--bottom-container a')
.click();
cy.location('pathname').should('eq', '/notifications');
})
})
......@@ -24,7 +24,14 @@
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
// Staging requires cookie to be set
Cypress.Cookies.defaults({
whitelist: 'staging'
});
Cypress.Commands.add('login', (canary) => {
cy.setCookie('staging', "1"); // Run in stagin mode. Note: does not impact review sites
cy.visit('/login');
cy.get('.m-btn--login').click();
......@@ -39,7 +46,7 @@ Cypress.Commands.add('uploadFile', (selector, fileName, type = '') => {
cy.get(selector).then((subject) => {
cy.fixture(fileName, 'base64').then((content) => {
const el = subject[0];
const blob = cy.visit('/newsfeed/global/top');b64toBlob(content, type);
const blob = b64toBlob(content, type);
cy.window().then((win) => {
const testFile = new win.File([blob], fileName, { type });
const dataTransfer = new DataTransfer();
......@@ -53,7 +60,7 @@ Cypress.Commands.add('uploadFile', (selector, fileName, type = '') => {
});
Cypress.Commands.add('post', (message) => {
cy.get('mwl-text-input-autocomplete-container textarea').type(message);
cy.get('m-text-input--autocomplete-container textarea').type(message);
cy.get('.m-posterActionBar__PostButton').click();
});
......
This diff is collapsed.
......@@ -57,7 +57,7 @@
"@types/jasminewd2": "~2.0.4",
"@types/node": "~10.12.18",
"codelyzer": "^4.5.0",
"cypress": "^3.2.0",
"cypress": "^3.4.1",
"gulp": "~4.0.0",
"gulp-autoprefixer": "^6.0.0",
"gulp-css-globbing": "^0.2.2",
......
.m-androidApp__download {
box-sizing: border-box;
border: 2px solid rgba(255,255,255,0.6);
border-radius: 8px;
background: #111;
@include m-theme(){
border: 1px solid rgba(themed($m-white-always), 0.7);
background: themed($m-black-always);
}
display: block;
position: relative;
text-decoration: none;
height: 48px;
padding: 0 8px;
padding: 2px 8px 0 8px;
margin: auto;
cursor: pointer;
......@@ -32,13 +34,13 @@
-webkit-font-smoothing: antialiased;
@include m-theme(){
color: themed($m-white);
color: themed($m-white-always);
}
}
i.material-icons {
@include m-theme(){
color: themed($m-white);
color: themed($m-white-always);
}
}
}
......@@ -7,7 +7,8 @@ import {
Type,
ChangeDetectorRef,
ComponentRef,
ElementRef
ElementRef,
Injector
} from '@angular/core';
import { DynamicHostDirective } from '../../directives/dynamic-host.directive';
......@@ -43,7 +44,8 @@ export class MindsCard implements AfterViewInit {
private initialized: boolean = false;
constructor(
private _componentFactoryResolver: ComponentFactoryResolver
private _componentFactoryResolver: ComponentFactoryResolver,
private _injector: Injector
) { }
@Input('object') set _object(value: any) {
......@@ -120,7 +122,7 @@ export class MindsCard implements AfterViewInit {
viewContainerRef.clear();
this.componentRef = viewContainerRef.createComponent(componentFactory);
this.componentRef = viewContainerRef.createComponent(componentFactory, undefined, this._injector);
this.componentInstance = this.componentRef.instance;
this.anchorRef = viewContainerRef.element;
......
......@@ -104,7 +104,6 @@
padding:0;
}
.mdl-card__title{
//color: #FFF !important;
display:none;
}
.m-login-box input{
......
......@@ -5,7 +5,7 @@
<div class="m-blockchain--marketing--modal m-blockchain__ethModal">
<h2>Buy ETH</h2>
<h2>Buy ETH (US Only)</h2>
<div class="m-layout__row m-blockchainEthModal__form">
<div class="m-layout__cell">
......
......@@ -3,7 +3,6 @@
flex-direction: row;
flex-wrap: row;
flex-flow: row wrap;
//background: #FFF;
max-width: 1280px;
margin: auto;
......
......@@ -42,9 +42,11 @@ m-channels--sorted-module {
width: 100%;
height: 100%;
display: inline-block;
background-color: #333;
background-position: center center;
background-size: cover;
@include m-theme(){
background-color: themed($m-grey-900);
}
}
> i.material-icons {
......@@ -53,7 +55,9 @@ m-channels--sorted-module {
&.m-mature-module-thumbnail {
transform-style: preserve-3d;
background-color: rgba(0, 0, 0, 0.65);
@include m-theme(){
background-color: rgba(themed($m-black), 0.65);
}
> .m-channels--sorted-module__TileImage {
filter: blur(5px) grayscale(100%);
......@@ -68,7 +72,9 @@ m-channels--sorted-module {
left: 50%;
transform: translate(-50%, -50%);
font-size: 3em;
color: #fff;
@include m-theme(){
color: themed($m-white);
}
}
}
}
......
......@@ -58,9 +58,13 @@ export class LoginForm {
this.done.next(data.user);
})
.catch((e) => {
this.inProgress = false;
if (e.status === 'failed') {
if (!e) {
this.errorMessage = 'LoginException::Unknown';
this.session.logout();
} else if (e.status === 'failed') {
//incorrect login details
this.errorMessage = 'LoginException::AuthenticationFailed';
this.session.logout();
......
......@@ -22,7 +22,6 @@ minds-form-register{
//this is exactly the same as modal.scss
.m-fb-register-button{
color: #3b5998;
width: 170px;
border: 0;
cursor:pointer;
......@@ -31,15 +30,18 @@ minds-form-register{
padding: 0;
margin: 0;
margin-left: 8px;
border: 1px solid #3b5998;
@include m-theme(){
background-color: themed($m-white);
color: themed($m-facebook);
border: 1px solid themed($m-facebook);
}
.m-social-icons-icon-inline{
fill: #3b5998;
vertical-align: middle;
display: inline-block;
@include m-theme(){
fill: themed($m-facebook);
}
}
.m-signup-button-text{
......
......@@ -3,7 +3,6 @@
flex-direction: row;
flex-wrap: row;
flex-flow: row wrap;
//background: #FFF;
max-width: 1280px;
margin: auto;
......
......@@ -92,8 +92,6 @@
font-weight: 800;
letter-spacing: 1.25px;
line-height: 1;
//color: rgba(255,255,255,0.85);
//color: rgba(0,0,0,0.85);
@media screen and (max-width: 720px){
font-size: 42px;
......@@ -102,7 +100,6 @@
h3 {
font-size: 26px;
//color: rgba(255, 255, 255, 0.8);
font-weight: 400;
letter-spacing: 0.25px;
line-height: 1.25;
......@@ -131,7 +128,6 @@
padding:0;
}
.mdl-card__title{
//color: #FFF !important;
display:none;
}
.m-login-box input{
......@@ -142,7 +138,6 @@
text-rendering: optimizeLegibility;
font-family: 'Roboto', Helvetica, sans-serif;
letter-spacing: 1px;
//box-shadow: 0 0 6px rgba(255,255,255,0.22);
@include m-theme(){
background:rgba(themed($m-white),0.9);
color:themed($m-grey-800);
......
......@@ -3,7 +3,7 @@
}
.m-pin-button {
overflow: visible;
.m-tooltip--bubble {
width:100px;
}
......@@ -93,11 +93,9 @@ minds-activity {
line-height: 9px;
border-radius: 3px;
vertical-align: middle;
//text-align: center;
display: flex;
justify-content: space-around;
max-width: 300px;
//box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.07), 0 4px 2px -2px rgba(0, 0, 0, 0.1), 0 1px 5px 0 rgba(0, 0, 0, 0.07);
@include m-theme(){
background-color: themed($m-white);
......
......@@ -27,10 +27,14 @@
}
}
.m-social-icons-icon--facebook .m-social-icons-icon-inline{
background-color: #3067a3 !important;
@include m-theme(){
background-color: themed($m-facebook) !important;
}
}
.m-social-icons-icon--twitter .m-social-icons-icon-inline{
background-color: #03b3ee !important;
@include m-theme(){
background-color: themed($m-twitter) !important;
}
}
.m-social-icons-icon--email .m-social-icons-icon-inline{
@include m-theme(){
......@@ -38,10 +42,14 @@
}
}
.m-social-icons-icon--linkedin .m-social-icons-icon-inline{
background-color: #0071a1 !important;
@include m-theme(){
background-color: themed($m-linkedin) !important;
}
}
.m-social-icons-icon--gplus .m-social-icons-icon-inline{
background-color: #e15440 !important;
@include m-theme(){
background-color: themed($m-red) !important;
}
}
.m-social-icons-icon--embed .m-social-icons-icon-inline{
@include m-theme(){
......
......@@ -27,7 +27,7 @@
.m-marketing--header-inner, .m-marketingHeader__inner,
.m-marketing--hero-inner, .m-marketingHero__inner,
.m-marketing--hero--inner {
.m-marketing--hero--inner {
display: flex;
flex-direction: row;
align-items: center;
......@@ -95,7 +95,6 @@
h3 {
font-size: 26px;
//color: rgba(255, 255, 255, 0.8);
font-weight: 400;
letter-spacing: 0.25px;
line-height: 1.25;
......@@ -407,7 +406,7 @@
}
.m-marketing--section--subsection-image {
img {
img {
max-width: 100%;
}
}
......
......@@ -3,7 +3,6 @@
flex-direction: row;
flex-wrap: row;
flex-flow: row wrap;
//background: #FFF;
max-width: 1280px;
margin: auto;
......
......@@ -46,7 +46,6 @@
&.odd{
text-align:left;
.m-messenger--conversation-message-bubble{
//color:#FFF !important;
@include m-theme(){
background-color: themed($m-blue-grey-100) !important;
}
......
......@@ -20,7 +20,6 @@ m-modal-signup, m-modal-signup-on-action{
.mdl-card__title{
flex-wrap: wrap;
margin-bottom: 0;
//padding-bottom: 0;
img{
width: 168px;
......@@ -129,10 +128,14 @@ m-modal-share {
margin: 0 4px;
}
.m-social-share-twitter {
background: #4099FF !important;
@include m-theme(){
background: themed($m-twitter) !important;
}
}
.m-social-share-fb {
background: #335795 !important;
@include m-theme(){
background: themed($m-facebook) !important;
}
}
.m-social-share-email {
@include m-theme(){
......
......@@ -24,10 +24,14 @@
padding:24px 0 0;
.m-affiliate--link-buttons-twitter{
background:#4099FF !important;
@include m-theme(){
background: themed($m-twitter) !important;
}
}
.m-affiliate--link-buttons-fb{
background:#335795 !important;
@include m-theme(){
background: themed($m-facebook) !important;
}
}
.m-affiliate--link-buttons-email{
@include m-theme(){
......
......@@ -11,7 +11,9 @@ m-newsfeed__tiles {
margin: auto;
&.m-newsfeed__tiles--has-elements {
background: #ffffff;
@include m-theme(){
background: themed($m-white);
}
padding: 8px;
}
......@@ -24,7 +26,9 @@ m-newsfeed__tiles {
margin: 4px;
overflow: hidden;
transform-style: preserve-3d;
background-color: rgba(0, 0, 0, 0.65);
@include m-theme(){
background-color: rgba(themed($m-black), 0.65);
}
&.m-newsfeed-tiles__Tile--is-mature > img {
filter: blur(5px) grayscale(100%);
......@@ -45,9 +49,11 @@ m-newsfeed__tiles {
position: absolute;
bottom: 4px;
right: 4px;
color: #fff;
text-shadow: 1px 1px rgba(0, 0, 0, .35);
pointer-events: none;
@include m-theme(){
color: themed($m-white);
text-shadow: 1px 1px rgba(themed($m-black), .35);
}
}
i.material-icons.mature-icon {
......@@ -57,7 +63,9 @@ m-newsfeed__tiles {
left: 50%;
transform: translate(-50%, -50%);
font-size: 3em;
color: #fff;
@include m-theme(){
color: themed($m-white);
}
}
}
}
......@@ -19,12 +19,15 @@
}
border-radius: 24px;
font-weight: 600;
/* background: #fafafa; */
&.m-reportCreatorSubjects__subject--active {
border-color: #4690D6;
@include m-theme(){
border-color: themed($m-blue);
}
span {
color: #4690D6;
@include m-theme(){
color: themed($m-blue);
}
}
}
......@@ -38,13 +41,17 @@
text-rendering: optimizeLegibility;
font-size: 16px;
font-weight: 500;
color: #555;
cursor: pointer;
@include m-theme(){
color: themed($m-grey-700);
}
}
i {
color: #888;
display: none;
@include m-theme(){
color: themed($m-grey-400);
}
}
//&:last-child{
......
.m-juryDutySession__content {
background: #FFF;
padding: 16px;
@include m-theme(){
background: themed($m-white);
}
h3 {
margin: 0;
......
......@@ -4,13 +4,16 @@
padding: 0;
}
.m-juryDutySessionList__item {
margin-bottom: 16px;
margin-bottom: 16px;
}
.m-juryDutySessionList__number {
font-size: 56px;
font-weight: 800;
color: #444;
padding: 32px;
display: block;
@include m-theme(){
color: themed($m-grey-800);
}
}
.m-juryDutySession__hero {
background: #132552;
padding: 42px 0;
text-align: center;
@include m-theme(){
background: themed($m-blue-grey-800);
}
i {
font-size: 112px;
color: #FFF;
@include m-theme(){
color: themed($m-white);
}
}
}
......@@ -20,6 +24,8 @@
letter-spacing: 2px;
text-transform: uppercase;
font-weight: 600;
color: #666;
@include m-theme(){
color: themed($m-grey-600);
}
}
}
\ No newline at end of file
.m-reports__marketing {
.m-marketing__hero {
background-color: #132552 !important;
padding-bottom: 72px;
@include m-theme(){
background-color: themed($m-blue-grey-800) !important;
}
.m-marketingHero__inner {
padding-top: 0;
......@@ -12,18 +14,22 @@
}
.m-btn {
color: #FFF;
border-color: #FFF;
margin-top: 32px;
@include m-theme(){
color: themed($m-white);
border-color: themed($m-white);
}
}
}
.m-marketingHero__actions {
i {
color: #FFF;
font-size: 170px;
text-align: center;
width: 100%;
@include m-theme(){
color: themed($m-white);
}
}
}
}
......@@ -39,7 +45,9 @@
letter-spacing: 2px;
text-transform: uppercase;
font-weight: 600;
color: #666;
@include m-theme(){
color: themed($m-grey-600);
}
}
.m-layout__row {
......@@ -56,8 +64,10 @@
b {
font-size: 72px;
line-height: 1;
color: #444;
display: block;
@include m-theme(){
color: themed($m-grey-800);
}
}
span {
......@@ -65,9 +75,11 @@
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-weight: 500;
color: #555;
margin-top: 16px;
display: block;
@include m-theme(){
color: themed($m-grey-700);
}
}
}
......@@ -76,15 +88,19 @@
list-style: decimal;
font-size: 24px;
font-weight: 800;
color: #aaa;
@include m-theme(){
color: themed($m-grey-200);
}
li {
padding: 16px;
p {
font-size: 24px;
color: #555;
font-weight: 500;
@include m-theme(){
color: themed($m-grey-700);
}
}
}
......@@ -97,12 +113,14 @@
li {
width: 50%;
color: #888;
font-weight: 400;
font-size: 16px;
line-height: 24px;
cursor: default;
padding: 0;
@include m-theme(){
color: themed($m-grey-400);
}
@media screen and (max-width: 890px) {
width: 100%;
......
......@@ -194,8 +194,6 @@ m-search--bar-suggestions{
m-search {
display: block;
min-height: 100vh;
//background-color: themed($m-white);
//background: rgba(252,252,252,1);
padding-top: 42px;
.m-toolbar {
......
......@@ -15,12 +15,12 @@
text-decoration:none;
}
background-color: #3067a3 !important;
padding:8px;
font-weight:bold;
cursor:pointer;
@include m-theme(){
color: themed($m-white);
background-color: themed($m-facebook) !important;
}
}
......
......@@ -141,14 +141,18 @@ m-wallet--balance-money, m-wallet--balance-reward, m-wallet--balance-tokens {
.m-btn--slim {
height: 30px;
margin: 0 0 0 28px;
color: #888;
@include m-theme(){
color: themed($m-grey-400);
}
}
p {
text-align: left;
margin: 0;
padding: 0 8px;
color: #666;
@include m-theme(){
color: themed($m-grey-600);
}
}
}
......
......@@ -145,19 +145,27 @@
}
.m-referrals-links__shareButton--twitter {
background-color: #03b3ee;
@include m-theme(){
background-color: themed($m-twitter);
}
}
.m-referrals-links__shareButton--messenger {
background-color: #0084ff;
@include m-theme(){
background-color: themed($m-messenger);
}
}
.m-referrals-links__shareButton--facebook {
background-color: #3b5998;
@include m-theme(){
background-color: themed($m-facebook);
}
}
.m-referrals-links__shareButton--whatsapp {
background-color: #25d366;
@include m-theme(){
background-color: themed($m-whatsapp);
}
}
.m-referrals-links__shareButton--sms,
......
......@@ -26,7 +26,7 @@ export class AnalyticsService {
async send(type: string, fields: any = {}, entityGuid: string = null) {
if (type === 'pageview') {
this.client.post('api/v2/analytics/pageview', fields);
this.client.post('api/v2/mwa/pv', fields);
} else {
this.client.post('api/v1/analytics', { type, fields, entityGuid });
}
......
......@@ -660,10 +660,10 @@ m-translate {
svg.m-facebook-icon{
cursor:pointer;
background-color: #3067a3 !important;
margin:auto;
@include m-theme(){
fill: themed($m-white);
background-color: themed($m-facebook) !important;
}
}
......
......@@ -30,4 +30,4 @@
100% {
box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
}
}
}
\ No newline at end of file
......@@ -65,7 +65,14 @@ $red-light: #e57373;
$black: #000;
$white: #fff;
$facebook: #3b5998;
$messenger: #0084ff;
$twitter: #03b3ee;
$whatsapp: #25d366;
$linkedin: #0071a1;
// Theme maps
// e.g. m-grey-100 in light mode will become m-grey-900 in dark mode
$themes: (
light: (
m-grey-950: $grey-950,
......@@ -105,19 +112,25 @@ $themes: (
m-amber-light: $amber-light,
m-red-dark: $red-dark,
m-red: $red,
m-red-light: $red-light,
m-red-light: $red-light,
m-black: $black,
m-black-always: $black,
m-white: $white,
m-white-always: $white,
m-white-always: $white,
m-body-bg: #f8f8f8,
m-warn-bg: $amber-light,
m-warn-fg: $black,
m-facebook: $facebook,
m-messenger: $messenger,
m-twitter: $twitter,
m-whatsapp: $whatsapp,
m-linkedin: $linkedin,
),
dark: (
m-grey-950: lighten($grey-50, $percent),
m-grey-900: lighten($grey-100, $percent),
m-grey-800: lighten($grey-200, $percent),
......@@ -143,16 +156,16 @@ $themes: (
m-blue-grey-200: lighten($blue-grey-800, $percent),
m-blue-grey-100: lighten($blue-grey-900, $percent),
m-blue-grey-50: lighten($blue-grey-950, $percent),
m-black: $white,
m-black-always: $black,
m-white: lighten($grey-990, $percent),
m-white-always: $white,
m-body-bg: lighten(#080808, $percent),
m-white-always: $white,
m-body-bg: lighten(#080808, $percent),
m-blue-dark: lighten($blue-dark, $percent),
m-blue-dark: lighten($blue-bright, 15%),
m-blue: $blue-bright,
m-blue-light: lighten($blue-bright, 10%),
m-blue-light: $blue-dark,
m-green-dark: lighten($green-dark, $percent),
m-green: lighten($green, $percent),
m-green-light: lighten($green-light, $percent),
......@@ -165,6 +178,12 @@ $themes: (
m-warn-bg: $grey-900,
m-warn-fg: $white,
m-facebook: $facebook,
m-messenger: $messenger,
m-twitter: $twitter,
m-whatsapp: $whatsapp,
m-linkedin: $linkedin,
),
);
......@@ -218,3 +237,9 @@ $m-red-light: 'm-red-light';
$m-warn-bg: 'm-warn-bg';
$m-warn-fg: 'm-warn-fg';
$m-facebook: 'm-facebook';
$m-messenger: 'm-messenger';
$m-twitter: 'm-twitter';
$m-whatsapp: 'm-whatsapp';
$m-linkedin: 'm-linkedin';