Skip to content

[REG-13] Registries fixes#415

Merged
chrisseto merged 9 commits intoCenterForOpenScience:developfrom
chrisseto:feature/registries-fixes
Oct 5, 2018
Merged

[REG-13] Registries fixes#415
chrisseto merged 9 commits intoCenterForOpenScience:developfrom
chrisseto:feature/registries-fixes

Conversation

@chrisseto
Copy link
Member

Purpose

Fixes for Registries from QA.

Summary of Changes

See Commits

Side Effects

Feature Flags

QA Notes

Ticket

https://openscience.atlassian.net/browse/REG-13

Reviewer Checklist

  • meets requirements
  • easy to understand
  • DRY
  • testable and includes test(s)
  • changes described in CHANGELOG.md

@chrisseto chrisseto force-pushed the feature/registries-fixes branch 3 times, most recently from b550bca to 3c47e75 Compare October 3, 2018 19:45
Copy link
Contributor

@aaxelb aaxelb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just a few things

@@ -0,0 +1,25 @@
{{! template-lint-disable bare-strings }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any bare strings?

} else if (content[i] === '}') {
contextLevel++;
} else if (content[i] === '{') {
contextLevel--;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the intent, I think you got these flipped. When it finds a {, should be contextLevel++ to prevent matching an end delimiter inside brackets.

just text $$ math! { $$ math } still math $$ okay text again

export const DELIMITERS: Delimiter[] = [
{ start: '$$', end: '$$', inline: false },
{ start: '\\[', end: '\\]', inline: false },
{ start: '$', end: '$', inline: true },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems easy to hit accidentally, like "The GDP of Lemonadia increased from $7 all the way to $12 in one week." Does normal text rendered as math look weird?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will look weird but I don't actually think it will be that common to hit. However using $ expr $ seem to be fairly standard?

Currently MathJax will mess it up as well and we're explicitly opting into that behavior.

screen shot 2018-10-04 at 10 29 29 am

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, would it be reasonable to put spaces in the delimiter? Maybe start: ' $ ', end: ' $ ' or start: '$ ', end: ' $'? I guess it feels like using a dollar symbol twice in one title or description might happen pretty often in some fields.

(expr: string) => `This is TeX: ${expr}`,
(expr: string) => `${expr} is some TeX`,
(expr: string) => `${expr} TeX is leading and ending here ${expr}`,
(expr: string) => `${expr} ${expr} Double Trouble!`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a Some TeX ${expr} surrounded by text?

@@ -0,0 +1,40 @@
import { layout } from '@ember-decorators/component';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like there's already a search-help-modal in app-components, seems like they should be united

@chrisseto chrisseto force-pushed the feature/registries-fixes branch from 3c47e75 to 3efcdcf Compare October 4, 2018 18:32
@coveralls
Copy link

coveralls commented Oct 4, 2018

Pull Request Test Coverage Report for Build 1663

  • 20 of 24 (83.33%) changed or added relevant lines in 8 files are covered.
  • 15 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+0.2%) to 62.631%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/collections/addon/discover/controller.ts 0 1 0.0%
lib/registries/addon/components/registries-search-result/component.ts 5 6 83.33%
lib/registries/addon/services/share-search.ts 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
lib/osf-components/addon/components/osf-navbar/component.ts 1 79.37%
lib/registries/addon/components/registries-search-result/component.ts 1 83.64%
lib/osf-components/addon/components/osf-navbar/auth-dropdown/component.ts 2 86.57%
lib/registries/addon/discover/controller.ts 3 91.28%
lib/registries/addon/services/share-search.ts 4 40.21%
lib/registries/addon/services/search.ts 4 70.0%
Totals Coverage Status
Change from base Build 1661: 0.2%
Covered Lines: 3578
Relevant Lines: 5446

💛 - Coveralls

@chrisseto chrisseto force-pushed the feature/registries-fixes branch 4 times, most recently from e7ef604 to 89813dd Compare October 4, 2018 20:43
Copy link
Member

@jamescdavis jamescdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several questions, couple of nits

refine_your_search: 'Refine your search by',
clear_filters: 'Clear Filters',
active_filters: 'Active Filters',
active_filters: 'Active filters',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were moving to sentence case for most things?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that not sentence case?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, don't mind me...

}

return -1;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these functions useful outside this helper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're exported for testing purposes. I don't really see a need to test KaTeX itself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok, I was just wondering why they were exported (I obviously didn't look close enough at the tests!).

}

this.import(`${katexPath}/katex.css`);
this.import(`${katexPath}/katex.js`, { using: [{ transformation: 'amd', as: 'katex' }] });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we get ember-auto-import working for in-repo addons in TypeScript (which should work when typed-ember/ember-cli-typescript#334), this will be unnecessary, but, alas, it's the best we got atm.


if (this.router.currentRouteName !== 'register') {
params.next = this.signUpNext;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure, just copying the existing behavior.

return this.router.currentRouteName === 'register' ? {} : { next: this.signUpNext };

{{/let}}

{{osf-navbar/auth-dropdown}}
{{osf-navbar/auth-dropdown campaign=this.campaign}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

campaign is a parameter that's just passed through right? Should use campaign=@campaign and remove the property from the component class.

{{#each this.contributors as |contrib|}}
<li>
{{#if contrib.link}}
<a href={{contrib.link}}>{{contrib.name}}</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll eventually want this to be a link-to (or equivalent). I guess we'll parse out the route from the OSF URL in identifiers or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll probably look similar to the title? It'd be nice if we had a link-to that checked feature flags at somepoint


<div class="text-center">
<button data-test-result-toggle-id="{{result.id}}" local-class="RegistriesSearchResult__Toggle" class="btn btn-link" aria-label={{t 'eosf.components.searchResult.showResult'}} {{action 'toggleExpanded'}}>
<button {{action 'toggleExpanded'}} data-test-result-toggle-id={{result.id}} local-class="RegistriesSearchResult__Toggle" class="btn btn-link" aria-label={{t 'eosf.components.searchResult.showResult'}}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a fan of {{action this.toggleExpanded}}

}

module('Unit | Registries | Service | Search', hooks => {
module('Unit | Service | search', hooks => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we should leave Registries in the test name somewhere?
Maybe Registries | Unit | Service | search?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

jamescdavis
jamescdavis previously approved these changes Oct 5, 2018
@@ -955,10 +955,10 @@ export default {
sidebar: {
refine_your_search: 'Refine your search by',
clear_filters: 'Clear Filters',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sentence case this one too?

@chrisseto chrisseto force-pushed the feature/registries-fixes branch from a0ee70e to 71aa756 Compare October 5, 2018 16:05
@chrisseto chrisseto merged commit 7203f22 into CenterForOpenScience:develop Oct 5, 2018
@jamescdavis jamescdavis added this to the 18.0.0 milestone Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants