mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 10:29:42 +00:00
Add attachments to workflow
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { fetchResults } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/generic_doc";
|
||||
|
||||
export function fetch_generic_docs_by_accompanying_period(
|
||||
periodId: number,
|
||||
): Promise<GenericDocForAccompanyingPeriod[]> {
|
||||
return fetchResults(
|
||||
`/api/1.0/doc-store/generic-doc/by-period/${periodId}/index`,
|
||||
);
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
import { _createI18n } from "../../../../../ChillMainBundle/Resources/public/vuejs/_js/i18n";
|
||||
import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
|
||||
import DocumentActionButtonsGroup from "../../vuejs/DocumentActionButtonsGroup.vue";
|
||||
import { createApp } from "vue";
|
||||
import { StoredObject, StoredObjectStatusChange } from "../../types";
|
||||
|
@@ -0,0 +1,71 @@
|
||||
import { DateTime } from "ChillMainAssets/types";
|
||||
import { StoredObject } from "ChillDocStoreAssets/types/index";
|
||||
|
||||
export interface GenericDocMetadata {
|
||||
isPresent: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty metadata for a GenericDoc
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface EmptyMetadata extends GenericDocMetadata {}
|
||||
|
||||
/**
|
||||
* Minimal Metadata for a GenericDoc with a normalizer
|
||||
*/
|
||||
export interface BaseMetadata extends GenericDocMetadata {
|
||||
title: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A generic doc is a document attached to a Person or an AccompanyingPeriod.
|
||||
*/
|
||||
export interface GenericDoc {
|
||||
type: "doc_store_generic_doc";
|
||||
uniqueKey: string;
|
||||
key: string;
|
||||
identifiers: object;
|
||||
context: "person" | "accompanying-period";
|
||||
doc_date: DateTime;
|
||||
metadata: GenericDocMetadata;
|
||||
storedObject: StoredObject | null;
|
||||
}
|
||||
|
||||
export interface GenericDocForAccompanyingPeriod extends GenericDoc {
|
||||
context: "accompanying-period";
|
||||
}
|
||||
|
||||
interface BaseMetadataWithHtml extends BaseMetadata {
|
||||
html: string;
|
||||
}
|
||||
|
||||
export interface GenericDocForAccompanyingCourseDocument
|
||||
extends GenericDocForAccompanyingPeriod {
|
||||
key: "accompanying_course_document";
|
||||
metadata: BaseMetadataWithHtml;
|
||||
}
|
||||
|
||||
export interface GenericDocForAccompanyingCourseActivityDocument
|
||||
extends GenericDocForAccompanyingPeriod {
|
||||
key: "accompanying_course_activity_document";
|
||||
metadata: BaseMetadataWithHtml;
|
||||
}
|
||||
|
||||
export interface GenericDocForAccompanyingCourseCalendarDocument
|
||||
extends GenericDocForAccompanyingPeriod {
|
||||
key: "accompanying_course_calendar_document";
|
||||
metadata: BaseMetadataWithHtml;
|
||||
}
|
||||
|
||||
export interface GenericDocForAccompanyingCoursePersonDocument
|
||||
extends GenericDocForAccompanyingPeriod {
|
||||
key: "person_document";
|
||||
metadata: BaseMetadataWithHtml;
|
||||
}
|
||||
|
||||
export interface GenericDocForAccompanyingCourseWorkEvaluationDocument
|
||||
extends GenericDocForAccompanyingPeriod {
|
||||
key: "accompanying_period_work_evaluation_document";
|
||||
metadata: BaseMetadataWithHtml;
|
||||
}
|
@@ -1,8 +1,5 @@
|
||||
import {
|
||||
DateTime,
|
||||
User,
|
||||
} from "../../../ChillMainBundle/Resources/public/types";
|
||||
import { SignedUrlGet } from "./vuejs/StoredObjectButton/helpers";
|
||||
import { DateTime, User } from "ChillMainAssets/types";
|
||||
import { SignedUrlGet } from "ChillDocStoreAssets/vuejs/StoredObjectButton/helpers";
|
||||
|
||||
export type StoredObjectStatus = "empty" | "ready" | "failure" | "pending";
|
||||
|
||||
@@ -138,3 +135,10 @@ export interface ZoomLevel {
|
||||
nl?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GenericDoc {
|
||||
type: "doc_store_generic_doc";
|
||||
key: string;
|
||||
context: "person" | "accompanying-period";
|
||||
doc_date: DateTime;
|
||||
}
|
@@ -66,7 +66,7 @@ const open_button = ref<HTMLAnchorElement | null>(null);
|
||||
function buildDocumentName(): string {
|
||||
let document_name = props.filename ?? props.storedObject.title;
|
||||
|
||||
if ("" === document_name) {
|
||||
if ("" === document_name || null === document_name) {
|
||||
document_name = "document";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user