Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Obvious channels #5139

Merged
merged 6 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/integration/composer/localstorage_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('composer content persistence', () => {
.select('Spectrum');
cy.get('[data-cy="composer-channel-selector"]')
.should('be.visible')
.select('General');
.select('# General');

// Type title and body
cy.get('[data-cy="composer-title-input"]').type(title);
Expand All @@ -72,7 +72,7 @@ describe('composer content persistence', () => {
.select('Spectrum');
cy.get('[data-cy="composer-channel-selector"]')
.should('be.visible')
.select('General');
.select('# General');

// Type title and body
cy.get('[data-cy="composer-title-input"]').type(title);
Expand Down
7 changes: 4 additions & 3 deletions cypress/integration/composer/mini_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe('mini composer functionality', () => {
.type(body);
miniComposerPost().should('be.disabled');
channelDropdown().contains('Choose a channel');
channelDropdown().select('General');
channelDropdown().select('# General');
miniComposerPost().should('not.be.disabled');
});

Expand All @@ -189,7 +189,8 @@ describe('mini composer functionality', () => {
miniComposerPost().should('be.disabled');
miniComposerTitle().type(title);
miniComposerPost().should('not.be.disabled');
channelDropdown().should('not.be.visible');
channelDropdown().should('be.visible');
channelDropdown().should('be.disabled');
miniComposerTitle().clear();
miniComposerBody().type(body);
miniComposerPost().should('be.disabled');
Expand All @@ -209,7 +210,7 @@ describe('mini composer functionality', () => {
.type(body);
miniComposerPost().should('be.disabled');
channelDropdown().contains('Choose a channel');
channelDropdown().select('General');
channelDropdown().select('# General');
miniComposerPost().should('not.be.disabled');
miniComposerPost().click();
cy.get('[data-cy="thread-is-modal"]').should('be.visible');
Expand Down
20 changes: 10 additions & 10 deletions cypress/integration/composer/selection_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('/new/thread community and channel selection', () => {
cy.visit('/new/thread?composerCommunityId=5');
communityIsLocked();
channelDropdownIsEnabled();
channelDropdown().contains('General');
channelDropdown().contains('# General');
});

it('selects an a single community and single channel by default if no query params are passed', () => {
Expand All @@ -76,7 +76,7 @@ describe('/new/thread community and channel selection', () => {
communityDropdownIsEnabled();
communityDropdown().contains('Single channel community');
channelDropdownIsEnabled();
channelDropdown().contains('General');
channelDropdown().contains('# General');
});

it('does not select a community or channel if no query params are passed', () => {
Expand All @@ -93,13 +93,13 @@ describe('/new/thread community and channel selection', () => {

communityDropdown().select('Spectrum');
channelDropdownIsEnabled();
channelDropdown().contains('General');
channelDropdown().contains('Private');
channelDropdown().contains('# General');
channelDropdown().contains('# Private');

communityDropdown().select('Payments');
channelDropdown().contains('General');
channelDropdown().contains('Private');
channelDropdown().contains('Payments Features');
channelDropdown().contains('# General');
channelDropdown().contains('# Private');
channelDropdown().contains('# Payments Features');
});

it('keeps the publish button disabled if either community or channel selector is blank', () => {
Expand All @@ -112,7 +112,7 @@ describe('/new/thread community and channel selection', () => {
publishButtonIsDisabled();

channelDropdownIsEnabled();
channelDropdown().select('General');
channelDropdown().select('# General');
publishButtonIsEnabled();

communityDropdown().select('');
Expand All @@ -127,7 +127,7 @@ describe('/new/thread community and channel selection', () => {
cy.wait(50);
publishButtonIsDisabled();

channelDropdown().select('General');
channelDropdown().select('# General');
publishButtonIsEnabled();
});

Expand All @@ -153,7 +153,7 @@ describe('/new/thread community and channel selection', () => {
channelDropdownIsHidden();
});

it('selects a community and channel if both params are passed and the user is a member of both', () => {
it.only('selects a community and channel if both params are passed and the user is a member of both', () => {
cy.visit('/new/thread?composerCommunityId=1&composerChannelId=1');
communityIsLocked();
communitySelected().contains('Spectrum');
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/thread_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ describe('/new/thread', () => {
.select('Spectrum');
cy.get('[data-cy="composer-channel-selector"]')
.should('be.visible')
.select('General');
.select('# General');

// Type title and body
cy.get('[data-cy="composer-title-input"]').type(title);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"cors": "^2.8.3",
"cryptr": "^3.0.0",
"css.escape": "^1.5.1",
"cypress": "^3.2.0",
"cypress": "^3.3.1",
"datadog-metrics": "^0.8.1",
"dataloader": "^1.4.0",
"debounce": "^1.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const ChannelSelector = (props: Props) => {
if (!channel) return null;
return (
<option key={channel.id} value={channel.id}>
{channel.name}
# {channel.name}
</option>
);
})}
Expand Down
10 changes: 10 additions & 0 deletions src/components/composerMini/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,16 @@ const MiniComposer = ({
tabIndex={3}
/>
)}
{fixedChannelId && (
<ChannelSelector
id={community.id}
selectedCommunityId={community.id}
selectedChannelId={fixedChannelId}
disabled
css={{ marginLeft: 0 }}
tabIndex={3}
/>
)}
<Tooltip content="Open in fullscreen">
<span style={{ marginLeft: '8px' }}>
<Link
Expand Down
19 changes: 8 additions & 11 deletions src/components/inboxThread/header/threadHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,14 @@ class Header extends React.Component<HeaderProps> {
</CommunityHoverProfile>
)}

{viewContext !== 'channelProfile' &&
viewContext !== 'channelInbox' && (
<ChannelHoverProfile id={channel.id}>
<MetaSubtitle
active={active ? 'true' : undefined}
to={`/${community.slug}/${channel.slug}`}
>
# {channel.name}
</MetaSubtitle>
</ChannelHoverProfile>
)}
<ChannelHoverProfile id={channel.id}>
<MetaSubtitle
active={active ? 'true' : undefined}
to={`/${community.slug}/${channel.slug}`}
>
# {channel.name}
</MetaSubtitle>
</ChannelHoverProfile>
</TextRow>
</MetaContainer>
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Header extends React.Component<HeaderProps> {
active={active}
to={`/${community.slug}/${channel.slug}`}
>
{channel.name}
# {channel.name}
</MetaSubtitle>
</ChannelHoverProfile>

Expand Down
67 changes: 40 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,11 @@ aproba@^1.0.3:
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==

arch@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e"
integrity sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==

are-we-there-yet@~1.1.2:
version "1.1.5"
resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
Expand Down Expand Up @@ -1943,12 +1948,12 @@ async@0.2.x, async@~0.2.9:
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
integrity sha1-trvgsGdLnXGXCMo43owjfLUmw9E=

async@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611"
integrity sha1-SZAgDxjqW4N8LMT4wDGmmFw4VhE=
async@2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610"
integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==
dependencies:
lodash "^4.14.0"
lodash "^4.17.10"

async@^1.5.2:
version "1.5.2"
Expand Down Expand Up @@ -4765,25 +4770,26 @@ cypress-plugin-retries@^1.2.0:
resolved "https://registry.yarnpkg.com/cypress-plugin-retries/-/cypress-plugin-retries-1.2.0.tgz#a4e120c1bc417d1be525632e7d38e52a87bc0578"
integrity sha512-seQFI/0j5WCqX7IVN2k0tbd3FLdhbPuSCWdDtdzDmU9oJfUkRUlluV47TYD+qQ/l+fJYkQkpw8csLg8/LohfRg==

cypress@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.2.0.tgz#c2d5befd5077dab6fb52ad70721e0868ac057001"
integrity sha512-PN0wz6x634QyNL56/voTzJoeScDfwtecvSfFTHfv5MkHuECVSR4VQcEZTvYtKWln3CMBMUkWbBKPIwwu2+a/kw==
cypress@^3.3.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.3.1.tgz#8a127b1d9fa74bff21f111705abfef58d595fdef"
integrity sha512-JIo47ZD9P3jAw7oaK7YKUoODzszJbNw41JmBrlMMiupHOlhmXvZz75htuo7mfRFPC9/1MDQktO4lX/V2+a6lGQ==
dependencies:
"@cypress/listr-verbose-renderer" "0.4.1"
"@cypress/xvfb" "1.2.4"
arch "2.1.1"
bluebird "3.5.0"
cachedir "1.3.0"
chalk "2.4.2"
check-more-types "2.24.0"
commander "2.15.1"
common-tags "1.8.0"
debug "3.1.0"
debug "3.2.6"
execa "0.10.0"
executable "4.1.1"
extract-zip "1.6.7"
fs-extra "4.0.1"
getos "3.1.0"
getos "3.1.1"
glob "7.1.3"
is-ci "1.2.1"
is-installed-globally "0.1.0"
Expand All @@ -4797,7 +4803,7 @@ cypress@^3.2.0:
request "2.88.0"
request-progress "0.4.0"
supports-color "5.5.0"
tmp "0.0.33"
tmp "0.1.0"
url "0.11.0"
yauzl "2.10.0"

Expand Down Expand Up @@ -4881,20 +4887,20 @@ debug@3.1.0:
dependencies:
ms "2.0.0"

debug@3.2.6, debug@^3.0.1, debug@^3.1.0, debug@^3.2.6:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
dependencies:
ms "^2.1.1"

debug@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.0.1.tgz#f9bb36d439b8d1f0dd52d8fb6b46e4ebb8c1cd5b"
integrity sha512-K23FHJ/Mt404FSlp6gSZCevIbTMLX0j3fmHhUEhQ3Wq0FMODW3+cUSoLdy1Gx4polAf4t/lphhmHH35BB8cLYw==
dependencies:
ms "^2.1.1"

debug@^3.0.1, debug@^3.1.0, debug@^3.2.6:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
dependencies:
ms "^2.1.1"

debug@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
Expand Down Expand Up @@ -6978,12 +6984,12 @@ get-window@^1.1.1:
dependencies:
get-document "1"

getos@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/getos/-/getos-3.1.0.tgz#db3aa4df15a3295557ce5e81aa9e3e5cdfaa6567"
integrity sha512-i9vrxtDu5DlLVFcrbqUqGWYlZN/zZ4pGMICCAcZoYsX3JA54nYp8r5EThw5K+m2q3wszkx4Th746JstspB0H4Q==
getos@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/getos/-/getos-3.1.1.tgz#967a813cceafee0156b0483f7cffa5b3eff029c5"
integrity sha512-oUP1rnEhAr97rkitiszGP9EgDVYnmchgFzfqRzSkgtfv7ai6tEi7Ko8GgjNXts7VLWEqrTWyhsOKLe5C5b/Zkg==
dependencies:
async "2.4.0"
async "2.6.1"

getpass@^0.1.1:
version "0.1.7"
Expand Down Expand Up @@ -9570,7 +9576,7 @@ lodash.values@^4.3.0:
resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-4.3.0.tgz#a3a6c2b0ebecc5c2cba1c17e6e620fe81b53d347"
integrity sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=

lodash@4.17.11, "lodash@>=3.5 <5", lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1, lodash@^4.7.0:
lodash@4.17.11, "lodash@>=3.5 <5", lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1, lodash@^4.7.0:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
Expand Down Expand Up @@ -12863,7 +12869,7 @@ right-align@^0.1.1:
dependencies:
align-text "^0.1.1"

rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2.6.2:
rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
Expand Down Expand Up @@ -14064,7 +14070,14 @@ tlds@^1.189.0:
resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.203.1.tgz#4dc9b02f53de3315bc98b80665e13de3edfc1dfc"
integrity sha512-7MUlYyGJ6rSitEZ3r1Q1QNV8uSIzapS8SmmhSusBuIc7uIxPPwsKllEP0GRp1NS6Ik6F+fRZvnjDWm3ecv2hDw==

tmp@0.0.33, tmp@^0.0.33:
tmp@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877"
integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==
dependencies:
rimraf "^2.6.3"

tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
Expand Down