Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the fallback logic of backup_url #1451

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions base-theme/layouts/partials/external_resource_link.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{{- $text := default .title .text -}}
{{- $href := default "" .external_url -}}
{{- $isBroken := default false .is_broken -}}
{{- $backupUrl := default "" .backup_url -}}
{{- $hasWarning := default true .has_external_license_warning -}}
{{- $className := printf "%s %s" "external-link" (default "" .class) -}}
{{- $onClick := "" -}}
Expand All @@ -10,9 +8,6 @@
{{/* Prevents external links from being clicked before corresponding JS is fully loaded. */}}
{{- $onClick = "event.preventDefault()" -}}
{{- end -}}
{{- if and $isBroken $backupUrl -}}
{{- $href = $backupUrl -}}
{{- end -}}
{{- if not (in $href "ocw.mit.edu") -}}
{{- partial "link" (dict
"href" $href
Expand Down

This file was deleted.

15 changes: 0 additions & 15 deletions tests-e2e/ocw-ci-test-course/external-resources.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,6 @@ test("External resource in page opens a new tab", async ({ page }) => {
)
})

test("Broken external resource opens backup_url", async ({ page }) => {
const course = new CoursePage(page, "course")
await course.goto("/pages/external-resources-page")

const link = page.getByRole("link", { name: "broken external resource" })

const targetAttribute = await link.getAttribute("target")
expect(targetAttribute).toBeNull()

const classAttribute = await link.getAttribute("class")
expect(classAttribute).toBeNull()

await link.click()
})

test("External resource opens confirmation modal", async ({ page }) => {
const course = new CoursePage(page, "course")
await course.goto("/pages/external-resources-page")
Expand Down
Loading