-
Notifications
You must be signed in to change notification settings - Fork 59
[ENG-467] Upgrade dependencies #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e31861c
eb0cfa5
53a88fd
5800b2a
4b478bd
5a807d8
5afc529
0ceff0c
b9341ae
e329e83
bf373e4
ebbdf23
2c43581
d3337e6
2470e58
224d82c
f5098c9
d1d3724
83f2e76
3704879
26e101d
2c97bb1
4525ef4
42d98d4
f172619
70c6e6d
8a21c17
815ae15
916c49b
fb4d82a
08f0776
c7bd9b0
ca12cca
973f7f4
80960f0
d21538f
cfadec4
5369ffd
349d89a
a8232c9
928f121
af06f54
c3e2cd6
055bc8d
b8fade5
8ae6d9c
7043990
76605b5
e7f903c
25f1735
aa8ffbe
1580171
e489f7e
3559ee0
bc5be2f
b070c86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,7 +156,7 @@ | |
background: url('/assets/images/home/Ana_transparent_gradient.png') no-repeat center bottom; | ||
background-size: contain; | ||
position: relative; | ||
margin: -80px 0 -65px 0; | ||
margin: -80px 0 -65px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
.quote { | ||
position: absolute; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,7 +227,7 @@ export default class NodeModel extends BaseFileItem.extend(Validations, Collecta | |
|
||
@computed('root') | ||
get isRoot() { | ||
const rootId = this.belongsTo('root').id(); | ||
const rootId = (this as NodeModel).belongsTo('root').id(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not 100% sure why this is necessary, but it definitely breaks without it! 😆 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also confused why this breaks... but in looking into it I found you can also fix it with: get isRoot(this: NodeModel) { Unsure which is better/cleaner. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably relevant: microsoft/TypeScript#29413 |
||
return !rootId || rootId === this.id; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -94,7 +94,7 @@ export default class OsfModel extends Model { | |||
|
||||
// HACK: ember-data discards/ignores the link if an object on the belongsTo side | ||||
// came first. In that case, grab the link where we expect it from OSF's API | ||||
const url = reference.link() || getRelatedHref(this.relationshipLinks[relationshipName]); | ||||
const url = reference.link() || getRelatedHref(this.relationshipLinks[relationshipName as string]); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is due to the types changes to
but this now breaks this.hasMany() above due to stricter typing in ember-data.
|
||||
if (!url) { | ||||
throw new Error(`Could not find a link for '${relationshipName}' relationship`); | ||||
} | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,9 @@ module.exports = function(environment) { | |
mirageScenarios: MIRAGE_SCENARIOS, | ||
|
||
defaultProvider: 'osf', | ||
pageTitle: { | ||
prepend: false, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}; | ||
|
||
if (environment === 'development') { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,20 +51,26 @@ export default class SubjectPicker extends Component.extend({ | |
this.get('querySubjects').perform(); | ||
}, | ||
|
||
querySubjects: task(function *(this: SubjectPicker, parents = 'null', tier = 0): IterableIterator<any> { | ||
const column: Column = this.columns.objectAt(tier)!; | ||
|
||
const taxonomies: Taxonomy[] = yield this.provider.queryHasMany('taxonomies', { | ||
filter: { | ||
parents, | ||
}, | ||
page: { | ||
size: 150, // Law category has 117 (Jan 2018) | ||
}, | ||
}); | ||
querySubjects: task( | ||
function *( | ||
this: SubjectPicker, | ||
parents: string = 'null', | ||
tier: number = 0, | ||
): IterableIterator<any> { | ||
const column: Column = this.columns.objectAt(tier)!; | ||
|
||
const taxonomies: Taxonomy[] = yield this.provider.queryHasMany('taxonomies', { | ||
filter: { | ||
parents, | ||
}, | ||
page: { | ||
size: 150, // Law category has 117 (Jan 2018) | ||
}, | ||
}); | ||
|
||
column.set('subjects', taxonomies ? taxonomies.toArray() : []); | ||
}), | ||
column.set('subjects', taxonomies ? taxonomies.toArray() : []); | ||
}, | ||
), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reformatted this, but the only change is adding types for |
||
}) { | ||
@service analytics!: Analytics; | ||
@service store!: DS.Store; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ import template from './template'; | |
@layout(template) | ||
export default class PaginatedList extends Component { | ||
// Required arguments | ||
items?: Array<unknown>; | ||
items?: unknown[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newer |
||
page!: number; | ||
pageSize!: number; | ||
@requiredAction next!: () => void; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import { | |
import { isEmpty } from '@ember/utils'; | ||
import { ChangesetDef } from 'ember-changeset/types'; | ||
import { ResultCollection } from 'ember-cp-validations'; | ||
import DS from 'ember-data'; | ||
import DS, { AttributesFor, RelationshipsFor } from 'ember-data'; | ||
import I18n from 'ember-i18n/services/i18n'; | ||
|
||
import defaultTo from 'ember-osf-web/utils/default-to'; | ||
|
@@ -24,9 +24,9 @@ export enum ValidationStatus { | |
HasWarning, | ||
} | ||
|
||
export default abstract class BaseValidatedInput extends Component { | ||
export default abstract class BaseValidatedInput<M extends DS.Model> extends Component { | ||
// Required arguments | ||
valuePath!: keyof DS.Model; | ||
valuePath!: AttributesFor<M> | RelationshipsFor<M>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some validated-input components will operate on attributes or relationships. I tried to make this abstract, requiring you to choose, but then it can't be used in the constructor in the base class. |
||
|
||
// Optional arguments | ||
changeset?: ChangesetDef & DS.Model; | ||
|
@@ -35,7 +35,7 @@ export default abstract class BaseValidatedInput extends Component { | |
placeholder?: string; | ||
disabled: boolean = defaultTo(this.disabled, false); | ||
shouldShowMessages: boolean = defaultTo(this.shouldShowMessages, true); | ||
model?: DS.Model; | ||
model?: M; | ||
|
||
// Private properties | ||
@service i18n!: I18n; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import DS, { AttributesFor } from 'ember-data'; | ||
|
||
import { layout } from 'ember-osf-web/decorators/component'; | ||
|
||
import BaseValidatedComponent from '../base-component'; | ||
import template from './template'; | ||
|
||
@layout(template) | ||
export default class ValidatedCheckbox extends BaseValidatedComponent { | ||
export default class ValidatedCheckbox<M extends DS.Model> extends BaseValidatedComponent<M> { | ||
valuePath!: AttributesFor<M>; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import DS, { AttributesFor, RelationshipsFor } from 'ember-data'; | ||
|
||
import { layout } from 'ember-osf-web/decorators/component'; | ||
|
||
import BaseValidatedComponent from '../base-component'; | ||
import template from './template'; | ||
|
||
@layout(template) | ||
export default class ValidatedCheckbox extends BaseValidatedComponent { | ||
export default class ValidatedCheckbox<M extends DS.Model> extends BaseValidatedComponent<M> { | ||
valuePath!: AttributesFor<M> | RelationshipsFor<M>; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import DS, { AttributesFor } from 'ember-data'; | ||
|
||
import { layout } from 'ember-osf-web/decorators/component'; | ||
|
||
import BaseValidatedComponent from '../base-component'; | ||
import template from './template'; | ||
|
||
@layout(template) | ||
export default class ValidatedTextArea extends BaseValidatedComponent { | ||
export default class ValidatedTextArea<M extends DS.Model> extends BaseValidatedComponent<M> { | ||
valuePath!: AttributesFor<M>; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@import 'variables'; | ||
@import 'app/styles/variables'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appears to be a change (possibly a regression) in TypeScript 3.4 that prevents it form inferring the type from default arguments in some cases (turn on the
noImplicitAny
option). Here's the same with TypeScript 3.3 (as of this writing typescript-play.js.org was still on 3.3. Note:noImplicitAny
is on by default in this playground).