Merge branch 'master' into split_build_process
fix: image server references and test configurations - Update image server references to use test server by default for local dev - Fix registration status checks in tests - Remove verbose console logging - Update environment configurations for consistent image server usage - Fix alert handling in contact registration tests - Clean up component lifecycle logging - Add clarifying comments about shared image server usage - Update playwright test configurations for better reliability This commit ensures consistent image server behavior across environments and improves test reliability by properly handling registration status checks and alerts.
This commit is contained in:
@@ -71,17 +71,17 @@
|
||||
|
||||
<textarea
|
||||
placeholder="Description"
|
||||
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
|
||||
class="block w-full rounded border border-slate-400 px-3 py-2"
|
||||
rows="5"
|
||||
v-model="fullClaim.description"
|
||||
maxlength="5000"
|
||||
></textarea>
|
||||
<div class="text-xs text-slate-500 italic -mt-3 mb-4">
|
||||
<div class="text-xs text-slate-500 italic">
|
||||
If you want to be contacted, be sure to include your contact information
|
||||
-- just remember that this information is public and saved in a public
|
||||
history.
|
||||
</div>
|
||||
<div class="text-xs text-slate-500 italic -mt-3 mb-4">
|
||||
<div class="text-xs text-slate-500 italic">
|
||||
{{ fullClaim.description?.length }}/5000 max. characters
|
||||
</div>
|
||||
|
||||
@@ -89,28 +89,55 @@
|
||||
v-model="fullClaim.url"
|
||||
placeholder="Website"
|
||||
autocapitalize="none"
|
||||
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
|
||||
class="block w-full rounded border border-slate-400 mt-4 px-3 py-2"
|
||||
/>
|
||||
|
||||
<div class="flex mb-4 columns-3 w-full">
|
||||
<input
|
||||
v-model="startDateInput"
|
||||
placeholder="Start Date"
|
||||
type="date"
|
||||
class="col-span-1 w-full rounded border border-slate-400 px-3 py-2"
|
||||
/>
|
||||
<input
|
||||
:disabled="!startDateInput"
|
||||
placeholder="Start Time"
|
||||
v-model="startTimeInput"
|
||||
type="time"
|
||||
class="col-span-1 w-full rounded border border-slate-400 ml-2 px-3 py-2"
|
||||
/>
|
||||
<span class="col-span-1 w-full flex justify-center">{{ zoneName }}</span>
|
||||
<div>
|
||||
<div class="flex items-center mt-4">
|
||||
<span class="mr-2">Starts At</span>
|
||||
<input
|
||||
v-model="startDateInput"
|
||||
placeholder="Start Date"
|
||||
type="date"
|
||||
class="rounded border border-slate-400 px-3 py-2"
|
||||
/>
|
||||
<input
|
||||
:disabled="!startDateInput"
|
||||
placeholder="Start Time"
|
||||
v-model="startTimeInput"
|
||||
type="time"
|
||||
class="rounded border border-slate-400 ml-2 px-3 py-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex w-full justify-end items-center">
|
||||
<span class="w-full flex justify-end items-center">
|
||||
{{ zoneName }} time zone
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center">
|
||||
<div class="mr-2">
|
||||
<span>Ends at</span>
|
||||
</div>
|
||||
<input
|
||||
v-model="endDateInput"
|
||||
placeholder="End Date"
|
||||
type="date"
|
||||
class="ml-2 rounded border border-slate-400 px-3 py-2"
|
||||
/>
|
||||
<input
|
||||
:disabled="!endDateInput"
|
||||
placeholder="End Time"
|
||||
v-model="endTimeInput"
|
||||
type="time"
|
||||
class="rounded border border-slate-400 ml-2 px-3 py-2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex items-center mb-4"
|
||||
class="flex items-center mt-4"
|
||||
@click="includeLocation = !includeLocation"
|
||||
>
|
||||
<input type="checkbox" class="mr-2" v-model="includeLocation" />
|
||||
@@ -202,18 +229,10 @@
|
||||
import "leaflet/dist/leaflet.css";
|
||||
import { AxiosError, AxiosRequestHeaders } from "axios";
|
||||
import { DateTime } from "luxon";
|
||||
import { hexToBytes } from "@noble/hashes/utils";
|
||||
import { finalizeEvent, serializeEvent } from "nostr-tools";
|
||||
// these core imports could also be included as "import type ..."
|
||||
import {
|
||||
EventTemplate,
|
||||
UnsignedEvent,
|
||||
VerifiedEvent,
|
||||
} from "nostr-tools/lib/types/core";
|
||||
import {
|
||||
accountFromExtendedKey,
|
||||
extendedKeysFromSeedWords,
|
||||
} from "nostr-tools/nip06";
|
||||
import { finalizeEvent, serializeEvent } from "nostr-tools/pure";
|
||||
import { EventTemplate, UnsignedEvent, VerifiedEvent } from "nostr-tools/core";
|
||||
import * as nip06 from "nostr-tools/nip06";
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { LMap, LMarker, LTileLayer } from "@vue-leaflet/vue-leaflet";
|
||||
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
@@ -251,6 +270,8 @@ export default class NewEditProjectView extends Vue {
|
||||
activeDid = "";
|
||||
agentDid = "";
|
||||
apiServer = "";
|
||||
endDateInput?: string;
|
||||
endTimeInput?: string;
|
||||
errorMessage = "";
|
||||
fullClaim: PlanVerifiableCredential = {
|
||||
"@context": "https://schema.org",
|
||||
@@ -325,6 +346,13 @@ export default class NewEditProjectView extends Vue {
|
||||
this.startDateInput = localDateTime.toFormat("yyyy-MM-dd");
|
||||
this.startTimeInput = localDateTime.toFormat("HH:mm");
|
||||
}
|
||||
if (this.fullClaim.endTime) {
|
||||
const localDateTime = DateTime.fromISO(
|
||||
this.fullClaim.endTime as string,
|
||||
).toLocal();
|
||||
this.endDateInput = localDateTime.toFormat("yyyy-MM-dd");
|
||||
this.endTimeInput = localDateTime.toFormat("HH:mm");
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Got error retrieving that project", error);
|
||||
@@ -468,7 +496,7 @@ export default class NewEditProjectView extends Vue {
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Date Error",
|
||||
text: "The date was invalid so it was not set.",
|
||||
text: "The start date was invalid so it was not set.",
|
||||
},
|
||||
5000,
|
||||
);
|
||||
@@ -476,6 +504,28 @@ export default class NewEditProjectView extends Vue {
|
||||
} else {
|
||||
delete vcClaim.startTime;
|
||||
}
|
||||
if (this.endDateInput) {
|
||||
try {
|
||||
const endTimeFull = this.endTimeInput || "23:59:59";
|
||||
const fullTimeString = this.endDateInput + " " + endTimeFull;
|
||||
// throw an error on an invalid date or time string
|
||||
vcClaim.endTime = new Date(fullTimeString).toISOString(); // ensure timezone is part of it
|
||||
} catch {
|
||||
// it's not a valid date so erase it and tell the user
|
||||
delete vcClaim.endTime;
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
type: "danger",
|
||||
title: "Date Error",
|
||||
text: "The end date was invalid so it was not set.",
|
||||
},
|
||||
5000,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
delete vcClaim.endTime;
|
||||
}
|
||||
const vcJwt = await createEndorserJwtVcFromClaim(this.activeDid, vcClaim);
|
||||
|
||||
// Make the xhr request payload
|
||||
@@ -618,15 +668,15 @@ export default class NewEditProjectView extends Vue {
|
||||
// remove any trailing '
|
||||
const finalDerNumNoApostrophe = finalDerNum?.replace(/'/g, "");
|
||||
const accountNum = Number(finalDerNumNoApostrophe || 0);
|
||||
const extPubPri = extendedKeysFromSeedWords(
|
||||
const extPubPri = nip06.extendedKeysFromSeedWords(
|
||||
account?.mnemonic as string,
|
||||
"",
|
||||
accountNum,
|
||||
);
|
||||
const publicExtendedKey: string = extPubPri?.publicExtendedKey;
|
||||
const privateExtendedKey = extPubPri?.privateExtendedKey;
|
||||
const privateKey = accountFromExtendedKey(privateExtendedKey).privateKey;
|
||||
const privateBytes = hexToBytes(privateKey);
|
||||
const privateBytes: Uint8Array =
|
||||
nip06.accountFromExtendedKey(privateExtendedKey).privateKey;
|
||||
// No real content is necessary, we just want something signed,
|
||||
// so we might as well use nostr libs for nostr functions.
|
||||
// Besides: someday we may create real content that we can relay.
|
||||
@@ -660,7 +710,8 @@ export default class NewEditProjectView extends Vue {
|
||||
const endorserPartnerUrl = partnerServer + "/api/partner/link";
|
||||
const timeSafariUrl = window.location.origin + "/claim/" + jwtId;
|
||||
const content = this.fullClaim.name + " - see " + timeSafariUrl;
|
||||
const publicKeyHex = accountFromExtendedKey(publicExtendedKey).publicKey;
|
||||
const publicKeyHex =
|
||||
nip06.accountFromExtendedKey(publicExtendedKey).publicKey;
|
||||
const unsignedPayload: UnsignedEvent = {
|
||||
// why doesn't "...signedPayload" work?
|
||||
kind: signedPayload.kind,
|
||||
|
||||
Reference in New Issue
Block a user