CentreForDigitalHumanities / CentreForDigitalHumanities/Textcavator

Corpus 404 handling

Open
#1,576 0 comments 0 reactions 0 assignees View on GitHub
frontend good first issue
Dominant language
Python
Stars
12
Forks
3
Avg merge
3d 3m
Merged PRs (30d)
9

Description

When you navigate to a url like [ianalyzer.hum.uu.nl/search/not-a-real-corpus](https://ianalyzer.hum.uu.nl/search/not-a-real-corpus) you get redirected to the login screen, and an alert says "You do not have access to this corpus. Log in as an authorized user."

This always happens, regardless of whether the corpus exists or whether you are logged in or not.

While it is possible that an anonymous users can solve their problem by logging in, there are other scenarios where logging in would not solve the user's problem.

The redirect to the login screen is especially confusing if you are logged in already (as it suggests you are not).

In either case, if your account cannot access the corpus (because it does not exists or you are not authorised), logging in will not help. Also, after succesfully entering your credentials, you will be "stuck" in this screen; after logging in, you get redirected back the login screen again.

Suggestion:

Make an "Corpus not found" page with contents like:

> I-analyzer cannot find a corpus named "not-a-real-corpus". It's possible that this corpus does not exist, or that you do not have access to it. What do you want to do?
>
> - Sign in
> - View available corpora
> - Contact an administrator

Some notes:
- Obviously, the sign-in link should only be shown if the user is not signed in.
- "View available corpora" is just a link to `/`.
- "Contact an administrator" isn't an option we have right now. Perhaps we could have an optional item in `environment.ts` that says what such a link should direct to. We can hide the link if nothing is configured. In our case, the [CDH contact form](https://cdh.uu.nl/contact/) would be appropriate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the /search/not-a-real-corpus route and the current redirect to the login screen. Inspect environment.ts for the proposed optional administrator-contact link and the existing root (/) destination. Done means inaccessible or missing corpora show a dedicated page with the corpus name, conditional sign-in, a link to /, and an optional contact link.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.