Refactor media upload
Use Upload Media logic from Pleroma Backend changes for picture upload Move AS <-> Model conversion to separate module Front changes Downgrade apollo-client: https://github.com/Akryum/vue-apollo/issues/577 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { IPicture } from '@/types/picture.model';
|
||||
|
||||
export interface IActor {
|
||||
id?: string;
|
||||
url: string;
|
||||
@@ -6,13 +8,13 @@ export interface IActor {
|
||||
summary: string;
|
||||
preferredUsername: string;
|
||||
suspended: boolean;
|
||||
avatarUrl: string;
|
||||
bannerUrl: string;
|
||||
avatar: IPicture | null;
|
||||
banner: IPicture | null;
|
||||
}
|
||||
|
||||
export class Actor implements IActor {
|
||||
avatarUrl: string = '';
|
||||
bannerUrl: string = '';
|
||||
avatar: IPicture | null = null;
|
||||
banner: IPicture | null = null;
|
||||
domain: string | null = null;
|
||||
name: string = '';
|
||||
preferredUsername: string = '';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Actor, IActor } from './actor';
|
||||
import { IAddress } from '@/types/address.model';
|
||||
import { ITag } from '@/types/tag.model';
|
||||
import { IAbstractPicture, IPicture } from '@/types/picture.model';
|
||||
|
||||
export enum EventStatus {
|
||||
TENTATIVE,
|
||||
@@ -62,8 +64,7 @@ export interface IEvent {
|
||||
|
||||
joinOptions: EventJoinOptions;
|
||||
|
||||
thumbnail: string;
|
||||
largeImage: string;
|
||||
picture: IAbstractPicture|null;
|
||||
|
||||
organizerActor: IActor;
|
||||
attributedTo: IActor;
|
||||
@@ -84,12 +85,10 @@ export class EventModel implements IEvent {
|
||||
description: string = '';
|
||||
endsOn: Date = new Date();
|
||||
joinOptions: EventJoinOptions = EventJoinOptions.FREE;
|
||||
largeImage: string = '';
|
||||
local: boolean = true;
|
||||
participants: IParticipant[] = [];
|
||||
publishAt: Date = new Date();
|
||||
status: EventStatus = EventStatus.CONFIRMED;
|
||||
thumbnail: string = '';
|
||||
title: string = '';
|
||||
url: string = '';
|
||||
uuid: string = '';
|
||||
@@ -99,4 +98,5 @@ export class EventModel implements IEvent {
|
||||
relatedEvents: IEvent[] = [];
|
||||
onlineAddress: string = '';
|
||||
phoneAddress: string = '';
|
||||
picture: IAbstractPicture|null = null;
|
||||
}
|
||||
|
||||
16
js/src/types/picture.model.ts
Normal file
16
js/src/types/picture.model.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface IAbstractPicture {
|
||||
name;
|
||||
alt;
|
||||
}
|
||||
|
||||
export interface IPicture {
|
||||
url;
|
||||
name;
|
||||
alt;
|
||||
}
|
||||
|
||||
export interface IPictureUpload {
|
||||
file: File;
|
||||
name: String;
|
||||
alt: String|null;
|
||||
}
|
||||
Reference in New Issue
Block a user