Skip to content

Commit 2a8cd3a

Browse files
committed
Remove feeds
Feeds have been removed from Opencast since sometime in version 16 (see opencast/opencast#6024). Therefore we can remove them from the admin interface as well.
1 parent 9511948 commit 2a8cd3a

6 files changed

Lines changed: 0 additions & 125 deletions

File tree

src/components/events/partials/EventActionCell.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { EventDetailsPage } from "./modals/EventDetails";
99
import { useAppDispatch, useAppSelector } from "../../../store";
1010
import {
1111
fetchSeriesDetailsAcls,
12-
fetchSeriesDetailsFeeds,
1312
fetchSeriesDetailsMetadata,
1413
fetchSeriesDetailsTheme,
1514
fetchSeriesDetailsThemeNames,
@@ -63,7 +62,6 @@ const EventActionCell = ({
6362
if (!!row.series) {
6463
await dispatch(fetchSeriesDetailsMetadata(row.series.id));
6564
await dispatch(fetchSeriesDetailsAcls(row.series.id));
66-
await dispatch(fetchSeriesDetailsFeeds(row.series.id));
6765
await dispatch(fetchSeriesDetailsTheme(row.series.id));
6866
await dispatch(fetchSeriesDetailsThemeNames());
6967

src/components/events/partials/ModalTabsAndPages/SeriesDetailsFeedsTab.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/components/events/partials/SeriesActionsCell.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import SeriesDetailsModal from "./modals/SeriesDetailsModal";
55
import {
66
fetchSeriesDetailsThemeNames,
77
fetchSeriesDetailsAcls,
8-
fetchSeriesDetailsFeeds,
98
fetchSeriesDetailsMetadata,
109
fetchSeriesDetailsTheme,
1110
fetchSeriesDetailsTobira,
@@ -64,7 +63,6 @@ const SeriesActionsCell = ({
6463
const showSeriesDetailsModal = async () => {
6564
await dispatch(fetchSeriesDetailsMetadata(row.id));
6665
await dispatch(fetchSeriesDetailsAcls(row.id));
67-
await dispatch(fetchSeriesDetailsFeeds(row.id));
6866
await dispatch(fetchSeriesDetailsTheme(row.id));
6967
await dispatch(fetchSeriesDetailsThemeNames());
7068
await dispatch(fetchSeriesDetailsTobira(row.id));

src/components/events/partials/modals/SeriesDetails.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useTranslation } from "react-i18next";
33
import cn from "classnames";
44
import {
55
getSeriesDetailsExtendedMetadata,
6-
getSeriesDetailsFeeds,
76
getSeriesDetailsMetadata,
87
getSeriesDetailsTheme,
98
getSeriesDetailsThemeNames,
@@ -16,7 +15,6 @@ import { hasAccess } from "../../../../utils/utils";
1615
import SeriesDetailsAccessTab from "../ModalTabsAndPages/SeriesDetailsAccessTab";
1716
import SeriesDetailsThemeTab from "../ModalTabsAndPages/SeriesDetailsThemeTab";
1817
import SeriesDetailsStatisticTab from "../ModalTabsAndPages/SeriesDetailsStatisticTab";
19-
import SeriesDetailsFeedsTab from "../ModalTabsAndPages/SeriesDetailsFeedsTab";
2018
import DetailsMetadataTab from "../ModalTabsAndPages/DetailsMetadataTab";
2119
import DetailsExtendedMetadataTab from "../ModalTabsAndPages/DetailsExtendedMetadataTab";
2220
import { useAppDispatch, useAppSelector } from "../../../../store";
@@ -45,7 +43,6 @@ const SeriesDetails = ({
4543
const dispatch = useAppDispatch();
4644

4745
const extendedMetadata = useAppSelector(state => getSeriesDetailsExtendedMetadata(state));
48-
const feeds = useAppSelector(state => getSeriesDetailsFeeds(state));
4946
const metadataFields = useAppSelector(state => getSeriesDetailsMetadata(state));
5047
const theme = useAppSelector(state => getSeriesDetailsTheme(state));
5148
const themeNames = useAppSelector(state => getSeriesDetailsThemeNames(state));
@@ -121,11 +118,6 @@ const SeriesDetails = ({
121118
{t(tab.tabNameTranslation)}
122119
</button>
123120
))}
124-
{feeds.length > 0 && (
125-
<button className={"button-like-anchor " + cn({ active: page === 6 })} onClick={() => openTab(6)}>
126-
{"Feeds"}
127-
</button>
128-
)}
129121
</nav>
130122

131123
{/* render modal content depending on current page */}
@@ -174,7 +166,6 @@ const SeriesDetails = ({
174166
header={tabs[page].tabNameTranslation}
175167
/>
176168
)}
177-
{page === 6 && <SeriesDetailsFeedsTab feeds={feeds} />}
178169
</div>
179170
</>
180171
);

src/selectors/seriesDetailsSelectors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { RootState } from "../store";
66
export const getSeriesDetailsMetadata = (state: RootState) => state.seriesDetails.metadata;
77
export const getSeriesDetailsExtendedMetadata = (state: RootState) => state.seriesDetails.extendedMetadata;
88
export const getSeriesDetailsAcl = (state: RootState) => state.seriesDetails.acl;
9-
export const getSeriesDetailsFeeds = (state: RootState) => state.seriesDetails.feeds;
109
export const getSeriesDetailsTheme = (state: RootState) => state.seriesDetails.theme;
1110
export const getSeriesDetailsThemeNames = (state: RootState) =>
1211
state.seriesDetails.themeNames;

src/slices/seriesDetailsSlice.ts

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ import { handleTobiraError } from './shared/tobiraErrors';
2929
/**
3030
* This file contains redux reducer for actions affecting the state of a series
3131
*/
32-
export type Feed = {
33-
link: string,
34-
type: string,
35-
version: string,
36-
}
37-
3832
export type TobiraData = {
3933
baseURL: string,
4034
hostPages: TobiraPage[],
@@ -45,8 +39,6 @@ type SeriesDetailsState = {
4539
errorMetadata: SerializedError | null,
4640
statusAcl: 'uninitialized' | 'loading' | 'succeeded' | 'failed',
4741
errorAcl: SerializedError | null,
48-
statusFeeds: 'uninitialized' | 'loading' | 'succeeded' | 'failed',
49-
errorFeeds: SerializedError | null,
5042
statusTheme: 'uninitialized' | 'loading' | 'succeeded' | 'failed',
5143
errorTheme: SerializedError | null,
5244
statusThemeNames: 'uninitialized' | 'loading' | 'succeeded' | 'failed',
@@ -59,7 +51,6 @@ type SeriesDetailsState = {
5951
errorTobiraData: SerializedError | null,
6052
metadata: MetadataCatalog,
6153
extendedMetadata: MetadataCatalog[],
62-
feeds: Feed[],
6354
acl: TransformedAcl[],
6455
theme: string,
6556
themeNames: { id: string, value: string }[],
@@ -76,8 +67,6 @@ const initialState: SeriesDetailsState = {
7667
errorMetadata: null,
7768
statusAcl: 'uninitialized',
7869
errorAcl: null,
79-
statusFeeds: 'uninitialized',
80-
errorFeeds: null,
8170
statusTheme: 'uninitialized',
8271
errorTheme: null,
8372
statusThemeNames: 'uninitialized',
@@ -94,7 +83,6 @@ const initialState: SeriesDetailsState = {
9483
fields: [],
9584
},
9685
extendedMetadata: [],
97-
feeds: [],
9886
acl: [],
9987
theme: "",
10088
themeNames: [],
@@ -172,45 +160,6 @@ export const fetchSeriesDetailsAcls = createAppAsyncThunk('seriesDetails/fetchSe
172160
return seriesAcls;
173161
});
174162

175-
// fetch feeds of certain series from server
176-
export const fetchSeriesDetailsFeeds = createAppAsyncThunk('seriesDetails/fetchSeriesDetailsFeeds', async (id: string) => {
177-
const res = await axios.get("/admin-ng/feeds/feeds");
178-
const feedsResponse = res.data;
179-
180-
let seriesFeeds: any[] = [];
181-
for (let i = 0; i < feedsResponse.length; i++) {
182-
if (feedsResponse[i].name === "Series") {
183-
let pattern =
184-
feedsResponse[i].identifier.split("/series")[0] +
185-
feedsResponse[i].pattern;
186-
let uidLink = pattern.split("<series_id>")[0] + id;
187-
let typeLink = uidLink.split("<type>");
188-
let versionLink = typeLink[1].split("<version>");
189-
seriesFeeds = [
190-
{
191-
type: "atom",
192-
version: "0.3",
193-
link:
194-
typeLink[0] + "atom" + versionLink[0] + "0.3" + versionLink[1],
195-
},
196-
{
197-
type: "atom",
198-
version: "1.0",
199-
link:
200-
typeLink[0] + "atom" + versionLink[0] + "1.0" + versionLink[1],
201-
},
202-
{
203-
type: "rss",
204-
version: "2.0",
205-
link: typeLink[0] + "rss" + versionLink[0] + "2.0" + versionLink[1],
206-
},
207-
];
208-
}
209-
}
210-
211-
return seriesFeeds;
212-
});
213-
214163
// fetch theme of certain series from server
215164
export const fetchSeriesDetailsTheme = createAppAsyncThunk('seriesDetails/fetchSeriesDetailsTheme', async (id: string) => {
216165
const res = await axios.get(`/admin-ng/series/${id}/theme.json`);
@@ -624,20 +573,6 @@ const seriesDetailsSlice = createSlice({
624573
state.statusAcl = 'failed';
625574
state.errorAcl = action.error;
626575
})
627-
.addCase(fetchSeriesDetailsFeeds.pending, (state) => {
628-
state.statusFeeds = 'loading';
629-
})
630-
.addCase(fetchSeriesDetailsFeeds.fulfilled, (state, action: PayloadAction<
631-
SeriesDetailsState["feeds"]
632-
>) => {
633-
state.statusFeeds = 'succeeded';
634-
const seriesDetailsFeeds = action.payload;
635-
state.feeds = seriesDetailsFeeds;
636-
})
637-
.addCase(fetchSeriesDetailsFeeds.rejected, (state, action) => {
638-
state.statusFeeds = 'failed';
639-
state.errorFeeds = action.error;
640-
})
641576
.addCase(fetchSeriesDetailsTheme.pending, (state) => {
642577
state.statusTheme = 'loading';
643578
})

0 commit comments

Comments
 (0)