-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathshow.js
71 lines (55 loc) · 1.39 KB
/
show.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import Component from "@glimmer/component";
import { action } from "@ember/object";
import { tracked } from "@glimmer/tracking";
import { inject as service } from "@ember/service";
export default class ShowComponent extends Component {
@service router;
@service navService;
constructor() {
super(...arguments);
window.scrollTo(0, 0);
}
@tracked
isEncryptableEditing = false;
@tracked
isFileCreating = false;
@tracked
isCcliOptionsOpen = false;
@tracked
isFile = this.args.encryptable.isFile;
@tracked
isCredentialSharing = false;
@tracked isTransferredCredentials =
this.args.encryptable.sender_name !== null && !this.isFile;
@action
toggleEncryptableEdit() {
this.isEncryptableEditing = !this.isEncryptableEditing;
}
@action
toggleFileNew() {
this.isFileCreating = !this.isFileCreating;
}
@action
toggleCcliOptions() {
this.isCcliOptionsOpen = !this.isCcliOptionsOpen;
}
get downloadLink() {
return `/api/encryptables/${this.args.encryptable.get("id")}`;
}
@action
refreshRoute() {
this.router.transitionTo("/teams");
}
@action
toggleCredentialSharing() {
this.isCredentialSharing = !this.isCredentialSharing;
}
@action
transitionBack() {
this.router.transitionTo(
"teams.folders-show",
this.args.encryptable.folder.get("team.id"),
this.args.encryptable.folder.get("id")
);
}
}