Skip to content

Commit

Permalink
Address CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabmiz committed May 14, 2021
1 parent 3531327 commit 497f085
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/services/osf-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class OsfRouterService extends Service {

this.set('currentTransitionTargetFragment', fragment);
}
return this.router.transitionTo(routeName, ...args) as Transition;
return this.router.transitionTo(routeName, ...args);
}
}

Expand Down
4 changes: 2 additions & 2 deletions blueprints/osf-model/files/__root__/models/__name__.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { attr, belongsTo, hasMany } from '@ember-data/model';

import OsfModel from './osf-model';

export default class <%= classifiedModuleName % > Model; extends OsfModel; {
export default class <%= classifiedModuleName %>Model extends OsfModel {
}

declare module 'ember-data/types/registries/model' {
export default interface ModelRegistry {
'<%= dasherizedModuleName %>': <%= classifiedModuleName; % > Model;
'<%= dasherizedModuleName %>': <%= classifiedModuleName %>Model;
} // eslint-disable-line semi
}
7 changes: 0 additions & 7 deletions handbook-docs/components/validated-model-form/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@ import ConfirmationMixin from 'ember-onbeforeunload/mixins/confirmation';
import ValidatedModelFormController from './controller';

export default class ValidatedModelFormRoute extends Route.extend(ConfirmationMixin) {
<<<<<<< HEAD
@task({ withTestWaiter: true })
modelTask = task(function *(this: ValidatedModelFormRoute) {
return yield this.store.findRecord('node', 'extng');
});
=======
@task
async modelTask() {
const node = await this.store.findRecord('node', 'extng');
return node;
}
>>>>>>> 74cd086b7... Remove withTestWaiter flag

model() {
return {
Expand Down
2 changes: 1 addition & 1 deletion lib/collections/addon/guid/edit/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class GuidEdit extends Controller {

isPageDirty = false;

@computed('collectedMetadatum.hasDirtyAttributes', 'this.collectedMetadatum.hasDirtyAttributes')
@computed('collectedMetadatum.hasDirtyAttributes')
get isCollectedMetadatumDirty() {
return this.collectedMetadatum.hasDirtyAttributes;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/collections/addon/guid/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class Guid extends Route {
}

try {
const collectedMetadatum: CollectedMetadatum = await this.store.findRecord('collected-metadatum', cgmId);
const collectedMetadatum = await this.store.findRecord('collected-metadatum', cgmId);
const collectionItem = this.store.peekRecord('node', collectedItemId)!;

if (!collectionItem.userHasAdminPermission) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ export default class AncestryDisplay extends Component {

// Results might have undefined `value` if ancestors are private
if (ancestors.length > 1) {
const parent = (results[1] as { state: 'fulfilled', value: NodeModel }).value;
if (parent && parent.belongsTo('parent').id() !== rootId) {
ancestors.insertAt(1, { id: '', title: this.intl.t('general.ellipsis') });
if ('value' in results[1]) {
const parent = results[1].value;
if (parent && parent.belongsTo('parent').id() !== rootId) {
ancestors.insertAt(1, { id: '', title: this.intl.t('general.ellipsis') });
}
}
}
return ancestors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
data-test-discard-edits
data-analytics-name='Discard'
disabled={{@manager.isSaving}}
@onClick={{action @manager.cancel}}
{{on 'click' @manager.cancel}}
>
{{t 'general.cancel'}}
</BsButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
@type='primary'
{{on 'click' @manager.save}}
>
{{!-- type='submit' --}}
{{t 'general.save'}}
</BsButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@
<BsButton
data-analytics-name='Withdraw registration'
disabled={{or this.submitDisabled this.submitWithdrawal.isRunning}}
@buttonType='submit'
@type='danger'
@onClick={{action modal.submit}}
{{on 'click' modal.submit}}
>
{{t 'registries.overview.withdraw.withdraw'}}
</BsButton>
Expand Down
4 changes: 3 additions & 1 deletion mirage/factories/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export default Factory.extend<MirageNode & NodeTraits>({
server.schema.registrationSchemas.all().models,
),
});
reg.update({ contributors: node.contributors.models });
node.contributors.models.forEach(
contributor => server.create('contributor', { node: reg, users: contributor.users }),
);
}
},
}),
Expand Down

0 comments on commit 497f085

Please sign in to comment.