This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app/components/auth-token-dropdown.js
Robin Ward eab560fe2a
DEV: import I18n instead of global usage (#9768)
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2020-05-13 16:23:41 -04:00

43 lines
883 B
JavaScript

import I18n from "I18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { computed } from "@ember/object";
export default DropdownSelectBoxComponent.extend({
classNames: ["auth-token-dropdown"],
selectKitOptions: {
icon: "wrench",
showFullTitle: false
},
content: computed(function() {
return [
{
id: "notYou",
icon: "user-times",
name: I18n.t("user.auth_tokens.not_you"),
description: ""
},
{
id: "logOut",
icon: "sign-out-alt",
name: I18n.t("user.log_out"),
description: ""
}
];
}),
actions: {
onChange(id) {
switch (id) {
case "notYou":
this.showToken(this.token);
break;
case "logOut":
this.revokeAuthToken(this.token);
break;
}
}
}
});