diff --git a/app/preprints/-components/preprint-abstract/component.ts b/app/preprints/-components/preprint-abstract/component.ts deleted file mode 100644 index c94e98586ec..00000000000 --- a/app/preprints/-components/preprint-abstract/component.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { action } from '@ember/object'; -import Component from '@glimmer/component'; -import { tracked } from '@glimmer/tracking'; -import PreprintModel from 'ember-osf-web/models/preprint'; - -interface InputArgs { - preprint: PreprintModel; -} - -export default class PreprintAbstract extends Component { - preprint = this.args.preprint; - - @tracked expandedAbstract = navigator.userAgent.includes('Prerender'); - - get hasShortenedDescription(): boolean { - return this.preprint.description !== undefined && this.preprint.description.length > 350; - } - - private get useShortenedDescription(): boolean { - return this.hasShortenedDescription && !this.expandedAbstract; - } - - /** - * description - * - * @description Get a shortened version of the abstract, but doesn't cut in the middle of word - * by going to the last space. - * @returns string - */ - public get description(): string { - if (this.useShortenedDescription) { - return this.preprint.description - .slice(0, 350) - .replace(/\s+\S*$/, ''); - } else { - return this.preprint.description; - } - } - - @action - public expandAbstract() { - this.expandedAbstract = !this.expandedAbstract; - } -} diff --git a/app/preprints/-components/preprint-abstract/template.hbs b/app/preprints/-components/preprint-abstract/template.hbs index feed7cda1a5..f4a1eb5ecdd 100644 --- a/app/preprints/-components/preprint-abstract/template.hbs +++ b/app/preprints/-components/preprint-abstract/template.hbs @@ -1,17 +1,6 @@

{{t 'preprints.detail.abstract'}}

-

- {{this.description}} -

- {{#if this.hasShortenedDescription}} - - {{/if}} + + {{@preprint.description}} +
\ No newline at end of file