Skip to content

Commit

Permalink
Merge branch 'release/22.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius committed Oct 5, 2022
2 parents ef19ae7 + 70622b0 commit ee40d95
Show file tree
Hide file tree
Showing 118 changed files with 1,599 additions and 1,147 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).


## [22.10.0] - 2022-10-05
### Changed
- Misc bug and a11y fixes.
- Keen replacement.

## [22.9.0] - 2022-9-21
### Changed
- Misc bug and a11y fixes.
Expand Down
8 changes: 8 additions & 0 deletions app/application/route.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import Route from '@ember/routing/route';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
import Intl from 'ember-intl/services/intl';

import checkAuth from 'ember-osf-web/decorators/check-auth';
import Analytics from 'ember-osf-web/services/analytics';
import CurrentUser from 'ember-osf-web/services/current-user';

@checkAuth
Expand All @@ -18,6 +20,7 @@ export default class ApplicationRoute extends Route.extend(
) {
@service intl!: Intl;
@service currentUser!: CurrentUser;
@service analytics!: Analytics;

queryParams = {
viewOnlyToken: {
Expand All @@ -28,4 +31,9 @@ export default class ApplicationRoute extends Route.extend(
beforeModel() {
return this.intl.setLocale('en-us');
}

@action
didTransition() {
this.analytics.trackPage();
}
}
4 changes: 2 additions & 2 deletions app/authenticators/osf-cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class OsfCookie extends Base {
return { id };
}

restore() {
async restore() {
const {
lastVerifiedUserId,
session: {
Expand All @@ -107,7 +107,7 @@ export default class OsfCookie extends Base {

// Check for a valid auth cookie.
// If it fails, the session will be invalidated.
return this.authenticate();
return await this.authenticate();
}

async _checkApiVersion() {
Expand Down
8 changes: 0 additions & 8 deletions app/dashboard/route.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { action } from '@ember/object';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { taskFor } from 'ember-concurrency-ts';
import Session from 'ember-simple-auth/services/session';

import DashboardController from 'ember-osf-web/dashboard/controller';
import requireAuth from 'ember-osf-web/decorators/require-auth';
import Analytics from 'ember-osf-web/services/analytics';
import CurrentUser from 'ember-osf-web/services/current-user';
import Ready from 'ember-osf-web/services/ready';

@requireAuth('home')
export default class Dashboard extends Route {
@service analytics!: Analytics;
@service currentUser!: CurrentUser;
@service ready!: Ready;
@service session!: Session;
Expand All @@ -27,9 +24,4 @@ export default class Dashboard extends Route {
blocker.errored(e);
}
}

@action
didTransition() {
this.analytics.trackPage();
}
}
21 changes: 21 additions & 0 deletions app/dashboard/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@
.node-col-headers {
display: none;
}

.iframe-container {
.osf-video {
width: 336px;
height: 190px;
}
}
}

@media screen and (min-width: 768px) {
Expand Down Expand Up @@ -183,3 +190,17 @@
color: $color-text-placeholder-grey-dark;
opacity: 1;
}

.iframe-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
margin-top: 20px;
margin-bottom: 30px;

.osf-video {
width: 560px;
height: 315px;
}
}

23 changes: 22 additions & 1 deletion app/dashboard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,28 @@
<div class='col-sm-12 text-center'>
<p>{{t 'dashboard.quicksearch.no_projects.line1'}}</p>
<p>{{t 'dashboard.quicksearch.no_projects.line2'}}</p>
<img src='/assets/images/dashboard/quicksearch-min.png' alt='{{t 'dashboard.quicksearch.no_projects.preview_alt'}}' class='img-responsive center-block'>

<div local-class='iframe-container'>
<iframe
data-test-osf-video
local-class='osf-video'
src='https://www.youtube.com/embed/iebMBpi0prc'
title={{t 'dashboard.osf_video'}}
alt='OSF 101 Video'
aria-hidden='true'
frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>
</div>

<OsfLink
data-test-get-started-button
data-analytics-name='Get started button'
class='btn btn-primary'
local-class='startButton'
@target='_blank'
@href='https://help.osf.io/article/342-getting-started-on-the-osf'
>
{{t 'dashboard.getting_started'}}
</OsfLink>
</div>
</div>
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions app/decorators/check-auth.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Route from '@ember/routing/route';
import { inject as service, Registry as ServiceRegistry } from '@ember/service';
import config from 'ember-get-config';
import SessionService from 'ember-simple-auth/services/session';

import { NotLoggedIn } from 'ember-osf-web/errors';
import CurrentUser from 'ember-osf-web/services/current-user';
import OsfSession from 'ember-osf-web/services/session';
import transitionTargetURL from 'ember-osf-web/utils/transition-target-url';

const {
Expand All @@ -30,7 +30,7 @@ export default function checkAuth<T extends ConcreteSubclass<Route>>(
) {
class AuthenticatedRoute extends RouteSubclass {
@service router!: ServiceRegistry['router'];
@service session!: SessionService;
@service session!: OsfSession;
@service currentUser!: CurrentUser;

async beforeModel(transition: any) {
Expand Down
9 changes: 0 additions & 9 deletions app/goodbye/route.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
import { action } from '@ember/object';
import Transition from '@ember/routing/-private/transition';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import Session from 'ember-simple-auth/services/session';

import Analytics from 'ember-osf-web/services/analytics';

export default class Goodbye extends Route {
@service analytics!: Analytics;
@service session!: Session;

async beforeModel(transition: Transition) {
await super.beforeModel(transition);
const queryParams = this.session.isAuthenticated ? {} : { goodbye: true };
this.transitionTo('home', { queryParams });
}

@action
didTransition() {
this.analytics.trackPage();
}
}
12 changes: 6 additions & 6 deletions app/guid-file/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { action } from '@ember/object';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { waitFor } from '@ember/test-waiters';
Expand All @@ -8,7 +7,6 @@ import { taskFor } from 'ember-concurrency-ts';
import moment from 'moment';

import Institution from 'ember-osf-web/models/institution';
import Analytics from 'ember-osf-web/services/analytics';
import MetaTags, { HeadTagDef } from 'ember-osf-web/services/meta-tags';
import Ready from 'ember-osf-web/services/ready';
import OsfStorageFile from 'ember-osf-web/packages/files/osf-storage-file';
Expand All @@ -27,7 +25,6 @@ import CurrentUserService from 'ember-osf-web/services/current-user';
import RegistrationModel from 'ember-osf-web/models/registration';

export default class GuidFile extends Route {
@service analytics!: Analytics;
@service('head-tags') headTagsService!: HeadTagsService;
@service metaTags!: MetaTags;
@service ready!: Ready;
Expand Down Expand Up @@ -116,8 +113,11 @@ export default class GuidFile extends Route {
taskFor(this.setHeadTags).perform(model.fileModel);
}

@action
didTransition() {
this.analytics.trackPage(true, 'files');
buildRouteInfoMetadata() {
return {
osfMetrics: {
itemGuid: this.controller.model.id,
},
};
}
}
18 changes: 0 additions & 18 deletions app/guid-node/forks/route.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
import { action } from '@ember/object';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

import Node from 'ember-osf-web/models/node';
import { GuidRouteModel } from 'ember-osf-web/resolve-guid/guid-route';
import Analytics from 'ember-osf-web/services/analytics';
import Ready from 'ember-osf-web/services/ready';

export default class GuidNodeForks extends Route {
@service analytics!: Analytics;
@service ready!: Ready;

model() {
return this.modelFor('guid-node');
}

@action
async didTransition() {
const { taskInstance } = this.controller.model as GuidRouteModel<Node>;
await taskInstance;
const node = taskInstance.value;
this.analytics.trackPage(node ? node.public : undefined, 'nodes');
}
}
13 changes: 0 additions & 13 deletions app/guid-node/registrations/route.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { action } from '@ember/object';
import Transition from '@ember/routing/-private/transition';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { taskFor } from 'ember-concurrency-ts';

import Node from 'ember-osf-web/models/node';
import { GuidRouteModel } from 'ember-osf-web/resolve-guid/guid-route';
import Analytics from 'ember-osf-web/services/analytics';

import Controller from './controller';

export default class GuidNodeRegistrations extends Route {
@service analytics!: Analytics;

model() {
return this.modelFor('guid-node') as GuidRouteModel<Node>;
}
Expand All @@ -21,12 +16,4 @@ export default class GuidNodeRegistrations extends Route {
super.setupController(controller, model, transition);
taskFor(controller.getRegistrationSchemas).perform();
}

@action
async didTransition() {
const { taskInstance } = this.controller.model as GuidRouteModel<Node>;
await taskInstance;
const node = taskInstance.value;
this.analytics.trackPage(node ? node.public : undefined, 'nodes');
}
}
13 changes: 0 additions & 13 deletions app/guid-registration/forks/route.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import { action } from '@ember/object';
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

import Registration from 'ember-osf-web/models/registration';
import { GuidRouteModel } from 'ember-osf-web/resolve-guid/guid-route';
import Analytics from 'ember-osf-web/services/analytics';
import Ready from 'ember-osf-web/services/ready';

export default class GuidRegistrationForks extends Route {
@service analytics!: Analytics;
@service ready!: Ready;

model() {
return this.modelFor('guid-registration');
}

@action
async didTransition() {
const { taskInstance } = this.controller.model as GuidRouteModel<Registration>;
await taskInstance;
const registration = taskInstance.value;
this.analytics.trackPage(registration ? registration.public : undefined, 'registrations');
}
}
4 changes: 2 additions & 2 deletions app/helpers/open-badges-icon-map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ResourceTypes } from 'ember-osf-web/models/resource';

export function getBadgeIcon(resourceType: ResourceTypes) {
export function getBadgeIcon(resourceType: ResourceTypes | 'undefined') {
switch (resourceType) {
case ResourceTypes.Data:
return '/assets/images/badges/data_small_color.png';
Expand All @@ -17,7 +17,7 @@ export function getBadgeIcon(resourceType: ResourceTypes) {
}
}

export function getBadgeIconDisabled(resourceType: ResourceTypes) {
export function getBadgeIconDisabled(resourceType: ResourceTypes | 'undefined') {
switch (resourceType) {
case ResourceTypes.Data:
return '/assets/images/badges/data_small_gray.png';
Expand Down
22 changes: 22 additions & 0 deletions app/home/-components/support-section/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
}
}

.iframe-container {
margin-bottom: 30px;

.osf-video {
width: 560px;
height: 315px;
}
}

.supportItem {
display: inline-block;
}
Expand Down Expand Up @@ -60,6 +69,19 @@
.container h1 {
font-size: 36px;
}

.iframe-container {
justify-content: center;

&.flex-row {
display: flex;
}

.osf-video {
width: 336px;
height: 190px;
}
}
}

@media (max-width: 613px) {
Expand Down
14 changes: 14 additions & 0 deletions app/home/-components/support-section/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
{{t 'new-home.support-section.header'}}
</h1>
</header>
<div local-class='flex-container'>
<div local-class='flex-row iframe-container'>
<iframe
data-test-osf-video
local-class='osf-video'
src='https://www.youtube.com/embed/iebMBpi0prc'
title={{t 'new-home.support-section.osf_video'}}
alt='OSF 101 Video'
aria-hidden='true'
frameborder='0'
allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'
allowfullscreen></iframe>
</div>
</div>
<div local-class='flex-container'>
<div local-class='flex-row'>
<div>
Expand Down
Loading

0 comments on commit ee40d95

Please sign in to comment.