Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default class RegistrationModel extends NodeModel.extend(Validations) {

// Write-only attributes
@attr('array') includedNodeIds?: string[];
@attr('boolean') createDoi?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this included?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was from the most recent merge commit 5e3f4e9 to resolve conflicts. I believe I was asked to keep it, but should it be removed?

@attr('fixstring') draftRegistrationId?: string;

@belongsTo('node', { inverse: 'registrations' })
Expand Down Expand Up @@ -150,6 +151,7 @@ export default class RegistrationModel extends NodeModel.extend(Validations) {
// Write-only relationships
@belongsTo('draft-registration', { inverse: null })
draftRegistration!: DraftRegistrationModel;
static reviewsState: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

This also doesn't do anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I had removed that for another PR as well. It is now removed here too.

}

declare module 'ember-data/types/registries/model' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,44 @@ import { action } from '@ember/object';
import { and, or } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Media from 'ember-responsive';
import Toast from 'ember-toastr/services/toast';
import SchemaResponseModel, { RevisionReviewStates } from 'ember-osf-web/models/schema-response';
import Intl from 'ember-intl/services/intl';
import RouterService from '@ember/routing/router-service';
import { tracked } from '@glimmer/tracking';
import NodeModel from 'ember-osf-web/models/node';
import RegistrationModel from 'ember-osf-web/models/registration';

import { layout } from 'ember-osf-web/decorators/component';

import styles from './styles';
import template from './template';

// interface Args {
// registration: RegistrationModel;
// selectedRevisionId: string;
// }

@tagName('')
@layout(template, styles)
export default class RegistriesSideNav extends Component {
export default class RegistriesSideNav extends Component { // <Args> {
@service media!: Media;
@service toast!: Toast;
@service intl!: Intl;
@service router!: RouterService;

@tracked selectedSchema!: SchemaResponseModel;
@tracked registration!: RegistrationModel;
@tracked node!: NodeModel;

toDelete: SchemaResponseModel | null = null;
deleteEdit = false;

reloadList?: (page?: number) => void; // bound by paginated-list
Copy link
Contributor

Choose a reason for hiding this comment

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

What list are we reloading?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic is not complete but was in place for if a list of revision ids were needed, the logic would reload the list and pull the last object of the schema id from the list after the deletion and redirect to its overview page.


// Optional params
onLinkClicked?: () => void;
// latestSchemaResponseId = this.selectedSchema.id;

// Private properties
shouldCollapse = false;
Expand All @@ -31,4 +56,24 @@ export default class RegistriesSideNav extends Component {
toggle() {
this.toggleProperty('shouldCollapse');
}

@action
delete() {
this.set('deleteEdit', false);
const edit = this.toDelete;
if (!edit) {
return;
}
this.set('toDelete', null);
// edit.deleteRecord();
edit.destroyRecord();
this.router.transitionTo(
'registries.overview.index',
this.selectedSchema.get('id'),
{ queryParams: { state: RevisionReviewStates.RevisionInProgress } },
// this.latestSchemaResponseId);
);
this.registration.reload();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,15 @@
</ExpandButton>
{{/let}}
{{/if}}
<BsButton
data-analytics-name='Delete'
data-test-delete-button
@bubble={{true}}
@delete={{action this.delete}}
@type='default'
@size='2x'
@icon={{if this.isCollapsed 'trash-alt'}}
>
{{t 'registries.newUpdateModal.cancel_update'}}
</BsButton>
</nav>
11 changes: 9 additions & 2 deletions translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,11 @@ node_card:
pending_embargo_termination: 'Pending embargo termination'
pending_withdraw_request: 'Pending withdrawal'
pending_withdraw: 'Pending withdrawal moderation'
withdrawn: Withdrawn
archiving: Archiving
withdrawn: 'Withdrawn'
archiving: 'Archiving'
revision_in_progress: 'A revision is currently in progress'
revision_pending_admin_approval: 'Revision is currently pending admin approval'
revision_pending_edit_moderation: 'Revision is currently pending moderator approval'
tags: 'Tags:'
registration_template: 'Registration template:'
contributors: 'Contributors:'
Expand Down Expand Up @@ -1106,6 +1109,8 @@ registries:
uploadSuccess: 'Successfully uploaded csv file.'
overview:
title: 'Moderated Overview'
delete_update: 'Delete update'
confirm_delete: 'Please confirm deletion of update.'
new:
provider_info: 'You are submitting to {provider}. <a href="https://help.osf.io/hc/en-us/categories/360001550953-Registrations">Click here</a> to learn more about other hosted registries.'
required: 'required'
Expand Down Expand Up @@ -1601,6 +1606,8 @@ registries:
modalBodyNoUpdates: 'The {registryName} does not allow updates for this registration template.<br>Contact their registy if you have any questions.'
learnMore: 'Click <a href="https://help.osf.io/hc/en-us/articles/360035806634-Edit-Registration-Metadata" target="_blank">here</a> to learn more'
next: Next
cancel_update: 'Cancel update'

meetings:
index:
meetings-list:
Expand Down