To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 5934d71b authored by Sandro Lutz's avatar Sandro Lutz Committed by lic
Browse files

Fix issues with non-visible pinned event item

parent 24d2dbd6
......@@ -4,7 +4,7 @@ import ExpansionPanel from 'amiv-web-ui-components/src/expansionPanel';
import Spinner from 'amiv-web-ui-components/src/spinner';
import logos from '../../images/logos';
import { i18n, formatDateDuration } from '../../models/language';
import { EventController } from '../../models/events';
import { Event, EventController } from '../../models/events';
import { FilteredListPage, FilteredListDataStore } from '../filteredListPage';
import EventCalendar from './eventCalendar';
......@@ -167,7 +167,7 @@ export default class EventList extends FilteredListPage {
// eslint-disable-next-line class-methods-use-this
_renderItem(event, list, selectedId) {
if (!event) return m('');
if (list === 'calendar') {
if (list === 'calendar' || !(event instanceof Event)) {
return event;
}
......
......@@ -160,7 +160,13 @@ export class FilteredListPage {
this.dataStore.shouldScroll = false;
}
if (itemId && !this._isItemLoaded(itemId)) {
if (
itemId &&
!this._isItemLoaded(itemId) &&
(!this.dataStore.pinnedItem ||
!this.dataStore.pinnedItem.item ||
this.dataStore.pinnedItem.item._id !== itemId)
) {
this.dataStore.pinnedItem = { loading: true };
this._loadItem(itemId)
.then(item => {
......@@ -481,11 +487,18 @@ export class FilteredListPage {
let pinnedList;
if (this.dataStore.pinnedItem && !this.dataStore.pinnedItem.loading) {
pinnedList = this._renderList({
name: this.constructor.pinnedListIdentifier,
items: [this.dataStore.pinnedItem.item],
});
if (this.dataStore.pinnedItem) {
if (this.dataStore.pinnedItem.loading) {
pinnedList = this._renderList({
name: this.constructor.pinnedListIdentifier,
items: [m('div.loading', m(Spinner, { show: true, size: '96px' }))],
});
} else {
pinnedList = this._renderList({
name: this.constructor.pinnedListIdentifier,
items: [this.dataStore.pinnedItem.item],
});
}
}
let fullPageMessage;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment