Skip to content

Commit

Permalink
Merge pull request #7987 from michaelchadwick/frontend-5546-add-lm-li…
Browse files Browse the repository at this point in the history
…nk-flash-message

add confirmation message to LM file/link copy button
  • Loading branch information
stopfstedt committed Jul 19, 2024
2 parents 4522f1a + 297e616 commit faa5a0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@
{{t "general.link"}}:
</label>
<span class="link">
<a href={{this.link}} target="_blank" rel="noopener noreferrer">
{{this.link}}
</a>
<CopyButton @clipboardText={{this.link}}>
<a href={{this.link}} target="_blank" rel="noopener noreferrer">{{this.link}}</a>
<CopyButton @clipboardText={{this.link}} @success={{perform this.textCopied}}>
<FaIcon @icon="copy" @title={{t "general.copyLink"}} />
</CopyButton>
</span>
Expand All @@ -189,9 +187,7 @@
</label>
<span class="downloadurl">
{{#if (eq this.mimetype "application/pdf")}}
<a href="{{this.absoluteFileUri}}?inline">
{{this.filename}}
</a>
<a href="{{this.absoluteFileUri}}?inline">{{this.filename}}</a>
<a href={{this.absoluteFileUri}} target="_blank" rel="noopener noreferrer">
<FaIcon @icon="download" @title={{t "general.download"}} />
</a>
Expand All @@ -200,7 +196,7 @@
{{this.filename}}
</a>
{{/if}}
<CopyButton @clipboardText={{this.absoluteFileUri}}>
<CopyButton @clipboardText={{this.absoluteFileUri}} @success={{perform this.textCopied}}>
<FaIcon @icon="copy" @title={{t "general.copyLink"}} />
</CopyButton>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { findById } from 'ilios-common/utils/array-helpers';
@validatable
export default class LearningMaterialManagerComponent extends Component {
@service store;
@service flashMessages;

@tracked notes;
@tracked learningMaterial;
Expand Down Expand Up @@ -184,4 +185,8 @@ export default class LearningMaterialManagerComponent extends Component {
await this.parentMaterial.save();
this.args.closeManager();
});

textCopied = restartableTask(async () => {
this.flashMessages.success('general.copiedSuccessfully');
});
}

0 comments on commit faa5a0f

Please sign in to comment.