forked from jsnbuchanan/crowd-funder-for-time-pwa
fix linting
This commit is contained in:
@@ -9,8 +9,9 @@
|
||||
databases
|
||||
</p>
|
||||
<p class="mt-2 text-gray-600">
|
||||
First, we recommend you hit these first two buttons to get your backups, just in case!
|
||||
If anything doesn't look right when you're done, Trent will help with... anything and everything. 😁
|
||||
First, we recommend you hit these first two buttons to get your
|
||||
backups, just in case! If anything doesn't look right when you're
|
||||
done, Trent will help with... anything and everything. 😁
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -50,28 +51,34 @@
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div
|
||||
class="text-lg leading-6 font-medium text-red-900 mt-4"
|
||||
>
|
||||
<div class="text-lg leading-6 font-medium text-red-900 mt-4">
|
||||
<p
|
||||
v-if="comparison && (comparison.sqliteAccounts.length > 1 || comparison.sqliteSettings.length > 1 || comparison.sqliteContacts.length > 0)"
|
||||
v-if="
|
||||
comparison &&
|
||||
(comparison.sqliteAccounts.length > 1 ||
|
||||
comparison.sqliteSettings.length > 1 ||
|
||||
comparison.sqliteContacts.length > 0)
|
||||
"
|
||||
>
|
||||
Beware: you have unexpected existing data in the new database that will be overwritten. Talk with Trent.
|
||||
Beware: you have unexpected existing data in the new database that
|
||||
will be overwritten. Talk with Trent.
|
||||
</p>
|
||||
<p
|
||||
v-if="cannotfindMainAccount"
|
||||
>
|
||||
<p v-if="cannotfindMainAccount">
|
||||
We cannot find your main account. Talk with Trent.
|
||||
</p>
|
||||
<p
|
||||
v-if="hasMultipleMnemonics"
|
||||
>
|
||||
<p v-if="hasMultipleMnemonics">
|
||||
You have multiple accounts. If you didn't mean to, talk with Trent.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p v-if="downloadMnemonic" class="text-green-500">
|
||||
Here is your seed for account {{ downloadMnemonicAddress?.substring('did:ethr:0x'.length).substring(0, 3) }} -- write it down!
|
||||
Here is your seed for account
|
||||
{{
|
||||
downloadMnemonicAddress
|
||||
?.substring("did:ethr:0x".length)
|
||||
.substring(0, 3)
|
||||
}}
|
||||
-- write it down!
|
||||
<br />
|
||||
{{ downloadMnemonic }}
|
||||
</p>
|
||||
@@ -533,9 +540,7 @@
|
||||
icon-name="trash"
|
||||
svg-class="h-5 w-5 text-red-600 mr-2"
|
||||
/>
|
||||
<span class="text-sm font-medium text-red-900"
|
||||
>Keep</span
|
||||
>
|
||||
<span class="text-sm font-medium text-red-900">Keep</span>
|
||||
</div>
|
||||
<span class="text-sm font-bold text-red-900">{{
|
||||
comparison.differences.accounts.missing.length
|
||||
@@ -549,7 +554,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Add Accounts ({{ comparison.differences.accounts.added.length }}):
|
||||
Add Accounts ({{
|
||||
comparison.differences.accounts.added.length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
@@ -559,9 +566,17 @@
|
||||
>
|
||||
<div class="font-medium">ID: {{ account.id }}</div>
|
||||
<div class="text-gray-500">{{ account.did }}</div>
|
||||
<div class="text-gray-400">Created: {{ account.dateCreated }}</div>
|
||||
<div class="text-gray-400">Has Identity: {{ getAccountHasIdentity(account) ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">Has Mnemonic: {{ getAccountHasMnemonic(account) ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">
|
||||
Created: {{ account.dateCreated }}
|
||||
</div>
|
||||
<div class="text-gray-400">
|
||||
Has Identity:
|
||||
{{ getAccountHasIdentity(account) ? "Yes" : "No" }}
|
||||
</div>
|
||||
<div class="text-gray-400">
|
||||
Has Mnemonic:
|
||||
{{ getAccountHasMnemonic(account) ? "Yes" : "No" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -572,7 +587,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Unmodified Accounts ({{ comparison.differences.accounts.unmodified.length }}):
|
||||
Unmodified Accounts ({{
|
||||
comparison.differences.accounts.unmodified.length
|
||||
}}):
|
||||
</h4>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
@@ -583,23 +600,39 @@
|
||||
>
|
||||
<div class="font-medium">ID: {{ account.id }}</div>
|
||||
<div class="text-gray-500">{{ account.did }}</div>
|
||||
<div class="text-gray-400">Created: {{ account.dateCreated }}</div>
|
||||
<div class="text-gray-400">Has Identity: {{ getAccountHasIdentity(account) ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">Has Mnemonic: {{ getAccountHasMnemonic(account) ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">
|
||||
Created: {{ account.dateCreated }}
|
||||
</div>
|
||||
<div class="text-gray-400">
|
||||
Has Identity:
|
||||
{{ getAccountHasIdentity(account) ? "Yes" : "No" }}
|
||||
</div>
|
||||
<div class="text-gray-400">
|
||||
Has Mnemonic:
|
||||
{{ getAccountHasMnemonic(account) ? "Yes" : "No" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Keep Accounts -->
|
||||
<div
|
||||
v-if="comparison.differences.accounts.missing.filter(a => a).length > 0"
|
||||
v-if="
|
||||
comparison.differences.accounts.missing.filter((a) => a)
|
||||
.length > 0
|
||||
"
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Keep Accounts ({{ comparison.differences.accounts.missing.filter(a => a).length }}):
|
||||
Keep Accounts ({{
|
||||
comparison.differences.accounts.missing.filter((a) => a)
|
||||
.length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
v-for="did in comparison.differences.accounts.missing.filter(a => a)"
|
||||
v-for="did in comparison.differences.accounts.missing.filter(
|
||||
(a) => a,
|
||||
)"
|
||||
:key="did"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
@@ -675,9 +708,7 @@
|
||||
icon-name="trash"
|
||||
svg-class="h-5 w-5 text-red-600 mr-2"
|
||||
/>
|
||||
<span class="text-sm font-medium text-red-900"
|
||||
>Keep</span
|
||||
>
|
||||
<span class="text-sm font-medium text-red-900">Keep</span>
|
||||
</div>
|
||||
<span class="text-sm font-bold text-red-900">{{
|
||||
comparison.differences.settings.missing.length
|
||||
@@ -691,7 +722,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Add Settings ({{ comparison.differences.settings.added.length }}):
|
||||
Add Settings ({{
|
||||
comparison.differences.settings.added.length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
@@ -699,9 +732,13 @@
|
||||
:key="setting.id"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ getSettingDisplayName(setting) }}</div>
|
||||
<div class="font-medium">
|
||||
{{ getSettingDisplayName(setting) }}
|
||||
</div>
|
||||
<div class="text-gray-500">ID: {{ setting.id }}</div>
|
||||
<div class="text-gray-400">Registered: {{ setting.isRegistered ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">
|
||||
Registered: {{ setting.isRegistered ? "Yes" : "No" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -712,7 +749,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Modify Settings ({{ comparison.differences.settings.modified.length }}):
|
||||
Modify Settings ({{
|
||||
comparison.differences.settings.modified.length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
@@ -720,9 +759,13 @@
|
||||
:key="setting.id"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ getSettingDisplayName(setting) }}</div>
|
||||
<div class="font-medium">
|
||||
{{ getSettingDisplayName(setting) }}
|
||||
</div>
|
||||
<div class="text-gray-500">ID: {{ setting.id }}</div>
|
||||
<div class="text-gray-400">Registered: {{ setting.isRegistered ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">
|
||||
Registered: {{ setting.isRegistered ? "Yes" : "No" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -733,7 +776,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Unmodified Settings ({{ comparison.differences.settings.unmodified.length }}):
|
||||
Unmodified Settings ({{
|
||||
comparison.differences.settings.unmodified.length
|
||||
}}):
|
||||
</h4>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
@@ -742,29 +787,47 @@
|
||||
:key="setting.id"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ getSettingDisplayName(setting) }}</div>
|
||||
<div class="font-medium">
|
||||
{{ getSettingDisplayName(setting) }}
|
||||
</div>
|
||||
<div class="text-gray-500">ID: {{ setting.id }}</div>
|
||||
<div class="text-gray-400">Registered: {{ setting.isRegistered ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">
|
||||
Registered: {{ setting.isRegistered ? "Yes" : "No" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Keep Settings -->
|
||||
<div
|
||||
v-if="comparison.differences.settings.missing.filter(s => s.accountDid || s.activeDid).length > 0"
|
||||
v-if="
|
||||
comparison.differences.settings.missing.filter(
|
||||
(s) => s.accountDid || s.activeDid,
|
||||
).length > 0
|
||||
"
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Keep Settings ({{ comparison.differences.settings.missing.filter(s => s.accountDid || s.activeDid).length }}):
|
||||
Keep Settings ({{
|
||||
comparison.differences.settings.missing.filter(
|
||||
(s) => s.accountDid || s.activeDid,
|
||||
).length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
v-for="setting in comparison.differences.settings.missing.filter(s => s.accountDid || s.activeDid)"
|
||||
v-for="setting in comparison.differences.settings.missing.filter(
|
||||
(s) => s.accountDid || s.activeDid,
|
||||
)"
|
||||
:key="setting.id"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ getSettingDisplayName(setting) }}</div>
|
||||
<div class="font-medium">
|
||||
{{ getSettingDisplayName(setting) }}
|
||||
</div>
|
||||
<div class="text-gray-500">ID: {{ setting.id }}</div>
|
||||
<div class="text-gray-400">Registered: {{ setting.isRegistered ? 'Yes' : 'No' }}</div>
|
||||
<div class="text-gray-400">
|
||||
Registered: {{ setting.isRegistered ? "Yes" : "No" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -836,9 +899,7 @@
|
||||
icon-name="trash"
|
||||
svg-class="h-5 w-5 text-red-600 mr-2"
|
||||
/>
|
||||
<span class="text-sm font-medium text-red-900"
|
||||
>Keep</span
|
||||
>
|
||||
<span class="text-sm font-medium text-red-900">Keep</span>
|
||||
</div>
|
||||
<span class="text-sm font-bold text-red-900">{{
|
||||
comparison.differences.contacts.missing.length
|
||||
@@ -852,7 +913,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Add Contacts ({{ comparison.differences.contacts.added.length }}):
|
||||
Add Contacts ({{
|
||||
comparison.differences.contacts.added.length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
@@ -860,9 +923,13 @@
|
||||
:key="contact.did"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ contact.name || '<empty>' }}</div>
|
||||
<div class="font-medium">
|
||||
{{ contact.name || "(empty)" }}
|
||||
</div>
|
||||
<div class="text-gray-500">{{ contact.did }}</div>
|
||||
<div class="text-gray-400">{{ contact.contactMethods?.length || 0 }} contact methods</div>
|
||||
<div class="text-gray-400">
|
||||
{{ contact.contactMethods?.length || 0 }} contact methods
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -873,7 +940,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Modify Contacts ({{ comparison.differences.contacts.modified.length }}):
|
||||
Modify Contacts ({{
|
||||
comparison.differences.contacts.modified.length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
@@ -881,9 +950,13 @@
|
||||
:key="contact.did"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ contact.name || '<empty>' }}</div>
|
||||
<div class="font-medium">
|
||||
{{ contact.name || "(empty)" }}
|
||||
</div>
|
||||
<div class="text-gray-500">{{ contact.did }}</div>
|
||||
<div class="text-gray-400">{{ contact.contactMethods?.length || 0 }} contact methods</div>
|
||||
<div class="text-gray-400">
|
||||
{{ contact.contactMethods?.length || 0 }} contact methods
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -894,7 +967,9 @@
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Unmodified Contacts ({{ comparison.differences.contacts.unmodified.length }}):
|
||||
Unmodified Contacts ({{
|
||||
comparison.differences.contacts.unmodified.length
|
||||
}}):
|
||||
</h4>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
@@ -903,29 +978,45 @@
|
||||
:key="contact.did"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ contact.name || '<empty>' }}</div>
|
||||
<div class="font-medium">
|
||||
{{ contact.name || "(empty)" }}
|
||||
</div>
|
||||
<div class="text-gray-500">{{ contact.did }}</div>
|
||||
<div class="text-gray-400">{{ contact.contactMethods?.length || 0 }} contact methods</div>
|
||||
<div class="text-gray-400">
|
||||
{{ contact.contactMethods?.length || 0 }} contact methods
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Keep Contacts -->
|
||||
<div
|
||||
v-if="comparison.differences.contacts.missing.filter(c => c.did).length > 0"
|
||||
v-if="
|
||||
comparison.differences.contacts.missing.filter((c) => c.did)
|
||||
.length > 0
|
||||
"
|
||||
class="mt-4"
|
||||
>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-2">
|
||||
Keep Contacts ({{ comparison.differences.contacts.missing.filter(c => c.did).length }}):
|
||||
Keep Contacts ({{
|
||||
comparison.differences.contacts.missing.filter((c) => c.did)
|
||||
.length
|
||||
}}):
|
||||
</h4>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
v-for="contact in comparison.differences.contacts.missing.filter(c => c.did)"
|
||||
v-for="contact in comparison.differences.contacts.missing.filter(
|
||||
(c) => c.did,
|
||||
)"
|
||||
:key="contact.did"
|
||||
class="text-xs text-gray-600 bg-gray-50 p-2 rounded"
|
||||
>
|
||||
<div class="font-medium">{{ contact.name || '<empty>' }}</div>
|
||||
<div class="font-medium">
|
||||
{{ contact.name || "(empty)" }}
|
||||
</div>
|
||||
<div class="text-gray-500">{{ contact.did }}</div>
|
||||
<div class="text-gray-400">{{ contact.contactMethods?.length || 0 }} contact methods</div>
|
||||
<div class="text-gray-400">
|
||||
{{ contact.contactMethods?.length || 0 }} contact methods
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -939,8 +1030,8 @@
|
||||
<div v-if="exportedData" class="mt-4 space-y-6">
|
||||
<h2>Exported Data</h2>
|
||||
<span
|
||||
v-on:click="copyToClipboard"
|
||||
class="text-blue-500 cursor-pointer hover:text-blue-700"
|
||||
@click="copyToClipboard"
|
||||
>
|
||||
Copy to Clipboard
|
||||
</span>
|
||||
@@ -1025,11 +1116,11 @@ export default class DatabaseMigration extends Vue {
|
||||
if (setting.type && setting.did) {
|
||||
return `${setting.type} (${setting.did})`;
|
||||
}
|
||||
|
||||
|
||||
// Handle live comparison data (has 'activeDid' or 'accountDid' fields)
|
||||
const did = setting.activeDid || setting.accountDid;
|
||||
const type = setting.id === 1 ? 'master' : 'account';
|
||||
return `${type} (${did || 'no DID'})`;
|
||||
const type = setting.id === 1 ? "master" : "account";
|
||||
return `${type} (${did || "no DID"})`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1044,7 +1135,7 @@ export default class DatabaseMigration extends Vue {
|
||||
if (account.hasIdentity !== undefined) {
|
||||
return account.hasIdentity;
|
||||
}
|
||||
|
||||
|
||||
// Handle live comparison data (has 'identity' field)
|
||||
return !!account.identity;
|
||||
}
|
||||
@@ -1061,7 +1152,7 @@ export default class DatabaseMigration extends Vue {
|
||||
if (account.hasMnemonic !== undefined) {
|
||||
return account.hasMnemonic;
|
||||
}
|
||||
|
||||
|
||||
// Handle live comparison data (has 'mnemonic' field)
|
||||
return !!account.mnemonic;
|
||||
}
|
||||
@@ -1071,17 +1162,19 @@ export default class DatabaseMigration extends Vue {
|
||||
*/
|
||||
async copyToClipboard(): Promise<void> {
|
||||
if (!this.exportedData) return;
|
||||
|
||||
|
||||
try {
|
||||
await this.useClipboard().copy(JSON.stringify(this.exportedData, null, 2));
|
||||
await this.useClipboard().copy(
|
||||
JSON.stringify(this.exportedData, null, 2),
|
||||
);
|
||||
// Use global window object properly
|
||||
if (typeof window !== 'undefined') {
|
||||
window.alert('Copied to clipboard!');
|
||||
if (typeof window !== "undefined") {
|
||||
window.alert("Copied to clipboard!");
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('Failed to copy to clipboard:', error);
|
||||
if (typeof window !== 'undefined') {
|
||||
window.alert('Failed to copy to clipboard');
|
||||
logger.error("Failed to copy to clipboard:", error);
|
||||
if (typeof window !== "undefined") {
|
||||
window.alert("Failed to copy to clipboard");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1093,7 +1186,7 @@ export default class DatabaseMigration extends Vue {
|
||||
let primaryAccount;
|
||||
if (settings.length > 0) {
|
||||
const primaryDid = settings[0].activeDid;
|
||||
primaryAccount = accounts.find(acc => acc.did === primaryDid);
|
||||
primaryAccount = accounts.find((acc) => acc.did === primaryDid);
|
||||
if (!primaryAccount) {
|
||||
this.cannotfindMainAccount = true;
|
||||
// abort everything
|
||||
@@ -1121,7 +1214,7 @@ export default class DatabaseMigration extends Vue {
|
||||
this.exportedData = {
|
||||
accounts: await getDexieAccounts(),
|
||||
settings: await getDexieSettings(),
|
||||
contacts: await getDexieContacts()
|
||||
contacts: await getDexieContacts(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1334,15 +1427,15 @@ export default class DatabaseMigration extends Vue {
|
||||
const yamlData = generateComparisonYaml(this.comparison);
|
||||
const blob = new Blob([yamlData], { type: "application/json" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `database-comparison-${new Date().toISOString().split('T')[0]}.json`;
|
||||
a.download = `database-comparison-${new Date().toISOString().split("T")[0]}.json`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
|
||||
this.successMessage = "Comparison data exported successfully";
|
||||
logger.info("[DatabaseMigration] Comparison data exported successfully");
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user