diff --git a/lib/Db/Option.php b/lib/Db/Option.php index 0e17f37d55..dcb6c31705 100644 --- a/lib/Db/Option.php +++ b/lib/Db/Option.php @@ -32,6 +32,10 @@ * @method void setReleased(int $value) * @method int getDeleted() * @method void setDeleted(int $value) + * @method int getCreated() + * @method void setCreated(int $value) + * @method ?string getDescription() + * @method void setDescription(?string $value) * * No magic getters, getters are overwritten for special handling of timestamp and option text * @method void setOrder(int $value) @@ -70,6 +74,7 @@ class Option extends EntityWithUser implements JsonSerializable { protected int $pollId = 0; protected string $pollOptionText = ''; protected string $pollOptionHash = ''; + protected ?string $description = ''; protected int $timestamp = 0; protected int $duration = 0; protected int $order = 0; @@ -79,6 +84,7 @@ class Option extends EntityWithUser implements JsonSerializable { protected string $owner = ''; protected int $released = 0; protected int $deleted = 0; + protected int $created = 0; // joined columns protected ?string $userVoteAnswer = ''; @@ -104,6 +110,7 @@ public function __construct() { $this->addType('duration', 'integer'); $this->addType('confirmed', 'integer'); $this->addType('deleted', 'integer'); + $this->addType('created', 'integer'); // joined Attributes $this->addType('optionLimit', 'integer'); diff --git a/lib/Migration/V9/TableSchema.php b/lib/Migration/V9/TableSchema.php index 53c8055994..1044edf230 100644 --- a/lib/Migration/V9/TableSchema.php +++ b/lib/Migration/V9/TableSchema.php @@ -272,6 +272,8 @@ abstract class TableSchema { 'owner' => ['type' => Types::STRING, 'options' => ['notnull' => true, 'default' => '', 'length' => 256]], 'released' => ['type' => Types::BIGINT, 'options' => ['notnull' => true, 'default' => 0, 'length' => 20]], 'deleted' => ['type' => Types::BIGINT, 'options' => ['notnull' => true, 'default' => 0, 'length' => 20]], + 'description' => ['type' => Types::TEXT, 'options' => ['notnull' => false, 'default' => null, 'length' => 65535]], + 'created' => ['type' => Types::BIGINT, 'options' => ['notnull' => true, 'default' => 0, 'length' => 20]], ], Vote::TABLE => [ 'id' => ['type' => Types::BIGINT, 'options' => ['autoincrement' => true, 'notnull' => true, 'length' => 20]], diff --git a/src/components/VoteTable/VoteTableText.vue b/src/components/VoteTable/VoteTableText.vue new file mode 100644 index 0000000000..09b79befde --- /dev/null +++ b/src/components/VoteTable/VoteTableText.vue @@ -0,0 +1,68 @@ + + + + + + + diff --git a/src/stores/options.ts b/src/stores/options.ts index e72bef59a8..c91b7ef55c 100644 --- a/src/stores/options.ts +++ b/src/stores/options.ts @@ -117,9 +117,7 @@ export const useOptionsStore = defineStore('options', { try { const response = await (() => { if (activeRoute.value.meta.publicPage) { - return PublicAPI.getOptions( - sessionStore.publicToken, - ) + return PublicAPI.getOptions(sessionStore.publicToken) } if (sessionStore.currentPollId) { return OptionsAPI.getOptions(sessionStore.currentPollId) diff --git a/src/stores/options.types.ts b/src/stores/options.types.ts index 1fa8513b19..f126636b63 100644 --- a/src/stores/options.types.ts +++ b/src/stores/options.types.ts @@ -32,7 +32,9 @@ export type OptionDto = { id: number pollId: number text: string + description: string isoTimestamp: string | null | undefined + created: number deleted: number order: number confirmed: number diff --git a/src/views/Vote.vue b/src/views/Vote.vue index 6ecd19815d..30f82cd7c4 100644 --- a/src/views/Vote.vue +++ b/src/views/Vote.vue @@ -34,6 +34,7 @@ import { usePreferencesStore } from '../stores/preferences' import { useVotesStore } from '../stores/votes' import type { CollapsibleProps } from '../components/Base/modules/Collapsible.vue' import { Event } from '../Types' +import VoteTableText from '@/components/VoteTable/VoteTableText.vue' const pollStore = usePollStore() const optionsStore = useOptionsStore() @@ -202,7 +203,12 @@ const appClass = computed(() => [ v-model="tableObserverVisible" /> + +