Skip to content

Commit 6b37a47

Browse files
authored
update js file (#1001)
1 parent 4ef94d4 commit 6b37a47

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed
Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
import Component from '@glimmer/component';
1+
import Component from '@ember/component';
22
import { inject as service } from '@ember/service';
3-
import { action } from '@ember/object';
4-
import { tracked } from '@glimmer/tracking';
53

6-
export default class FormResponsesTableCardComponent extends Component {
7-
@service session;
8-
@tracked showAllergyInfo = false;
9-
@action
10-
copyUsernames() {
11-
let usernames = this.form
12-
.get('responses')
13-
.map((response) => response.get('user.username'));
14-
if (!this.form.currentUserResponseCompleted) {
15-
usernames = usernames.filter(
16-
(name) => name !== this.session.currentUser.username
17-
);
18-
}
19-
usernames = usernames.join('\n');
20-
navigator.clipboard.writeText(usernames);
21-
}
22-
}
4+
const FormResponsesTableCardComponent = Component.extend({
5+
session: service('session'),
6+
actions: {
7+
copyUsernames() {
8+
let usernames = this.form
9+
.get('responses')
10+
.map((response) => response.get('user.username'));
11+
if (!this.form.currentUserResponseCompleted) {
12+
usernames = usernames.filter(
13+
(name) => name !== this.session.currentUser.username
14+
);
15+
}
16+
usernames = usernames.join('\n');
17+
navigator.clipboard.writeText(usernames);
18+
},
19+
},
20+
});
21+
22+
FormResponsesTableCardComponent.reopenClass({
23+
positionalParams: ['form'],
24+
});
25+
26+
export default FormResponsesTableCardComponent;

0 commit comments

Comments
 (0)