Merge branch 'milestone/ff-admin-unit' into unit/#70-build-ui-demo

This commit is contained in:
Julian Krauser 2025-04-11 11:14:18 +02:00
commit 00fad29b25
18 changed files with 219 additions and 43 deletions

View file

@ -45,6 +45,14 @@ export const useNewsletterPrintoutStore = defineStore("newsletterPrintout", {
responseType: "blob",
});
},
fetchNewsletterPrintReceivers(): Promise<AxiosResponse<any, any>> {
const newsletterId = useNewsletterStore().activeNewsletter;
return http.get(`/admin/newsletter/${newsletterId}/printrecipients`);
},
fetchNewsletterMailReceivers(): Promise<AxiosResponse<any, any>> {
const newsletterId = useNewsletterStore().activeNewsletter;
return http.get(`/admin/newsletter/${newsletterId}/mailrecipients`);
},
createNewsletterMailPreview() {
this.sendingPreview = "loading";
const newsletterId = useNewsletterStore().activeNewsletter;
@ -116,7 +124,7 @@ export const useNewsletterPrintoutStore = defineStore("newsletterPrintout", {
chunk.split("//").forEach((r) => {
if (r.trim() != "") {
let data = JSON.parse(r);
this.pdfSourceMessages.push(data);
this.pdfSourceMessages.unshift(data);
let type: NotificationType = "info";
let timeout = undefined;
if (data.factor == "failed") {
@ -138,7 +146,7 @@ export const useNewsletterPrintoutStore = defineStore("newsletterPrintout", {
chunk.split("//").forEach((r) => {
if (r.trim() != "") {
let data = JSON.parse(r);
this.mailSourceMessages.push(data);
this.mailSourceMessages.unshift(data);
let type: NotificationType = "info";
let timeout = undefined;
if (data.factor == "failed") {

View file

@ -21,7 +21,10 @@ export const useProtocolAgendaStore = defineStore("protocolAgenda", {
},
getters: {
detectedChangeProtocolAgenda: (state) =>
!isEqual(state.origin, state.agenda) && state.syncingProtocolAgenda != "syncing",
!isEqual(
state.origin.sort((a, b) => a.id - b.id),
state.agenda.sort((a, b) => a.id - b.id)
) && state.syncingProtocolAgenda != "syncing",
},
actions: {
setProtocolAgendaSyncingState(state: "synced" | "syncing" | "detectedChanges" | "failed") {

View file

@ -22,7 +22,10 @@ export const useProtocolDecisionStore = defineStore("protocolDecision", {
},
getters: {
detectedChangeProtocolDecision: (state) =>
!isEqual(state.origin, state.decision) && state.syncingProtocolDecision != "syncing",
!isEqual(
state.origin.sort((a, b) => a.id - b.id),
state.decision.sort((a, b) => a.id - b.id)
) && state.syncingProtocolDecision != "syncing",
},
actions: {
setProtocolDecisionSyncingState(state: "synced" | "syncing" | "detectedChanges" | "failed") {

View file

@ -22,7 +22,10 @@ export const useProtocolVotingStore = defineStore("protocolVoting", {
},
getters: {
detectedChangeProtocolVoting: (state) =>
!isEqual(state.origin, state.voting) && state.syncingProtocolVoting != "syncing",
!isEqual(
state.origin.sort((a, b) => a.id - b.id),
state.voting.sort((a, b) => a.id - b.id)
) && state.syncingProtocolVoting != "syncing",
},
actions: {
setProtocolVotingSyncingState(state: "synced" | "syncing" | "detectedChanges" | "failed") {

View file

@ -13,8 +13,7 @@ export const useQueryBuilderStore = defineStore("queryBuilder", {
loadingData: "fetched" as "loading" | "fetched" | "failed",
queryError: "" as string | { sql: string; code: string; msg: string },
query: undefined as undefined | DynamicQueryStructure | string,
activeQueryId: undefined as undefined | number,
isLoadedQuery: undefined as undefined | number,
activeQueryId: undefined as undefined | string,
};
},
actions: {

View file

@ -31,7 +31,7 @@ export const useQueryStoreStore = defineStore("queryStore", {
this.loading = "failed";
});
},
fetchQueryById(id: number): Promise<AxiosResponse<any, any>> {
fetchQueryById(id: string): Promise<AxiosResponse<any, any>> {
return http.get(`/admin/querystore/${id}`);
},
triggerSave() {