|
@ -33,6 +33,20 @@ |
|
|
class="text-sm text-slate-500 ml-2 mb-1" |
|
|
class="text-sm text-slate-500 ml-2 mb-1" |
|
|
/> |
|
|
/> |
|
|
</button> |
|
|
</button> |
|
|
|
|
|
<button |
|
|
|
|
|
:title=" |
|
|
|
|
|
isStarred |
|
|
|
|
|
? 'Remove from starred projects' |
|
|
|
|
|
: 'Add to starred projects' |
|
|
|
|
|
" |
|
|
|
|
|
@click="toggleStar()" |
|
|
|
|
|
> |
|
|
|
|
|
<font-awesome |
|
|
|
|
|
:icon="isStarred ? 'star' : ['far', 'star']" |
|
|
|
|
|
:class="isStarred ? 'text-yellow-500' : 'text-slate-500'" |
|
|
|
|
|
class="text-sm ml-2 mb-1" |
|
|
|
|
|
/> |
|
|
|
|
|
</button> |
|
|
</h2> |
|
|
</h2> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -58,13 +72,13 @@ |
|
|
icon="user" |
|
|
icon="user" |
|
|
class="fa-fw text-slate-400" |
|
|
class="fa-fw text-slate-400" |
|
|
></font-awesome> |
|
|
></font-awesome> |
|
|
<span class="truncate inline-block max-w-[calc(100%-2rem)]"> |
|
|
<span class="truncate max-w-[calc(100%-2rem)] ml-1"> |
|
|
{{ issuerInfoObject?.displayName }} |
|
|
{{ issuerInfoObject?.displayName }} |
|
|
</span> |
|
|
</span> |
|
|
|
|
|
|
|
|
<span |
|
|
<span |
|
|
v-if="!serverUtil.isHiddenDid(issuer)" |
|
|
v-if="!serverUtil.isHiddenDid(issuer)" |
|
|
class="inline-flex items-center" |
|
|
class="inline-flex items-center ml-1" |
|
|
> |
|
|
> |
|
|
<router-link |
|
|
<router-link |
|
|
:to="{ |
|
|
:to="{ |
|
@ -593,6 +607,8 @@ |
|
|
import { AxiosError } from "axios"; |
|
|
import { AxiosError } from "axios"; |
|
|
import { Component, Vue } from "vue-facing-decorator"; |
|
|
import { Component, Vue } from "vue-facing-decorator"; |
|
|
import { Router } from "vue-router"; |
|
|
import { Router } from "vue-router"; |
|
|
|
|
|
import { useClipboard } from "@vueuse/core"; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
GenericVerifiableCredential, |
|
|
GenericVerifiableCredential, |
|
|
GenericCredWrapper, |
|
|
GenericCredWrapper, |
|
@ -603,25 +619,24 @@ import { |
|
|
PlanSummaryRecord, |
|
|
PlanSummaryRecord, |
|
|
} from "../interfaces"; |
|
|
} from "../interfaces"; |
|
|
import GiftedDialog from "../components/GiftedDialog.vue"; |
|
|
import GiftedDialog from "../components/GiftedDialog.vue"; |
|
|
|
|
|
import HiddenDidDialog from "../components/HiddenDidDialog.vue"; |
|
|
import OfferDialog from "../components/OfferDialog.vue"; |
|
|
import OfferDialog from "../components/OfferDialog.vue"; |
|
|
import TopMessage from "../components/TopMessage.vue"; |
|
|
import TopMessage from "../components/TopMessage.vue"; |
|
|
import QuickNav from "../components/QuickNav.vue"; |
|
|
import QuickNav from "../components/QuickNav.vue"; |
|
|
import EntityIcon from "../components/EntityIcon.vue"; |
|
|
import EntityIcon from "../components/EntityIcon.vue"; |
|
|
import ProjectIcon from "../components/ProjectIcon.vue"; |
|
|
import ProjectIcon from "../components/ProjectIcon.vue"; |
|
|
import { NotificationIface } from "../constants/app"; |
|
|
import { APP_SERVER, NotificationIface } from "../constants/app"; |
|
|
// Removed legacy logging import - migrated to PlatformServiceMixin |
|
|
import { UNNAMED_PROJECT } from "../constants/entities"; |
|
|
|
|
|
import { NOTIFY_CONFIRM_CLAIM } from "../constants/notifications"; |
|
|
|
|
|
import * as databaseUtil from "../db/databaseUtil"; |
|
|
import { Contact } from "../db/tables/contacts"; |
|
|
import { Contact } from "../db/tables/contacts"; |
|
|
import * as libsUtil from "../libs/util"; |
|
|
import * as libsUtil from "../libs/util"; |
|
|
import * as serverUtil from "../libs/endorserServer"; |
|
|
import * as serverUtil from "../libs/endorserServer"; |
|
|
import { retrieveAccountDids } from "../libs/util"; |
|
|
import { retrieveAccountDids } from "../libs/util"; |
|
|
import HiddenDidDialog from "../components/HiddenDidDialog.vue"; |
|
|
import { logger } from "@/utils/logger"; |
|
|
import { logger } from "../utils/logger"; |
|
|
|
|
|
import { useClipboard } from "@vueuse/core"; |
|
|
|
|
|
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin"; |
|
|
import { PlatformServiceMixin } from "@/utils/PlatformServiceMixin"; |
|
|
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify"; |
|
|
import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify"; |
|
|
import { NOTIFY_CONFIRM_CLAIM } from "@/constants/notifications"; |
|
|
|
|
|
import { APP_SERVER } from "@/constants/app"; |
|
|
|
|
|
import { UNNAMED_PROJECT } from "@/constants/entities"; |
|
|
|
|
|
/** |
|
|
/** |
|
|
* Project View Component |
|
|
* Project View Component |
|
|
* @author Matthew Raymer |
|
|
* @author Matthew Raymer |
|
@ -718,6 +733,8 @@ export default class ProjectViewView extends Vue { |
|
|
givesProvidedByHitLimit = false; |
|
|
givesProvidedByHitLimit = false; |
|
|
givesTotalsByUnit: Array<{ unit: string; amount: number }> = []; |
|
|
givesTotalsByUnit: Array<{ unit: string; amount: number }> = []; |
|
|
imageUrl = ""; |
|
|
imageUrl = ""; |
|
|
|
|
|
/** Whether this project is starred by the user */ |
|
|
|
|
|
isStarred = false; |
|
|
/** Project issuer DID */ |
|
|
/** Project issuer DID */ |
|
|
issuer = ""; |
|
|
issuer = ""; |
|
|
/** Cached issuer information */ |
|
|
/** Cached issuer information */ |
|
@ -805,6 +822,15 @@ export default class ProjectViewView extends Vue { |
|
|
} |
|
|
} |
|
|
this.loadProject(this.projectId, this.activeDid); |
|
|
this.loadProject(this.projectId, this.activeDid); |
|
|
this.loadTotals(); |
|
|
this.loadTotals(); |
|
|
|
|
|
|
|
|
|
|
|
// Check if this project is starred when settings are loaded |
|
|
|
|
|
if (this.projectId && settings.starredProjectIds) { |
|
|
|
|
|
const starredIds: string[] = databaseUtil.parseJsonField( |
|
|
|
|
|
settings.starredProjectIds, |
|
|
|
|
|
[], |
|
|
|
|
|
); |
|
|
|
|
|
this.isStarred = starredIds.includes(this.projectId); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1470,5 +1496,73 @@ export default class ProjectViewView extends Vue { |
|
|
this.givesTotalsByUnit.find((total) => total.unit === "HUR")?.amount || 0 |
|
|
this.givesTotalsByUnit.find((total) => total.unit === "HUR")?.amount || 0 |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Toggle the starred status of the current project |
|
|
|
|
|
*/ |
|
|
|
|
|
async toggleStar() { |
|
|
|
|
|
if (!this.projectId) return; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
if (!this.isStarred) { |
|
|
|
|
|
// Add to starred projects |
|
|
|
|
|
const settings = await databaseUtil.retrieveSettingsForActiveAccount(); |
|
|
|
|
|
const starredIds: string[] = databaseUtil.parseJsonField( |
|
|
|
|
|
settings.starredProjectIds, |
|
|
|
|
|
[], |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (!starredIds.includes(this.projectId)) { |
|
|
|
|
|
const newStarredIds = [...starredIds, this.projectId]; |
|
|
|
|
|
const newIdsParam = JSON.stringify(newStarredIds); |
|
|
|
|
|
const result = await databaseUtil.updateDidSpecificSettings( |
|
|
|
|
|
this.activeDid, |
|
|
|
|
|
// @ts-expect-error until we use SettingsWithJsonString properly |
|
|
|
|
|
{ starredProjectIds: newIdsParam }, |
|
|
|
|
|
); |
|
|
|
|
|
if (!result) { |
|
|
|
|
|
// eslint-disable-next-line no-console |
|
|
|
|
|
console.log( |
|
|
|
|
|
"Still getting a bad result from SQL update to star a project.", |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.isStarred = true; |
|
|
|
|
|
} else { |
|
|
|
|
|
// Remove from starred projects |
|
|
|
|
|
const settings = await databaseUtil.retrieveSettingsForActiveAccount(); |
|
|
|
|
|
const starredIds: string[] = databaseUtil.parseJsonField( |
|
|
|
|
|
settings.starredProjectIds, |
|
|
|
|
|
[], |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const updatedIds = starredIds.filter((id) => id !== this.projectId); |
|
|
|
|
|
const newIdsParam = JSON.stringify(updatedIds); |
|
|
|
|
|
const result = await databaseUtil.updateDidSpecificSettings( |
|
|
|
|
|
this.activeDid, |
|
|
|
|
|
// @ts-expect-error until we use SettingsWithJsonString properly |
|
|
|
|
|
{ starredProjectIds: newIdsParam }, |
|
|
|
|
|
); |
|
|
|
|
|
if (!result) { |
|
|
|
|
|
// eslint-disable-next-line no-console |
|
|
|
|
|
console.log( |
|
|
|
|
|
"Still getting a bad result from SQL update to unstar a project.", |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
this.isStarred = false; |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
logger.error("Error toggling star status:", error); |
|
|
|
|
|
this.$notify( |
|
|
|
|
|
{ |
|
|
|
|
|
group: "alert", |
|
|
|
|
|
type: "danger", |
|
|
|
|
|
title: "Error", |
|
|
|
|
|
text: "Failed to update starred status. Please try again.", |
|
|
|
|
|
}, |
|
|
|
|
|
3000, |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|