Browse Source

remove lastName and just have a single name field

more-smalls
Trent Larson 1 year ago
parent
commit
c388cc8cfe
  1. 2
      package.json
  2. 3
      project.task.yaml
  3. 2
      src/db/tables/settings.ts
  4. 20
      src/views/AccountViewView.vue
  5. 4
      src/views/ContactQRScanShowView.vue
  6. 18
      src/views/IdentitySwitcherView.vue
  7. 32
      src/views/NewEditAccountView.vue

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "kickstart-for-time-pwa", "name": "kickstart-for-time-pwa",
"version": "0.1.2", "version": "0.1.3",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",

3
project.task.yaml

@ -6,8 +6,6 @@ tasks:
- 40 notifications : - 40 notifications :
- push, where we trigger a ServiceWorker(?) in the app to reach out and check for new data assignee:matthew - push, where we trigger a ServiceWorker(?) in the app to reach out and check for new data assignee:matthew
- .1 test - make sure that a registration failure (including network failure) doesn't give a success message (which may have happened during board meeting)
- .1 don't allow to even see the claim actions if they're not registered - .1 don't allow to even see the claim actions if they're not registered
- 01 Replace Gifted/Give in ContactsView with GiftedDialog assignee:matthew - 01 Replace Gifted/Give in ContactsView with GiftedDialog assignee:matthew
@ -57,6 +55,7 @@ tasks:
- .5 Display a more appealing confirmation on the map when erasing the marker assignee-group:ui - .5 Display a more appealing confirmation on the map when erasing the marker assignee-group:ui
- .5 make a VC details page - .5 make a VC details page
- .1 Add units or different icon to the coins (to distinguish $, BTC, hours, etc) - .1 Add units or different icon to the coins (to distinguish $, BTC, hours, etc)
- .1 remove firstName (& lastName) from localStorage
- contacts v+ : - contacts v+ :
- 01 Import all the non-sensitive data (ie. contacts & settings). - 01 Import all the non-sensitive data (ie. contacts & settings).

2
src/db/tables/settings.ts

@ -12,7 +12,7 @@ export type Settings = {
activeDid?: string; activeDid?: string;
apiServer?: string; apiServer?: string;
firstName?: string; firstName?: string;
lastName?: string; lastName?: string; // deprecated, pre v 0.1.3
lastViewedClaimId?: string; lastViewedClaimId?: string;
searchBoxes?: Array<{ searchBoxes?: Array<{
name: string; name: string;

20
src/views/AccountViewView.vue

@ -52,7 +52,7 @@
<!-- Identity Details --> <!-- Identity Details -->
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4"> <div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
<h2 class="text-xl font-semibold mb-2">{{ firstName }} {{ lastName }}</h2> <h2 class="text-xl font-semibold mb-2">{{ givenName }}</h2>
<div class="text-slate-500 text-sm font-bold">ID</div> <div class="text-slate-500 text-sm font-bold">ID</div>
<div class="text-sm text-slate-500 flex justify-start items-center mb-1"> <div class="text-sm text-slate-500 flex justify-start items-center mb-1">
@ -372,7 +372,7 @@ interface SettingsType {
activeDid?: string; activeDid?: string;
apiServer?: string; apiServer?: string;
firstName?: string; firstName?: string;
lastName?: string; lastName?: string; // deprecated, pre v 0.1.3
showContactGivesInline?: boolean; showContactGivesInline?: boolean;
} }
@ -386,8 +386,7 @@ export default class AccountViewView extends Vue {
apiServer = ""; apiServer = "";
apiServerInput = ""; apiServerInput = "";
derivationPath = ""; derivationPath = "";
firstName = ""; givenName = "";
lastName = "";
numAccounts = 0; numAccounts = 0;
publicHex = ""; publicHex = "";
publicBase64 = ""; publicBase64 = "";
@ -510,11 +509,12 @@ export default class AccountViewView extends Vue {
* @param {SettingsType} settings - Object containing settings from the database. * @param {SettingsType} settings - Object containing settings from the database.
*/ */
initializeState(settings: SettingsType | undefined) { initializeState(settings: SettingsType | undefined) {
this.activeDid = settings?.activeDid || ""; this.activeDid = (settings?.activeDid as string) || "";
this.apiServer = settings?.apiServer || ""; this.apiServer = (settings?.apiServer as string) || "";
this.apiServerInput = settings?.apiServer || ""; this.apiServerInput = (settings?.apiServer as string) || "";
this.firstName = settings?.firstName || ""; this.givenName =
this.lastName = settings?.lastName || ""; (settings?.firstName || "") +
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3
this.showContactGives = !!settings?.showContactGivesInline; this.showContactGives = !!settings?.showContactGivesInline;
} }
@ -531,7 +531,7 @@ export default class AccountViewView extends Vue {
) { ) {
this.publicHex = identity.keys[0].publicKeyHex; this.publicHex = identity.keys[0].publicKeyHex;
this.publicBase64 = Buffer.from(this.publicHex, "hex").toString("base64"); this.publicBase64 = Buffer.from(this.publicHex, "hex").toString("base64");
this.derivationPath = identity.keys[0].meta.derivationPath; this.derivationPath = identity.keys[0].meta.derivationPath as string;
db.settings.update(MASTER_SETTINGS_KEY, { db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: identity.did, activeDid: identity.did,

4
src/views/ContactQRScanShowView.vue

@ -108,7 +108,9 @@ export default class ContactQRScanShow extends Vue {
iat: Date.now(), iat: Date.now(),
iss: this.activeDid, iss: this.activeDid,
own: { own: {
name: (settings?.firstName || "") + " " + (settings?.lastName || ""), name:
(settings?.firstName || "") +
(settings?.lastName ? ` ${settings.lastName}` : ""), // deprecated, pre v 0.1.3
publicEncKey, publicEncKey,
}, },
}; };

18
src/views/IdentitySwitcherView.vue

@ -22,7 +22,7 @@
<fa icon="circle-check" class="fa-fw text-blue-600 text-xl mr-3"></fa> <fa icon="circle-check" class="fa-fw text-blue-600 text-xl mr-3"></fa>
<span class="overflow-hidden"> <span class="overflow-hidden">
<h2 class="text-xl font-semibold mb-0"> <h2 class="text-xl font-semibold mb-0">
{{ firstName }} {{ lastName }} {{ givenName }}
</h2> </h2>
<div class="text-sm text-slate-500 truncate"> <div class="text-sm text-slate-500 truncate">
<b>ID:</b> <code>{{ activeDid }}</code> <b>ID:</b> <code>{{ activeDid }}</code>
@ -90,8 +90,7 @@ export default class IdentitySwitcherView extends Vue {
public activeDid = ""; public activeDid = "";
public apiServer = ""; public apiServer = "";
public apiServerInput = ""; public apiServerInput = "";
public firstName = ""; public givenName = "";
public lastName = "";
public otherIdentities: Array<{ did: string }> = []; public otherIdentities: Array<{ did: string }> = [];
public showContactGives = false; public showContactGives = false;
@ -101,7 +100,7 @@ export default class IdentitySwitcherView extends Vue {
.where("did") .where("did")
.equals(activeDid) .equals(activeDid)
.first(); .first();
const identity = JSON.parse(account?.identity || "null"); const identity = JSON.parse((account?.identity as string) || "null");
return identity; return identity;
} }
@ -109,11 +108,12 @@ export default class IdentitySwitcherView extends Vue {
try { try {
await db.open(); await db.open();
const settings = await db.settings.get(MASTER_SETTINGS_KEY); const settings = await db.settings.get(MASTER_SETTINGS_KEY);
this.activeDid = settings?.activeDid || ""; this.activeDid = (settings?.activeDid as string) || "";
this.apiServer = settings?.apiServer || ""; this.apiServer = (settings?.apiServer as string) || "";
this.apiServerInput = settings?.apiServer || ""; this.apiServerInput = (settings?.apiServer as string) || "";
this.firstName = settings?.firstName || "No"; this.givenName =
this.lastName = settings?.lastName || "Name"; ((settings?.firstName as string) || "") +
(settings?.lastName ? ` ${settings.lastName}` : ""); // deprecated, pre v 0.1.3
this.showContactGives = !!settings?.showContactGivesInline; this.showContactGives = !!settings?.showContactGivesInline;
const identity = await this.getIdentity(this.activeDid); const identity = await this.getIdentity(this.activeDid);

32
src/views/NewEditAccountView.vue

@ -16,15 +16,9 @@
<input <input
type="text" type="text"
placeholder="First Name" placeholder="Name"
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2" class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
v-model="firstName" v-model="givenName"
/>
<input
type="text"
placeholder="Last Name"
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
v-model="lastName"
/> />
<div class="mt-8"> <div class="mt-8">
@ -56,30 +50,24 @@ import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
components: {}, components: {},
}) })
export default class NewEditAccountView extends Vue { export default class NewEditAccountView extends Vue {
firstName = givenName = "";
localStorage.getItem("firstName") === null
? "--"
: localStorage.getItem("firstName");
lastName =
localStorage.getItem("lastName") === null
? "--"
: localStorage.getItem("lastName");
// 'created' hook runs when the Vue instance is first created // 'created' hook runs when the Vue instance is first created
async created() { async created() {
await db.open(); await db.open();
const settings = await db.settings.get(MASTER_SETTINGS_KEY); const settings = await db.settings.get(MASTER_SETTINGS_KEY);
this.firstName = settings?.firstName || ""; this.givenName =
this.lastName = settings?.lastName || ""; ((settings?.firstName as string) || "") +
(settings?.lastName ? ` ${settings.lastName}` : ""); // deprecated, pre v 0.1.3
} }
onClickSaveChanges() { onClickSaveChanges() {
db.settings.update(MASTER_SETTINGS_KEY, { db.settings.update(MASTER_SETTINGS_KEY, {
firstName: this.firstName, firstName: this.givenName,
lastName: this.lastName, lastName: "", // deprecated, pre v 0.1.3
}); });
localStorage.setItem("firstName", this.firstName as string); localStorage.setItem("firstName", this.givenName as string);
localStorage.setItem("lastName", this.lastName as string); localStorage.setItem("lastName", ""); // deprecated, pre v 0.1.3
this.$router.push({ name: "account" }); this.$router.push({ name: "account" });
} }

Loading…
Cancel
Save