Browse Source

refactor: misc tweaks for types, lint, etc

pull/13/head
Trent Larson 2 years ago
parent
commit
4cec3859ea
  1. 2
      project.yaml
  2. 1
      src/views/AccountViewView.vue
  3. 15
      src/views/NewEditProjectView.vue

2
project.yaml

@ -17,7 +17,7 @@
- parse input more robustly (with CSV lib and not commas) - parse input more robustly (with CSV lib and not commas)
- refactor alerts: - refactor alerts:
- They show at the top and can be missed, eg. account bakcup download - They show at the top and can be missed, eg. account data download
- commit screen - commit screen

1
src/views/AccountViewView.vue

@ -310,7 +310,6 @@ export default class AccountViewView extends Vue {
const blob = await db.export({ prettyJson: true }); const blob = await db.export({ prettyJson: true });
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
console.log("typeof", typeof this.$refs.downloadLink);
const downloadAnchor = this.$refs.downloadLink as HTMLAnchorElement; const downloadAnchor = this.$refs.downloadLink as HTMLAnchorElement;
downloadAnchor.href = url; downloadAnchor.href = url;
downloadAnchor.download = db.name + "-backup.json"; downloadAnchor.download = db.name + "-backup.json";

15
src/views/NewEditProjectView.vue

@ -126,8 +126,10 @@ export default class NewEditProjectView extends Vue {
async LoadProject(identity: IIdentifier) { async LoadProject(identity: IIdentifier) {
const endorserApiServer = AppString.DEFAULT_ENDORSER_API_SERVER; const endorserApiServer = AppString.DEFAULT_ENDORSER_API_SERVER;
// eslint-disable-next-line prettier/prettier const url =
const url = endorserApiServer + "/api/claim/byHandle/" + encodeURIComponent(this.projectId); endorserApiServer +
"/api/claim/byHandle/" +
encodeURIComponent(this.projectId);
const token = await accessToken(identity); const token = await accessToken(identity);
const headers = { const headers = {
"Content-Type": "application/json", "Content-Type": "application/json",
@ -161,7 +163,6 @@ export default class NewEditProjectView extends Vue {
} }
// Make a payload for the claim // Make a payload for the claim
const vcPayload = { const vcPayload = {
sub: "PlanAction",
vc: { vc: {
"@context": ["https://www.w3.org/2018/credentials/v1"], "@context": ["https://www.w3.org/2018/credentials/v1"],
type: ["VerifiableCredential"], type: ["VerifiableCredential"],
@ -169,12 +170,8 @@ export default class NewEditProjectView extends Vue {
}, },
}; };
// create a signature using private key of identity // create a signature using private key of identity
if ( if (identity.keys[0].privateKeyHex != null) {
identity.keys[0].privateKeyHex !== "undefined" && const privateKeyHex: string = identity.keys[0].privateKeyHex;
identity.keys[0].privateKeyHex !== null
) {
// eslint-disable-next-line
const privateKeyHex: string = identity.keys[0].privateKeyHex!;
const signer = await SimpleSigner(privateKeyHex); const signer = await SimpleSigner(privateKeyHex);
const alg = undefined; const alg = undefined;
// create a JWT for the request // create a JWT for the request

Loading…
Cancel
Save