Skip to content

Commit 05c9df3

Browse files
committed
Merge branch 'release/19.11.0'
2 parents 3b651a1 + 2fd17db commit 05c9df3

File tree

409 files changed

+10472
-2322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

409 files changed

+10472
-2322
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module.exports = {
3434
'ember/new-module-imports': 'error',
3535
'ember/no-attrs-in-components': 'error',
3636
'ember/no-old-shims': 'error',
37+
'ember/routes-segments-snake-case': 'off',
3738
'import/export': 'off',
3839
'import/prefer-default-export': 'off',
3940
'no-restricted-globals': 'off',

CHANGELOG.md

Lines changed: 137 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,131 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [19.11.0] - 2019-12-16
8+
### Added
9+
- Components
10+
- `institutions`
11+
- `dashboard/departments-panel`
12+
- `dashboard/institutional-users-list`
13+
- `dashboard/panel`
14+
- `dashboard/projects-panel`
15+
- `Registries::DraftRegistrationManager`
16+
- `Registries::SchemaBlockRenderer::Editable::Files`
17+
- `Registries::SchemaBlockRenderer::ReadOnly::Files`
18+
- `OsfLayout::RegistriesSideNav`
19+
- `OsfLayout::RegistriesSideNav::Icon`
20+
- `OsfLayout::RegistriesSideNav::Label`
21+
- `OsfLayout::RegistriesSideNav::XLink`
22+
- `PageLink`
23+
- Mirage
24+
- Factories
25+
- `institutional-user`
26+
- Serializers
27+
- `institutional-user`
28+
- Routes
29+
- `institution`
30+
- added `dashboard` nested route
31+
- `guid-node`
32+
- added `drafts` nested route
33+
- Engines
34+
- Components
35+
- `drafts/draft/-components/register`
36+
- Routes
37+
- `registries`
38+
- `drafts.draft`, `draft/<draftId>`
39+
- index route redirects to `draft/<draftId>/1`
40+
- `drafts.draft.page`, `draft/<draftId>/<page>`
41+
- Utils
42+
- `page-param`
43+
- Tests
44+
- Integration
45+
- `draft-registration-manager`
46+
- `page-link`
47+
- `registries-side-nav`
48+
- Unit
49+
- `page-param`
50+
- Acceptance
51+
- `draft form`
52+
- Environment
53+
- Flags
54+
- added `guid-node.drafts` route flag
55+
- Packages
56+
- `ember-element-helper` v0.2.0
57+
58+
### Changed
59+
- Components
60+
- `paginated-list`
61+
- added `isTable` attribute to use a `table` over an `ul`
62+
- `sort-button`
63+
- changed local `selected` classes to nested global classes
64+
- `registries/schema-block-renderer/editable/**`
65+
- `validated-input`
66+
- Modified components to take in `onInput` callback.
67+
- added `withStatSummary` trait
68+
- `registries/partial-registration-modal`
69+
- added `onContinue` hook
70+
- `OsfLayout`
71+
- renamed `left-nav` to `left-nav-old`
72+
- created new `left-nav` that uses `registries-side-nav`
73+
- Mirage
74+
- Factories
75+
- `institution`
76+
- added `withInstitutionalUsers` trait
77+
- Scenarios
78+
- `default`
79+
- added `SchemaBlock` node with files and contributors
80+
- Models
81+
- `base-file-item`
82+
- added `createFolder`
83+
- `draft-registration`
84+
- added `registrationResponses`
85+
- `file`
86+
- added `toFileReference`
87+
- `file-provider`
88+
- use `rootFolder` instead of `files`
89+
- added links
90+
- `institution`
91+
- added `currentUserIsAdmin` boolean
92+
- added `statSummary` object
93+
- `institutional-user`
94+
- added `userGuid` string
95+
- `registration`
96+
- changed `draftRegistration` to be a relationship
97+
- added `registrationResponses`
98+
- added `includedNodeIds`
99+
- added `createDoi`
100+
- added `draftRegistrationId`
101+
- removed `registrationChoice`
102+
- removed `liftEmbargo`
103+
- `registration-schema`
104+
- added `schemaBlocks` inverse
105+
- `schema-blocks`
106+
- added `schema` relationship
107+
- added `elementId` computed
108+
- added `pageRouteParam` computed
109+
- Routes
110+
- `institution`
111+
- moved to `index` folder
112+
- `registries.drafts.draft`
113+
- added navigation
114+
- `registries.overview`
115+
- updated to use `leftNavOld`
116+
- Types
117+
- Renamed `PageResponse` to `RegistrationResponse`
118+
- Tests
119+
- `schema-block-renderer`
120+
- added `files` block test
121+
122+
### Removed
123+
- Tests
124+
- unit, component tests using `FactoryGuy`
125+
- `FactoryGuy` factories
126+
- Packages
127+
- `ember-data-factory-guy`
128+
- `ember-element-helper` (`fix-engines` branch)
129+
- Types
130+
- `FactoryGuy` types
131+
7132
## [19.10.0] - 2019-10-02
8133
### Added
9134
- Models
@@ -37,6 +162,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
37162
- `selected-list`
38163
- `upload-zone`
39164
- `widget`
165+
- `registries/review-form-renderer`
166+
- `schema-block-renderer/`
167+
- `editable`
168+
- `read-only`
40169
- Validators
41170
- `list` - apply a validator to a list
42171
- Tests
@@ -127,6 +256,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
127256
- darken background overlay
128257
- `registries/registries-metadata`
129258
- use `Subjects::Widget` and `Subjects::Display` (and related managers) for subjects editable field
259+
- `schema-block-group-renderer`
260+
- take in renderStrategy as mapper
261+
- take variable for `registrationResponses`
262+
- `schema-block-renderer`
263+
- broke components into `editable` and `read-only` structures
130264
- Tests
131265
- renamed `taxonomy` to `subject` in `preprint-provider` FactoryGuy factory
132266
- Unit
@@ -135,6 +269,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
135269
- `serializers/taxonomy-test` renamed to `serializers/subject-test`
136270
- `models/preprint-test`
137271
- removed test for `subject` attribute
272+
- Integration
273+
- `registries/schema-block-group-renderer` updated to include `renderStrategy`
138274
- Mirage
139275
- Factories
140276
- `node`
@@ -221,7 +357,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
221357
- improved update acceptance tests to perform assertions in addition to taking snapshots
222358
- improved discover acceptance tests to perform assertions in addition to taking snapshots
223359
- Tests
224-
- added `ember-basic-dropdown-wormhole` div to test index.html
360+
- added `ember-basic-dropdown-wormhole` div to test index.html
225361
- Mirage
226362
- `osfNestedResource`
227363
- added `onCreate` hook to perform additional operations after creating a child resource

app/adapters/registration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import OsfAdapter from './osf-adapter';
22

33
export default class RegistrationAdapter extends OsfAdapter {
4+
parentRelationship = 'registeredFrom';
45
}
56

67
declare module 'ember-data/types/registries/adapter' {

app/app.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const App = Application.extend({
3131
'router',
3232
'ready',
3333
'osf-modal-state',
34+
'osf-router',
3435
],
3536
},
3637
},
@@ -47,6 +48,8 @@ const App = Application.extend({
4748
'store',
4849
'toast',
4950
'osf-modal-state',
51+
'osf-router',
52+
'media',
5053
],
5154
},
5255
},
@@ -69,6 +72,7 @@ const App = Application.extend({
6972
'status-messages',
7073
'store',
7174
'osf-modal-state',
75+
'osf-router',
7276
],
7377
externalRoutes: {
7478
'guid-registration': 'guid-registration',
@@ -90,6 +94,7 @@ const App = Application.extend({
9094
'router',
9195
'head-data',
9296
'osf-modal-state',
97+
'osf-router',
9398
],
9499
externalRoutes: {
95100
nodeForks: 'guid-node.forks',

app/authenticators/osf-cookie.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ export default class OsfCookie extends Base {
2828
@service store!: DS.Store;
2929
@service currentUser!: CurrentUser;
3030

31+
lastVerifiedUserId?: string;
32+
3133
/**
3234
* @method authenticate
3335
* @return {Promise}
3436
*/
3537
async authenticate(): Promise<object> {
3638
const url = `${apiUrl}/${apiNamespace}/`;
39+
40+
// The API's root endpoint returns info on the current user, based on the request's auth cookie.
3741
let res: RootDocument = await this.currentUser.authenticatedAJAX(
3842
{ url },
3943
);
@@ -70,16 +74,37 @@ export default class OsfCookie extends Base {
7074
}
7175

7276
if (!userData) {
77+
this.set('lastVerifiedUserId', null);
7378
throw new NotLoggedIn();
7479
}
7580

7681
// Push the user into the store for later use
7782
this.store.pushPayload(userData);
7883

79-
return { id: userData.data.id };
84+
const { id } = userData.data;
85+
this.set('lastVerifiedUserId', id);
86+
return { id };
8087
}
8188

8289
restore() {
90+
const {
91+
lastVerifiedUserId,
92+
session: {
93+
data,
94+
isAuthenticated,
95+
},
96+
} = this;
97+
98+
if (
99+
isAuthenticated &&
100+
lastVerifiedUserId &&
101+
data &&
102+
data.authenticated.id === lastVerifiedUserId
103+
) {
104+
// Everything is in order, no need to re-auth
105+
return undefined;
106+
}
107+
83108
// Check for a valid auth cookie.
84109
// If it fails, the session will be invalidated.
85110
return this.authenticate();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Route from '@ember/routing/route';
2+
3+
export default class GuidNodeDraftsIndex extends Route {
4+
model() {
5+
this.replaceWith('registries.drafts.draft', this.modelFor('guid-node.drafts'));
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Route from '@ember/routing/route';
2+
3+
export default class GuidNodeDraftsRegister extends Route {
4+
model() {
5+
this.replaceWith('registries.drafts.draft.page', this.modelFor('guid-node.drafts'), 'review');
6+
}
7+
}

app/guid-node/drafts/route.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Route from '@ember/routing/route';
2+
3+
export default class GuidNodeDrafts extends Route {
4+
model(params: { draftId: string }) {
5+
return params.draftId;
6+
}
7+
}

app/guid-node/registrations/controller.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ import { action, computed } from '@ember-decorators/object';
22
import { alias } from '@ember-decorators/object/computed';
33
import { service } from '@ember-decorators/service';
44
import Controller from '@ember/controller';
5+
import { assert } from '@ember/debug';
56
import { task } from 'ember-concurrency';
67
import DS from 'ember-data';
7-
import config from 'ember-get-config';
88

99
import Node from 'ember-osf-web/models/node';
1010
import RegistrationSchema from 'ember-osf-web/models/registration-schema';
1111
import Analytics from 'ember-osf-web/services/analytics';
12-
import pathJoin from 'ember-osf-web/utils/path-join';
13-
14-
const { OSF: { url: baseURL } } = config;
1512

1613
export default class GuidNodeRegistrations extends Controller {
1714
@service analytics!: Analytics;
@@ -100,6 +97,9 @@ export default class GuidNodeRegistrations extends Controller {
10097

10198
@action
10299
async createDraft(this: GuidNodeRegistrations) {
100+
const branchedFrom = this.node!;
101+
assert('Check that the node exists', Boolean(branchedFrom));
102+
103103
if (this.selectedSchema.name === 'Prereg Challenge' && this.newModalOpen) {
104104
this.set('newModalOpen', false);
105105
this.set('preregConsented', false);
@@ -108,14 +108,17 @@ export default class GuidNodeRegistrations extends Controller {
108108
}
109109
const draftRegistration = this.store.createRecord('draft-registration', {
110110
registrationSupplement: this.selectedSchema.id,
111-
branchedFrom: this.node,
111+
branchedFrom,
112112
registrationSchema: this.selectedSchema,
113113
});
114114
await draftRegistration.save();
115115
this.set('newModalOpen', false);
116116
this.set('selectedSchema', this.defaultSchema);
117-
window.location.assign(
118-
pathJoin(baseURL, draftRegistration.branchedFrom.get('id'), 'drafts', draftRegistration.id),
117+
118+
this.transitionToRoute(
119+
'guid-node.drafts',
120+
branchedFrom.id,
121+
draftRegistration.id,
119122
);
120123
}
121124
}

app/home/-components/hero-banner/component.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { tagName } from '@ember-decorators/component';
2-
import { action, computed } from '@ember-decorators/object';
2+
import { action } from '@ember-decorators/object';
33
import { alias } from '@ember-decorators/object/computed';
44
import { service } from '@ember-decorators/service';
55
import Component from '@ember/component';
@@ -21,14 +21,9 @@ const { featureFlagNames: { ABTesting } } = config;
2121
export default class HomeHeroBanner extends Component {
2222
@service features!: Features;
2323

24-
@alias(`features.${camelize(ABTesting.homePageVersionB)}`)
24+
@alias(`features.${camelize(ABTesting.homePageHeroTextVersionB)}`)
2525
shouldShowVersionB!: boolean;
2626

27-
@computed('shouldShowVersionB')
28-
get version(): string {
29-
return this.shouldShowVersionB ? 'versionB' : 'versionA';
30-
}
31-
3227
@action
3328
search(query: string) {
3429
const { search } = serviceLinks;

0 commit comments

Comments
 (0)