Compare commits

..

No commits in common. "a932cccfc007859f8ffcce3ae9126681c87d7dcf" and "732566a29c08d30101a343f79071bdaef4bfd901" have entirely different histories.

7 changed files with 4 additions and 43 deletions

View file

@ -11,12 +11,6 @@
:after="event.name"
:state
/>
<DiffFieldString
title="Timetable Name"
:before="event.serverTimetableName"
:after="event.timetableName"
:state
/>
<DiffFieldString
title="Host"
:before="event.serverHost"

View file

@ -9,7 +9,6 @@
<tr>
<th>id</th>
<th>name</th>
<th>timetableName</th>
<th>host</th>
<th>notice</th>
<th>description</th>
@ -33,13 +32,6 @@
v-model="event.name"
>
</td>
<td>
<input
type="text"
:disabled="!canEdit(event)"
v-model="event.timetableName"
>
</td>
<td>
<input
type="text"
@ -91,12 +83,6 @@
v-model="newEventName"
>
</td>
<td>
<input
type="text"
v-model="newEventShortName"
>
</td>
<td>
<input
type="text"
@ -143,7 +129,6 @@
>
<td>{{ event.id }}</td>
<td>{{ event.name }}</td>
<td>{{ event.timetableName }}</td>
<td>{{ event.host }}</td>
<td class="preWrap">{{ event.notice }}</td>
<td class="preWrap">{{ event.description }}</td>
@ -172,7 +157,6 @@ function canEdit(event: ClientScheduleEvent) {
}
const newEventName = ref("");
const newEventShortName = ref("");
const newEventHost = ref("");
const newEventNotice = ref("");
const newEventDescription = ref("");
@ -194,7 +178,6 @@ function newEvent() {
schedule.value,
schedule.value.nextClientId--,
newEventName.value,
newEventShortName.value,
!newEventPublic.value,
newEventHost.value,
false,
@ -206,7 +189,6 @@ function newEvent() {
);
schedule.value.events.add(event);
newEventName.value = "";
newEventShortName.value = "";
newEventHost.value = "";
newEventNotice.value = "";
newEventDescription.value = "";

View file

@ -106,7 +106,7 @@
:title="cell.event?.name"
>
{{ cell.event?.notice ? "⚠️" : undefined }}
{{ cell.event?.timetableName || cell.event?.name }}
{{ cell.event?.name }}
</td>
</tr>
</template>

View file

@ -89,7 +89,6 @@ export type ApiScheduleEventSlot = z.infer<typeof apiScheduleEventSlotSchema>;
export const apiScheduleEventSchema = defineApiEntity({
name: z.string(),
timetableName: z.optional(z.string()),
crew: z.optional(z.boolean()),
host: z.optional(z.string()),
cancelled: z.optional(z.boolean()),

View file

@ -19,10 +19,6 @@ export const useSchedulesStore = defineStore("schedules", () => {
pendingSyncs: ref<Map<number, SyncOperation>>(new Map()),
};
/* Expose schedules to the console on the client to make it easy to inspect and do scripted modifications. */
if (import.meta.client)
(window as any).owltideSchedules = state.schedules;
const getters = {
activeSchedule: computed(() => {
if (state.activeScheduleId.value === undefined)

View file

@ -21,10 +21,10 @@ function fixtureClientSchedule(multiSlot = false) {
const events = [
new ClientScheduleEvent(
1, now, false, "Up", "", false, "", false, "", "What's Up?", 0, new Set(multiSlot ? [1, 2] : [1]),
1, now, false, "Up", false, "", false, "", "What's Up?", 0, new Set(multiSlot ? [1, 2] : [1]),
),
new ClientScheduleEvent(
2, now, false, "Down", "", false, "", false, "", "", 0, new Set(multiSlot ? [] : [2]),
2, now, false, "Down", false, "", false, "", "", 0, new Set(multiSlot ? [] : [2]),
),
];
const eventSlots = idMap([
@ -174,7 +174,7 @@ describe("class ClientSchedule", () => {
],
[
"event",
(schedule) => ClientScheduleEvent.create(schedule, 3, "New location", "", false, "", false, "", "", 0, new Set(), { zone, locale })
(schedule) => ClientScheduleEvent.create(schedule, 3, "New location", false, "", false, "", "", 0, new Set(), { zone, locale })
],
[
"role",

View file

@ -133,7 +133,6 @@ export class ClientScheduleLocation extends ClientEntity<ApiScheduleLocation> {
export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
schedule!: ClientSchedule;
serverName: string;
serverTimetableName: string;
serverCrew: boolean;
serverHost: string;
serverCancelled: boolean;
@ -147,7 +146,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
updatedAt: DateTime,
deleted: boolean,
public name: string,
public timetableName: string,
public crew: boolean,
public host: string,
public cancelled: boolean,
@ -158,7 +156,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
) {
super(id, updatedAt, deleted);
this.serverName = name;
this.serverTimetableName = timetableName;
this.serverCrew = crew;
this.serverHost = host;
this.serverCancelled = cancelled;
@ -176,7 +173,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
return (
super.isModified()
|| this.name !== this.serverName
|| this.timetableName !== this.serverTimetableName
|| this.crew !== this.serverCrew
|| this.host !== this.serverHost
|| this.cancelled !== this.serverCancelled
@ -195,7 +191,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
this.updatedAt = this.serverUpdatedAt;;
this.deleted = this.serverDeleted;;
this.name = this.serverName;
this.timetableName = this.serverTimetableName;
this.crew = this.serverCrew;
this.host = this.serverHost;
this.cancelled = this.serverCancelled;
@ -215,7 +210,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
schedule: ClientSchedule,
id: Id,
name: string,
timetableName: string,
crew: boolean,
host: string,
cancelled: boolean,
@ -230,7 +224,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
DateTime.fromMillis(ClientEntity.newEntityMillis, opts),
false,
name,
timetableName,
crew,
host,
cancelled,
@ -252,7 +245,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
DateTime.fromISO(api.updatedAt, opts),
api.deleted ?? false,
api.name,
api.timetableName ?? "",
api.crew ?? false,
api.host ?? "",
api.cancelled ?? false,
@ -271,7 +263,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
this.serverUpdatedAt = DateTime.fromISO(api.updatedAt, opts);
this.serverDeleted = false;
this.serverName = api.name;
this.serverTimetableName = api.timetableName ?? "";
this.serverCrew = api.crew ?? false;
this.serverHost = api.host ?? "";
this.serverCancelled = api.cancelled ?? false;
@ -296,7 +287,6 @@ export class ClientScheduleEvent extends ClientEntity<ApiScheduleEvent> {
id: this.id,
updatedAt: toIso(this.updatedAt),
name: this.name,
timetableName: this.timetableName || undefined,
crew: this.crew || undefined,
host: this.host || undefined,
cancelled: this.cancelled || undefined,