Skip to content
Commits on Source (37)
......@@ -229,7 +229,7 @@ review:start:
image: minds/helm-eks:latest
script:
- aws eks update-kubeconfig --name=sandbox
- git clone --branch=sandbox-wip https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/minds/helm-charts.git
- git clone --branch=master https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/minds/helm-charts.git
- "helm upgrade \
--install \
--reuse-values \
......
......@@ -19,6 +19,7 @@
"assets": ["src/assets", "src/favicon.ico"],
"styles": [
"node_modules/material-design-lite/dist/material.blue_grey-amber.min.css",
"node_modules/plyr/dist/plyr.css",
"node_modules/material-design-icons/iconfont/material-icons.css",
"src/main.css"
],
......
// import 'cypress-file-upload';
context('Blogs', () => {
const closeButton = '[data-cy=data-minds-conversation-close]';
before(() => {
cy.getCookie('minds_sess')
.then((sessionCookie) => {
......@@ -8,6 +11,14 @@ context('Blogs', () => {
return cy.login(true);
}
});
// ensure no messenger windows are open.
cy.get('body').then(($body) => {
if ($body.find(closeButton).length) {
cy.get(closeButton)
.click({multiple: true});
}
});
});
beforeEach(() => {
......@@ -98,8 +109,19 @@ context('Blogs', () => {
);
if (nsfw) {
cy.get('.m-mature-info a').click();
cy.get('.m-mature-info a span').contains('Mature content');
// click on nsfw dropdown
cy.get(
'm-nsfw-selector .m-dropdown--label-container'
).click();
// select Nudity
cy.get('m-nsfw-selector .m-dropdownList__item')
.contains('Nudity')
.click();
// click away
cy.get('m-nsfw-selector .minds-bg-overlay').click({force: true});
}
if (schedule) {
......@@ -197,7 +219,7 @@ context('Blogs', () => {
cy.get('.m-blog--title').contains(title);
cy.get('.minds-blog-body p').contains(body);
};
it('should not be able to create a new blog if no title or banner are specified', () => {
cy.visit('/blog/edit/new');
cy.get('.m-button--submit').click();
......
......@@ -116,18 +116,47 @@ context('Discovery', () => {
cy.get("m-topbar--navigation--options ul > m-nsfw-selector ul > li:contains('Other')").click();
});
it('should allow the user to filter by a single hashtag', () => {
it('should allow the user to turn off single hashtag filter and view all posts', () => {
cy.visit('/newsfeed/global/top');
cy.get('m-hashtagssidebarselector__item')
.first()
.click();
});
it('should allow the user to turn off single hashtag filter and view all posts', () => {
it.skip('should allow the user to toggle a single hashtag and then toggle back to the initial feed', () => {
cy.visit('/newsfeed/global/top');
cy.get('m-hashtagssidebarselector__item')
.first()
.find('.m-hashtagsSidebarSelectorList__visibility > i')
.click();
})
// get first label value
cy.get('.m-hashtagsSidebarSelectorList__label').first().invoke('text').then((text) => {
// repeat twice to capture full cycle.
Cypress._.times(2, (i) => {
// split hashtag off of label text
let label = text.split('#')[1];
// click switch
toggleFirstVisibilitySwitch();
// check location name has updated
cy.location('pathname')
.should('eq', `/newsfeed/global/top;period=12h;hashtag=${label}`);
// click switch
toggleFirstVisibilitySwitch();
// check location name has updated
cy.location('pathname')
.should('eq', `/newsfeed/global/top;period=12h`);
});
});
});
// click first visibility switch
const toggleFirstVisibilitySwitch = () => {
cy.get('m-hashtagssidebarselector__item')
.first()
.find('.m-hashtagsSidebarSelectorList__visibility > i')
.click();
}
})
......@@ -661,4 +661,56 @@ context('Newsfeed', () => {
});
});
// enable once failing tests are fixed
it.skip('should post an nsfw activity when value is held by the selector (is blue) but it has not been clicked yet', () => {
// click on nsfw dropdown
cy.get(
'minds-newsfeed-poster m-nsfw-selector .m-dropdown--label-container'
).click();
// select Nudity
cy.get('minds-newsfeed-poster m-nsfw-selector .m-dropdownList__item')
.contains('Nudity')
.click();
// click away
cy.get('minds-newsfeed-poster m-nsfw-selector .minds-bg-overlay').click();
// navigate away from newsfeed and back.
cy.get('[data-cy=data-minds-nav-wallet-button]').first().click(); // bottom bar exists, so take first child
cy.get('[data-cy=data-minds-nav-newsfeed-button]').first().click();
newActivityContent('This is a nsfw post');
postActivityAndAwaitResponse(200);
// should have the mature text toggle
cy.get(
'.minds-list > minds-activity:first-child .message .m-mature-text-toggle'
).should('not.have.class', 'mdl-color-text--red-500');
cy.get(
'.minds-list > minds-activity:first-child .message .m-mature-message-content'
).should('have.class', 'm-mature-text');
// click the toggle
cy.get(
'.minds-list > minds-activity:first-child .message .m-mature-text-toggle'
).click();
// text should be visible now
cy.get(
'.minds-list > minds-activity:first-child .message .m-mature-text-toggle'
).should('have.class', 'mdl-color-text--red-500');
cy.get(
'.minds-list > minds-activity:first-child .message .m-mature-message-content'
).should('not.have.class', 'm-mature-text');
cy.get(
'.minds-list > minds-activity:first-child .message .m-mature-message-content'
).contains('This is a nsfw post');
deleteActivityFromNewsfeed();
});
});
......@@ -5,64 +5,95 @@
context('Pro Settings', () => {
if (Cypress.env().pro_password) {
// required to run tests against pro user only.
const title = '#title';
const headline = '#headline';
function data(str) {
return `[data-minds=${str}]`;
}
const activityContainer = 'minds-activity';
const footerText = '#footer_text';
const sidebarMenu = data('sidebarMenuLinks');
const general = {
title: data('title'),
headline: data('headline'),
publish: data('publish'),
strings: {
title: 'Minds Pro E2E',
headline: 'This headline is a test',
},
};
const theme = {
textColor: '#textColor',
primaryColor: '#primaryColor',
plainBackgroundColor: '#plainBgColor',
schemeLight: '#scheme_light',
schemeDark: '#scheme_dark',
textColor: data('textColor'),
primaryColor: data('primaryColor'),
plainBgColor: data('plainBgColor'),
schemeLight: data('schemeLight'),
schemeDark: data('schemeDark'),
aspectRatio: {
169: '#tile_ratio_16:9', // 16:9
1610: '#tile_ratio_16:10', // 16:10
43: '#tile_ratio_4:3', // 4:3
11: '#tile_ratio_1:1', // 1:1
169: data('tileRatio_16:9'), // 16:9
1610: data('tileRatio_16:10'), // 16:10
43: data('tileRatio_4:3'), // 4:3
11: data('tileRatio_1:1'), // 1:1
},
strings: {
textColor: '#4690df',
primaryColor: '#cb7848',
plainBgColor: '#b4bbf0',
textColorRgb: 'rgb(70, 144, 223)',
primaryColorRgb: 'rgb(203, 120, 72)',
plainBgColorRgba: 'rgba(180, 187, 240, 0.627)',
resetColor: '#ffffff',
},
};
const hashtags = {
labelInput0: '#tag-label-0',
hashtagInput0: '#tag-tag-0',
labelInput1: '#tag-label-1',
hashtagInput1: '#tag-tag-1',
label1: 'label1',
label2: 'label2',
label3: 'label3',
hashtag1: '#hashtag1',
hashtag2: '#hashtag2',
hashtag3: '#hashtag3',
const assets = {
logo: data('logo'),
background: data('background'),
strings: {
logoFixture: '../../fixtures/avatar.jpeg',
backgroundFixture:
'../../fixtures/international-space-station-1776401_1920.jpg',
},
};
const footer = {
hrefInput: `#footer_link-href-0`,
titleInput: `#footer_link-title-0`,
const hashtags = {
add: data('addHashtag'),
label0: data('tag__label--0'),
tag0: data('tag__tag--0'),
label1: data('tag__label--1'),
tag1: data('tag__tag--1'),
strings: {
label0: 'Label0',
label1: 'Label1',
tag0: '#hashtag0',
tag1: '#hashtag1',
},
};
const strings = {
title: 'Minds Pro E2E',
headline: 'This headline is a test',
footer: 'This is a footer',
footerTitle: 'Minds',
footerHref: 'https://www.minds.com/',
const footer = {
text: data('footerText'),
add: data('addFooterLink'),
linkTitle: data('footerLink__title--0'),
linkHref: data('footerLink__href--0'),
strings: {
text: 'This is a footer',
linkTitle: 'Minds',
linkHref: 'https://www.minds.com/',
},
};
before(() => {
cy.login(true, Cypress.env().pro_username, Cypress.env().pro_password);
});
after(() => {
// cy.visit(`/${Cypress.env().username}`);
cy.visit('/pro/' + Cypress.env().pro_username + '/settings/hashtags')
.location('pathname')
.should(
'eq',
'/pro/' + Cypress.env().pro_username + '/settings/hashtags'
);
clearHashtags();
// Make a post
cy.route('POST', '**/api/v1/newsfeed').as('newsfeed');
cy.visit('/newsfeed/subscriptions');
cy.get('minds-newsfeed-poster textarea')
.click()
.type('Testing 1-2-3');
cy.get('minds-newsfeed-poster .m-posterActionBar__PostButton').click();
cy.wait('@newsfeed').then(xhr => {
expect(xhr.status).to.equal(200);
});
});
beforeEach(() => {
......@@ -76,157 +107,247 @@ context('Pro Settings', () => {
'eq',
'/pro/' + Cypress.env().pro_username + '/settings/general'
);
// ensure window is wide enough to find pro topbar links
cy.viewport(1300, 768);
});
it('should update the title and headline', () => {
it.skip('should update the title and headline', () => {
//enter data
cy.get(title)
cy.get(general.title)
.focus()
.clear()
.type(strings.title);
.type(general.strings.title);
cy.get(headline)
cy.get(general.headline)
.focus()
.clear()
.type(strings.headline);
.type(general.strings.headline);
saveAndPreview();
//check tab title.
//check tab title
cy.title().should(
'eq',
strings.title + ' - ' + strings.headline + ' | Minds'
general.strings.title + ' - ' + general.strings.headline + ' | Minds'
);
});
// Need to find a way around the color input in Cypress.
it('should allow the user to set theme colors', () => {
cy.get(sidebarMenu)
.contains('Theme')
.click();
// reset colors so changes will be submitted
cy.get(theme.textColor)
.click()
.clear()
.type(theme.strings.resetColor);
cy.get(theme.primaryColor)
.click()
.clear()
.type(theme.strings.resetColor);
cy.get(theme.plainBgColor)
.click()
.clear()
.type(theme.strings.resetColor);
save();
// set theme colors to be tested
cy.get(theme.textColor)
.click()
.clear()
.type(theme.strings.textColor);
cy.get(theme.primaryColor)
.click()
.clear()
.type(theme.strings.primaryColor);
cy.get(theme.plainBgColor)
.click()
.clear()
.type(theme.strings.plainBgColor);
saveAndPreview();
cy.get('.m-pro__searchBox input').should(
'have.css',
'background-color',
theme.strings.plainBgColorRgba
);
cy.get('.m-proChannelTopbar__navItem')
.contains('Videos')
.should('have.css', 'color', theme.strings.textColorRgb);
cy.get('.m-proChannelTopbar__navItem')
.contains('Feed')
.click();
it('should allow the user to set a dark theme for posts', () => {
cy.contains('Theme').click();
// make window narrow enough to show hamburger icon/menu
cy.viewport('ipad-mini');
cy.get('.m-proHamburgerMenu__trigger')
.click()
.get('.m-proHamburgerMenu__item--active')
.should('have.css', 'color')
.and('eq', theme.strings.primaryColorRgb);
});
// Skipping until Emi changes feeds from 'top' to 'latest'
it.skip('should allow the user to set a dark theme for posts', () => {
cy.get(sidebarMenu)
.contains('Theme')
.click();
cy.get(theme.schemeDark).click();
// Toggle radio to enable submit button
cy.get(theme.schemeLight).click({ force: true });
cy.get(theme.schemeDark).click({ force: true });
saveAndPreview();
cy.contains('Feed').click();
cy.get('.m-proChannelTopbar__navItem')
.contains('Feed')
.click();
cy.get(activityContainer)
.should('have.css', 'background-color')
.and('eq', 'rgb(35, 35, 35)');
});
it('should allow the user to set a light theme for posts', () => {
cy.contains('Theme').click();
// Skipping until Emi changes feeds from 'top' to 'latest'
it.skip('should allow the user to set a light theme for posts', () => {
cy.get(sidebarMenu)
.contains('Theme')
.click();
cy.get(theme.schemeLight).click();
// Toggle radio to enable submit button
cy.get(theme.schemeDark).click({ force: true });
cy.get(theme.schemeLight).click({ force: true });
saveAndPreview();
cy.contains('Feed').click();
cy.get('.m-proChannelTopbar__navItem')
.contains('Feed')
.click();
cy.get(activityContainer)
.should('have.css', 'background-color')
.and('eq', 'rgb(255, 255, 255)');
});
it.skip('should allow the user to upload logo and background images', () => {
cy.get(sidebarMenu)
.contains('Assets')
.click();
cy.uploadFile(assets.logo, assets.strings.logoFixture, 'image/jpeg');
cy.uploadFile(
assets.background,
assets.strings.backgroundFixture,
'image/jpg'
);
saveAndPreview();
// cy.get('.m-proChannelTopbar__logo').should('have.attr', 'src', Cypress.env().url + '/fs/v1/pro/930229554033729554/logo/1574379135');
// cy.get(m-proChannel).should('have.attr', 'background-image', 'url(' + Cypress.env().url + '/fs/v1/banners/998753812159717376/fat/1563497464)');
});
it('should allow the user to set category hashtags', () => {
cy.contains('Hashtags').click();
cy.get(sidebarMenu)
.contains('Hashtags')
.click();
cy.contains('Add').click();
cy.get(hashtags.add).click();
cy.get('m-draggableList')
.contains('clear')
.click({ multiple: true });
cy.get(hashtags.labelInput0)
cy.get(hashtags.add).click();
cy.get(hashtags.label0)
.clear()
.type(hashtags.label1);
.type(hashtags.strings.label0);
cy.get(hashtags.hashtagInput0)
cy.get(hashtags.tag0)
.clear()
.type(hashtags.hashtag1);
.type(hashtags.strings.tag0);
cy.contains('Add').click();
cy.get(hashtags.add).click();
cy.get(hashtags.labelInput1)
.first()
cy.get(hashtags.label1)
.clear()
.type(hashtags.label2);
.type(hashtags.strings.label1);
cy.get(hashtags.hashtagInput1)
.first()
cy.get(hashtags.tag1)
.clear()
.type(hashtags.hashtag2);
.type(hashtags.strings.tag1);
saveAndPreview();
//check the labels are present and clickable.
cy.contains('label1');
cy.contains('label2');
cy.contains(hashtags.strings.label0);
cy.contains(hashtags.strings.label1);
});
it('should allow the user to set footer', () => {
cy.contains('Footer').click();
cy.get(sidebarMenu)
.contains('Footer')
.click();
cy.get(footerText)
.clear()
.type(strings.footer);
// clear any existing footer links
cy.get(footer.add).click();
cy.get('m-draggableList')
.contains('clear')
.click({ multiple: true });
cy.contains('Add Link').click();
// add a new footer link
cy.get(footer.add).click();
cy.get(footer.hrefInput)
cy.get(footer.linkHref)
.clear()
.type(strings.footerHref);
.type(footer.strings.linkHref);
cy.get(footer.titleInput)
cy.get(footer.linkTitle)
.clear()
.type(strings.footerTitle);
.type(footer.strings.linkTitle);
// add footer text
cy.get(footer.text)
.clear()
.type(footer.strings.text);
saveAndPreview();
cy.contains(strings.footerTitle)
cy.contains(footer.strings.linkTitle)
.should('have.attr', 'href')
.should('contain', strings.footerHref);
.should('contain', footer.strings.linkHref);
cy.get(footer.text).should('contain', footer.strings.text);
});
//save, await response, preview.
function saveAndPreview() {
function save() {
//save and await response
cy.contains('Save')
.click()
cy.get('.m-shadowboxSubmitButton')
.contains('Save')
.click({ force: true })
.wait('@settings')
.then(xhr => {
expect(xhr.status).to.equal(200);
expect(xhr.response.body).to.deep.equal({ status: 'success' });
});
//go to pro page
cy.contains('View Pro Channel').click();
}
function clearHashtags() {
cy.contains('Hashtags').click();
cy.contains('Add').click();
function saveAndPreview() {
save();
cy.contains('clear').click({ multiple: true });
saveAndPreview();
//go to pro page
cy.visit('/pro/' + Cypress.env().pro_username);
}
//
// it.only('should update the theme', () => {
// // nav to theme tab
// cy.contains('Theme')
// .click();
// cy.get(theme.plainBackgroundColor).then(elem => {
// elem.val('#00dd00');
// //save and await response
// cy.contains('Save')
// .click()
// .wait('@settings').then((xhr) => {
// expect(xhr.status).to.equal(200);
// expect(xhr.response.body).to.deep.equal({ status: 'success' });
// });
// //go to pro page
// cy.contains('View Pro Channel').click();
// })
}
});
......@@ -1980,6 +1980,11 @@
"integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==",
"dev": true
},
"@types/video.js": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@types/video.js/-/video.js-7.3.3.tgz",
"integrity": "sha512-yAb46+4A0dKFxOQRVLoLyfC/S/BmHLE10MxPXt/t88+7R4GWLHosHelVtYpKBRykjptdkqfQXNRXoQzDeKm6MA=="
},
"@types/webpack-sources": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.5.tgz",
......@@ -5238,6 +5243,11 @@
"resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.0.tgz",
"integrity": "sha1-LkYovhncSyFLXAJjDFlx6BFhgGI="
},
"custom-event-polyfill": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz",
"integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w=="
},
"cwise": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/cwise/-/cwise-1.0.10.tgz",
......@@ -7718,14 +7728,14 @@
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"fsevents": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz",
"integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
"version": "1.2.9",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
"integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",
"dev": true,
"optional": true,
"requires": {
"nan": "^2.9.2",
"node-pre-gyp": "^0.10.0"
"nan": "^2.12.1",
"node-pre-gyp": "^0.12.0"
},
"dependencies": {
"abbrev": {
......@@ -7750,9 +7760,9 @@
"optional": true
},
"are-we-there-yet": {
"version": "1.1.4",
"version": "1.1.5",
"resolved": false,
"integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"dev": true,
"optional": true,
"requires": {
......@@ -7779,9 +7789,9 @@
}
},
"chownr": {
"version": "1.0.1",
"version": "1.1.1",
"resolved": false,
"integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=",
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
"dev": true,
"optional": true
},
......@@ -7814,19 +7824,19 @@
"optional": true
},
"debug": {
"version": "2.6.9",
"version": "4.1.1",
"resolved": false,
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"dev": true,
"optional": true,
"requires": {
"ms": "2.0.0"
"ms": "^2.1.1"
}
},
"deep-extend": {
"version": "0.5.1",
"version": "0.6.0",
"resolved": false,
"integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"dev": true,
"optional": true
},
......@@ -7879,9 +7889,9 @@
}
},
"glob": {
"version": "7.1.2",
"version": "7.1.3",
"resolved": false,
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"dev": true,
"optional": true,
"requires": {
......@@ -7901,13 +7911,13 @@
"optional": true
},
"iconv-lite": {
"version": "0.4.21",
"version": "0.4.24",
"resolved": false,
"integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"dev": true,
"optional": true,
"requires": {
"safer-buffer": "^2.1.0"
"safer-buffer": ">= 2.1.2 < 3"
}
},
"ignore-walk": {
......@@ -7980,20 +7990,20 @@
"optional": true
},
"minipass": {
"version": "2.2.4",
"version": "2.3.5",
"resolved": false,
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
}
},
"minizlib": {
"version": "1.1.0",
"version": "1.2.1",
"resolved": false,
"integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==",
"integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
"dev": true,
"optional": true,
"requires": {
......@@ -8011,38 +8021,38 @@
}
},
"ms": {
"version": "2.0.0",
"version": "2.1.1",
"resolved": false,
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"dev": true,
"optional": true
},
"needle": {
"version": "2.2.0",
"version": "2.3.0",
"resolved": false,
"integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==",
"integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==",
"dev": true,
"optional": true,
"requires": {
"debug": "^2.1.2",
"debug": "^4.1.0",
"iconv-lite": "^0.4.4",
"sax": "^1.2.4"
}
},
"node-pre-gyp": {
"version": "0.10.0",
"version": "0.12.0",
"resolved": false,
"integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==",
"integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==",
"dev": true,
"optional": true,
"requires": {
"detect-libc": "^1.0.2",
"mkdirp": "^0.5.1",
"needle": "^2.2.0",
"needle": "^2.2.1",
"nopt": "^4.0.1",
"npm-packlist": "^1.1.6",
"npmlog": "^4.0.2",
"rc": "^1.1.7",
"rc": "^1.2.7",
"rimraf": "^2.6.1",
"semver": "^5.3.0",
"tar": "^4"
......@@ -8060,16 +8070,16 @@
}
},
"npm-bundled": {
"version": "1.0.3",
"version": "1.0.6",
"resolved": false,
"integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==",
"integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==",
"dev": true,
"optional": true
},
"npm-packlist": {
"version": "1.1.10",
"version": "1.4.1",
"resolved": false,
"integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==",
"integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
"dev": true,
"optional": true,
"requires": {
......@@ -8154,13 +8164,13 @@
"optional": true
},
"rc": {
"version": "1.2.7",
"version": "1.2.8",
"resolved": false,
"integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==",
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"dev": true,
"optional": true,
"requires": {
"deep-extend": "^0.5.1",
"deep-extend": "^0.6.0",
"ini": "~1.3.0",
"minimist": "^1.2.0",
"strip-json-comments": "~2.0.1"
......@@ -8192,19 +8202,19 @@
}
},
"rimraf": {
"version": "2.6.2",
"version": "2.6.3",
"resolved": false,
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
"dev": true,
"optional": true,
"requires": {
"glob": "^7.0.5"
"glob": "^7.1.3"
}
},
"safe-buffer": {
"version": "5.1.1",
"version": "5.1.2",
"resolved": false,
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true,
"optional": true
},
......@@ -8223,9 +8233,9 @@
"optional": true
},
"semver": {
"version": "5.5.0",
"version": "5.7.0",
"resolved": false,
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
"dev": true,
"optional": true
},
......@@ -8283,18 +8293,18 @@
"optional": true
},
"tar": {
"version": "4.4.1",
"version": "4.4.8",
"resolved": false,
"integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==",
"integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
"dev": true,
"optional": true,
"requires": {
"chownr": "^1.0.1",
"chownr": "^1.1.1",
"fs-minipass": "^1.2.5",
"minipass": "^2.2.4",
"minizlib": "^1.1.0",
"minipass": "^2.3.4",
"minizlib": "^1.1.1",
"mkdirp": "^0.5.0",
"safe-buffer": "^5.1.1",
"safe-buffer": "^5.1.2",
"yallist": "^3.0.2"
}
},
......@@ -8306,13 +8316,13 @@
"optional": true
},
"wide-align": {
"version": "1.1.2",
"version": "1.1.3",
"resolved": false,
"integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==",
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"dev": true,
"optional": true,
"requires": {
"string-width": "^1.0.2"
"string-width": "^1.0.2 || 2"
}
},
"wrappy": {
......@@ -8323,9 +8333,9 @@
"optional": true
},
"yallist": {
"version": "3.0.2",
"version": "3.0.3",
"resolved": false,
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
"dev": true,
"optional": true
}
......@@ -12026,6 +12036,11 @@
"json5": "^1.0.1"
}
},
"loadjs": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/loadjs/-/loadjs-3.6.1.tgz",
"integrity": "sha512-AZEBw2GWdJk2IzBgQ+Wohoao5j+t0rajqK8dJu8jQqgYxDTxhmCt0ayMo/vCa0ZAMvZxnJcam6uLICfnVd8KAw=="
},
"locate-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
......@@ -12096,12 +12111,6 @@
"integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=",
"dev": true
},
"lodash.assign": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=",
"dev": true
},
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
......@@ -12146,12 +12155,6 @@
"lodash.isarray": "^3.0.0"
}
},
"lodash.mergewith": {
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz",
"integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==",
"dev": true
},
"lodash.once": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
......@@ -13184,7 +13187,8 @@
"version": "2.12.1",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==",
"dev": true
"dev": true,
"optional": true
},
"nanomatch": {
"version": "1.2.13",
......@@ -13375,6 +13379,14 @@
"tslib": "^1.9.0"
}
},
"ngx-plyr": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/ngx-plyr/-/ngx-plyr-3.0.1.tgz",
"integrity": "sha512-cxRlKLFMUb4jJUZS8F7GO+uHTAaVT0vgb9aiKpYXTQcxKw8dAyQie2jB+snqIUevK9nb7G9SaSCjoJ61c0rlwg==",
"requires": {
"tslib": "^1.9.0"
}
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
......@@ -13514,9 +13526,9 @@
}
},
"node-sass": {
"version": "4.10.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.10.0.tgz",
"integrity": "sha512-fDQJfXszw6vek63Fe/ldkYXmRYK/QS6NbvM3i5oEo9ntPDy4XX7BcKZyTKv+/kSSxRtXXc7l+MSwEmYc0CSy6Q==",
"version": "4.13.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz",
"integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==",
"dev": true,
"requires": {
"async-foreach": "^0.1.3",
......@@ -13526,12 +13538,10 @@
"get-stdin": "^4.0.1",
"glob": "^7.0.3",
"in-publish": "^2.0.0",
"lodash.assign": "^4.2.0",
"lodash.clonedeep": "^4.3.2",
"lodash.mergewith": "^4.6.0",
"lodash": "^4.17.15",
"meow": "^3.7.0",
"mkdirp": "^0.5.1",
"nan": "^2.10.0",
"nan": "^2.13.2",
"node-gyp": "^3.8.0",
"npmlog": "^4.0.0",
"request": "^2.88.0",
......@@ -13565,6 +13575,18 @@
"integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
"dev": true
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
},
"nan": {
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
"dev": true
},
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
......@@ -14772,6 +14794,25 @@
}
}
},
"plyr": {
"version": "3.5.6",
"resolved": "https://registry.npmjs.org/plyr/-/plyr-3.5.6.tgz",
"integrity": "sha512-buudbt2qwZYjEdBXW9DvQ7t/LqaSbv9tSjCrqg7nTXVM5BXNdhuiJCyvko+5+DFMdp30mliyKGoOHGXz43OwrA==",
"requires": {
"core-js": "^3.1.4",
"custom-event-polyfill": "^1.0.7",
"loadjs": "^3.6.1",
"rangetouch": "^2.0.0",
"url-polyfill": "^1.1.5"
},
"dependencies": {
"core-js": {
"version": "3.4.8",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.8.tgz",
"integrity": "sha512-b+BBmCZmVgho8KnBUOXpvlqEMguko+0P+kXCwD4vIprsXC6ht1qgPxtb1OK6XgSlrySF71wkwBQ0Hv695bk9gQ=="
}
}
},
"point-cluster": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/point-cluster/-/point-cluster-3.1.5.tgz",
......@@ -15462,6 +15503,11 @@
"readable-stream": "^3.0.2"
}
},
"rangetouch": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/rangetouch/-/rangetouch-2.0.0.tgz",
"integrity": "sha512-y66wTFbwh7KafYligRsmIYYR1kZY8U9tGHH9PgbVhBUFmGzPMsOSjslXPedgR5D3M9W1QKVbAf1AtaVAt7JJTw=="
},
"rat-vec": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/rat-vec/-/rat-vec-1.1.1.tgz",
......@@ -19183,6 +19229,11 @@
"requires-port": "^1.0.0"
}
},
"url-polyfill": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.7.tgz",
"integrity": "sha512-ZrAxYWCREjmMtL8gSbSiKKLZZticgihCvVBtrFbUVpyoETt8GQJeG2okMWA8XryDAaHMjJfhnc+rnhXRbI4DXA=="
},
"use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
......
......@@ -32,25 +32,31 @@
{{ hoverInfo.date | utcDate | date: datePipe }}
</div>
<div
[ngSwitch]="rawData?.unit"
*ngFor="let value of hoverInfo.values"
class="m-chartV2__hoverInfo__row--primary"
>
<ng-template ngSwitchCase="number">
{{ hoverInfo.value | number: '1.0-0' | abbr }}
{{ rawData.label | lowercase }}
</ng-template>
<ng-template ngSwitchCase="usd">
{{ hoverInfo.value | currency }} USD
</ng-template>
<ng-template ngSwitchCase="eth">
{{ hoverInfo.value | number: '1.3-3' }} ETH
</ng-template>
<ng-template ngSwitchCase="tokens">
{{ hoverInfo.value | number: '1.1-3' }} Tokens
</ng-template>
<ng-template ngSwitchDefault>
{{ hoverInfo.value | number: '1.0-3' }} {{ rawData?.unit }}
</ng-template>
<span
class="m-chartV2__hoverInfoRow__hex"
[style.background-color]="value.color"
></span>
<ng-container [ngSwitch]="rawData?.unit">
<ng-template ngSwitchCase="number">
{{ value.value | number: '1.0-0' | abbr }}
{{ value.label | lowercase }}
</ng-template>
<ng-template ngSwitchCase="usd">
{{ value.value | currency }} USD
</ng-template>
<ng-template ngSwitchCase="eth">
{{ value.value | number: '1.3-3' }} ETH
</ng-template>
<ng-template ngSwitchCase="tokens">
{{ value.value | number: '1.1-3' }} Tokens
</ng-template>
<ng-template ngSwitchDefault>
{{ value.value | number: '1.0-3' }} {{ rawData?.unit }}
</ng-template>
</ng-container>
</div>
<div class="m-chartV2__hoverInfo__row" *ngIf="isComparison">
vs
......
......@@ -58,6 +58,14 @@ m-chartV2 {
}
}
.m-chartV2__hoverInfoRow__hex {
width: 6px;
height: 6px;
display: inline-block;
margin-right: 2px;
border-radius: 50%;
}
.m-chartV2__hoverInfo__closeBtn {
display: none;
font-size: 15px;
......
......@@ -76,11 +76,12 @@ export class ChartV2Component implements OnInit, OnDestroy {
? this.rawData.visualisation.segments.slice(0, 1)
: this.rawData.visualisation.segments;
if (this.segments.length === 2) {
this.isComparison = true;
// this.isComparison = true;
// Reverse the segments so comparison line is layered behind current line
this.segments.reverse();
// this.segments.reverse();
// Current line should be blue, not grey
this.swapSegmentColors();
// this.swapSegmentColors();
this.detectChanges();
}
this.themeSubscription = this.themeService.isDark$.subscribe(isDark => {
this.isDark = isDark;
......@@ -131,7 +132,9 @@ export class ChartV2Component implements OnInit, OnDestroy {
this.segments.forEach((segment, index) => {
const segmentMarkerFills = [];
for (let i = 0; i < this.pointsPerSegment; i++) {
segmentMarkerFills[i] = this.getColor('m-white');
segmentMarkerFills[i] = this.getColor(
chartPalette.segmentColorIds[index]
);
}
this.markerFills.push(segmentMarkerFills);
});
......@@ -169,12 +172,12 @@ export class ChartV2Component implements OnInit, OnDestroy {
y: this.unpack(this.segments[i].buckets, 'value'),
};
if (this.segments[i].comparison) {
segment.line.dash = 'dot';
}
this.data[i] = segment;
});
if (this.isComparison) {
this.data[0].line.dash = 'dot';
}
}
setLayout() {
......@@ -252,7 +255,7 @@ export class ChartV2Component implements OnInit, OnDestroy {
onHover($event) {
this.hoverPoint = $event.points[0].pointIndex;
this.addMarkerFill();
this.emptyMarkerFill();
if (!this.isMini) {
this.showShape($event);
}
......@@ -265,7 +268,7 @@ export class ChartV2Component implements OnInit, OnDestroy {
}
onUnhover($event) {
this.emptyMarkerFill();
this.addMarkerFill();
this.hideShape();
this.hoverInfoDiv.style.opacity = 0;
this.detectChanges();
......@@ -306,24 +309,37 @@ export class ChartV2Component implements OnInit, OnDestroy {
}
populateHoverInfo() {
const pt = this.isComparison ? 1 : 0;
// TODO: format value strings here and remove ngSwitch from template?
this.hoverInfo['date'] = this.segments[pt].buckets[this.hoverPoint].date;
this.hoverInfo['date'] = this.segments[0].buckets[this.hoverPoint].date;
this.hoverInfo['value'] =
this.rawData.unit !== 'usd'
? this.segments[pt].buckets[this.hoverPoint].value
: this.segments[pt].buckets[this.hoverPoint].value / 100;
if (this.isComparison && this.segments[1]) {
this.hoverInfo['comparisonValue'] =
this.rawData.unit !== 'usd'
? this.segments[0].buckets[this.hoverPoint].value
: this.segments[0].buckets[this.hoverPoint].value / 100;
this.hoverInfo['comparisonDate'] = this.segments[0].buckets[
this.hoverPoint
].date;
? this.segments[0].buckets[this.hoverPoint].value
: this.segments[0].buckets[this.hoverPoint].value / 100;
this.hoverInfo['values'] = [];
for (const pt in this.segments) {
const segment = this.segments[pt];
this.hoverInfo['values'][pt] = {
value:
this.rawData.unit !== 'usd'
? segment.buckets[this.hoverPoint].value
: segment.buckets[this.hoverPoint].value / 100,
label: segment.label || this.rawData.label,
color: this.getColor(chartPalette.segmentColorIds[pt]),
};
}
// if (this.isComparison && this.segments[1]) {
// this.hoverInfo['comparisonValue'] =
// this.rawData.unit !== 'usd'
// ? this.segments[0].buckets[this.hoverPoint].value
// : this.segments[0].buckets[this.hoverPoint].value / 100;
//
// this.hoverInfo['comparisonDate'] = this.segments[0].buckets[
// this.hoverPoint
// ].date;
// }
}
positionHoverInfo($event) {
......
<m-dropdown class="m-nsfwSelector__dropdown" [expanded]="expanded" #dropdown>
<m-dropdown
class="m-nsfwSelector__dropdown"
[expanded]="expanded"
#dropdown
data-cy="data-minds-nsfw-selector"
>
<label
class="m-nsfwSelector__label m-posterActionBar__IconAndLabel"
[class.selected]="hasSelections()"
......
......@@ -44,6 +44,10 @@ export class NSFWSelectorCreatorService extends NSFWSelectorService {
export class NSFWSelectorConsumerService extends NSFWSelectorService {
cacheKey: string = 'consumer';
}
/**
* Editing service, overrides build to allow pre-setting of values.
*/
export class NSFWSelectorEditingService extends NSFWSelectorService {
cacheKey: string = 'editing';
......
......@@ -14,7 +14,7 @@ m-shadowboxHeader.isScrollable {
position: relative;
transition: all 0.3s ease;
@include m-theme() {
border-top: 1px solid rgba(themed($m-grey-50), 0.5);
border-top: 1px solid rgba(themed($m-grey-200), 0.4);
background-color: themed($m-white);
}
}
......
......@@ -37,7 +37,11 @@
<h3>{{ menu.header.label }}</h3>
</div>
<nav class="m-sidebarMenu__linksContainer" *ngIf="menu.links">
<nav
class="m-sidebarMenu__linksContainer"
*ngIf="menu.links"
data-minds="sidebarMenuLinks"
>
<div class="m-sidebarMenu__link" *ngFor="let link of menu.links">
<ng-container *ngIf="link.permissionGranted">
<ng-container *ngIf="!link.newWindow">
......
......@@ -56,10 +56,10 @@ export class SortSelectorComponent implements OnInit, OnDestroy, AfterViewInit {
id: '30d',
label: '30d',
},
/*{
{
id: '1y',
label: '1y'
},*/
label: '1y',
},
];
customTypes: Array<{ id; label; icon? }> = [
......
......@@ -43,7 +43,6 @@
<li
class="m-dropdownList__item m-user-menuDropdown__Item"
(click)="closeMenu()"
*ngIf="getCurrentUser()?.pro"
>
<a routerLink="/analytics/dashboard/traffic">
<i class="material-icons">timeline</i>
......
......@@ -5,6 +5,7 @@
routerLinkActive="m-v2-topbarNav__Item--active"
title="Newsfeed"
i18n-title
data-cy="data-minds-nav-newsfeed-button"
>
<i class="material-icons">home</i>
<span class="m-v2-topbarNavItem__Text" i18n>Newsfeed</span>
......@@ -16,6 +17,7 @@
routerLinkActive="m-v2-topbarNav__Item--active"
title="Discovery"
i18n-title
data-cy="data-minds-nav-discovery-button"
>
<i class="material-icons">search</i>
<span class="m-v2-topbarNavItem__Text" i18n>Discovery</span>
......@@ -27,6 +29,7 @@
routerLinkActive="m-v2-topbarNav__Item--active"
title="Wallet"
i18n-title
data-cy="data-minds-nav-wallet-button"
>
<i class="material-icons">account_balance</i>
<span class="m-v2-topbarNavItem__Text" i18n>Wallet</span>
......
......@@ -16,6 +16,8 @@ import { switchMap, map, tap, first } from 'rxjs/operators';
export class FeedsService {
limit: BehaviorSubject<number> = new BehaviorSubject(12);
offset: BehaviorSubject<number> = new BehaviorSubject(0);
fallbackAt: number | null = null;
fallbackAtIndex: BehaviorSubject<number | null> = new BehaviorSubject(null);
pageSize: Observable<number>;
pagingToken: string = '';
canFetchMore: boolean = true;
......@@ -50,6 +52,22 @@ export class FeedsService {
.setCastToActivities(this.castToActivities)
.getFromFeed(feed)
),
tap(feed => {
if (feed.length && this.fallbackAt) {
for (let i = 0; i < feed.length; i++) {
const entity: any = feed[i].getValue();
if (
entity &&
entity.time_created &&
entity.time_created < this.fallbackAt
) {
this.fallbackAtIndex.next(i);
break;
}
}
}
}),
tap(feed => {
if (feed.length)
// We should have skipped but..
......@@ -143,6 +161,8 @@ export class FeedsService {
response.entities = response.activity;
}
if (response.entities.length) {
this.fallbackAt = response['fallback_at'];
this.fallbackAtIndex.next(null);
this.rawFeed.next(this.rawFeed.getValue().concat(response.entities));
this.pagingToken = response['load-next'];
} else {
......@@ -168,6 +188,8 @@ export class FeedsService {
* To clear data.
*/
clear(): FeedsService {
this.fallbackAt = null;
this.fallbackAtIndex.next(null);
this.offset.next(0);
this.pagingToken = '';
this.rawFeed.next([]);
......
<div class="m-embed-video" *ngIf="object.subtype == 'video'">
<m-video
[autoplay]="false"
[muted]="false"
[src]="[{ 'uri': object.src['720.mp4'] }]"
<m-videoPlayer
[guid]="object.guid"
[playCount]="object['play:count']"
[poster]="object['thumbnail_src']"
></m-video>
[autoplay]="false"
[shouldPlayInModal]="false"
>
</m-videoPlayer>
</div>