Skip to content

Commit

Permalink
Merge pull request #292 from KTH/issues/KUI-1511-add-info-text-about-…
Browse files Browse the repository at this point in the history
…analysis-tool-deactivation

Issues/KUI-1511: add info text about analysis tool deactivation
  • Loading branch information
allazis authored Oct 8, 2024
2 parents dd6e00d + 419fca8 commit 8f6962e
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 14 deletions.
5 changes: 5 additions & 0 deletions i18n/messages.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ module.exports = {
courseDev_decs_p1:
'Publish course analysis and course data for a completed course offering or edit a published course analysis.',
courseDev_decs_p2: 'A published course analysis with course data is displayed on the page: Course development.',
courseDev_decs_alert_title: 'Please note!',
courseDev_decs_alert_p1:
'In mid-December 2024, this tool for publishing and editing course analysis and course data will be discontinued. Last use is for courses taken during period 1 in HT24. Thereafter, from period 2 in HT24, the course analysis is filled in and published in Canvas.',
courseDev_decs_alert_p2: 'Read about the new automated system in Canvas here:',
courseDev_decs_alert_p2_link: 'New IT system support for course evaluation and course analysis',
courseDev_btn_edit: 'Edit published',
courseDev_btn_new: 'Publish new',
},
Expand Down
5 changes: 5 additions & 0 deletions i18n/messages.se.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ module.exports = {
courseDev_decs_p1:
'Publicera kursanalys och kursdata för en avslutad kursomgång eller ändra en redan publicerad kursanalys.',
courseDev_decs_p2: 'Publicerade kursanalyser och kursdata visas på sidan: Kursens utveckling.',
courseDev_decs_alert_title: 'Observera!',
courseDev_decs_alert_p1:
'Under mitten av december 2024 avvecklas det här verktyget för publicering och redigering av kursanalyser och kursdata. Sista användning är för kurser som gått under period 1 i HT24. Efter det, från period 2 i HT24, fylls kursanalys i och publiceras i Canvas.',
courseDev_decs_alert_p2: 'Läs om det nya automatiserade systemet i Canvas här:',
courseDev_decs_alert_p2_link: 'Nytt IT-systemstöd för kursvärdering och kursanalys',
courseDev_btn_edit: 'Ändra publicerad',
courseDev_btn_new: 'Publicera ny',
},
Expand Down
18 changes: 17 additions & 1 deletion public/css/kursinfo-admin-web.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,25 @@ h2 {
}
> :last-child {
margin-block-end: 0;
}
}
}

.kth-alert.info {
h4 {
margin: 0;
}

p {
margin-block: .5rem;
> :first-child {
margin-block-start: 0;
}
> :last-child {
margin-block-end: 0;
}
}
}

.AdminStartPage__cardFooter {
display: flex;
align-items: baseline;
Expand Down
18 changes: 17 additions & 1 deletion public/js/app/pages/AdminStartPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ import AlertMsg from '../components/AlertMsg'
import AlertReminderMsg from '../components/AlertReminderMsg'
import AlertReminderMsgNewPubMemo from '../components/AlertReminderMsgNewPubMemo'
import { useWebContext } from '../context/WebContext'
import { ADMIN_COURSE_UTV, ADMIN_COURSE_PM, ADMIN_COURSE_PM_DATA, ADMIN_ABOUT_COURSE } from '../util/constants'
import {
ADMIN_COURSE_UTV,
ADMIN_COURSE_PM,
ADMIN_COURSE_PM_DATA,
ADMIN_ABOUT_COURSE,
NEW_COURSE_ANALYSIS_ADMIN_TOOL_URL,
} from '../util/constants'
import { fetchParameters } from '../util/fetchUrlParams'
import Alert from '../components-shared/Alert'

function AdminStartPage() {
const [context] = useWebContext()
Expand Down Expand Up @@ -100,6 +107,15 @@ function AdminStartPage() {
<div className="AdminStartPage__cardBody">
<p>{startCards.courseDev_decs_p1}</p>
<p>{startCards.courseDev_decs_p2}</p>
<Alert header={startCards.courseDev_decs_alert_title} type="info">
<p>{startCards.courseDev_decs_alert_p1}</p>
<p>
{startCards.courseDev_decs_alert_p2}{' '}
<a lang={lang} href={NEW_COURSE_ANALYSIS_ADMIN_TOOL_URL[lang]}>
{startCards.courseDev_decs_alert_p2_link}
</a>
</p>
</Alert>
</div>
</div>
<div className="AdminStartPage__cardFooter">
Expand Down
5 changes: 5 additions & 0 deletions public/js/app/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ export const COURSE_INFO_IN_CANVAS = {
en: 'https://intra.kth.se/en/utbildning/systemstod/canvas/guider/kursoversikt-1.1059436 ',
sv: 'https://intra.kth.se/utbildning/systemstod/canvas/guider/kursoversikt-1.1059436',
}

export const NEW_COURSE_ANALYSIS_ADMIN_TOOL_URL = {
en: 'https://intra.kth.se/en/utbildning/systemstod/kursvardering-och-kursanalys/nytt-it-systemstod-for-kursvardering-och-kursanalys-1.1300051',
sv: 'https://intra.kth.se/utbildning/systemstod/kursvardering-och-kursanalys/nytt-it-systemstod-for-kursvardering-och-kursanalys-1.1300051',
}
12 changes: 6 additions & 6 deletions test/AdminStartPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('<AdminStartPage> (and subordinates)', () => {
test('Has correct h4 heading in correct order', done => {
const { getAllByRole } = renderEditPage()
const allH4Headers = getAllByRole('heading', { level: 4 })
expect(allH4Headers.length).toBe(3)
expect(allH4Headers.length).toBe(4)
expect(allH4Headers[0]).toHaveTextContent(/^Sidan Inför kursval/)
expect(allH4Headers[1]).toHaveTextContent(/^Kurs-PM/)
expect(allH4Headers[2]).toHaveTextContent(/^Kursanalys och kursdata/)
Expand All @@ -54,7 +54,7 @@ describe('<AdminStartPage> (and subordinates)', () => {
test('Has correct buttons and links in correct order', done => {
const { getAllByRole } = renderEditPage()
const allLinks = getAllByRole('link')
expect(allLinks.length).toBe(8)
expect(allLinks.length).toBe(9)
expect(allLinks[0]).toHaveTextContent(/^Om kursen/)
expect(allLinks[0].href).toBe('https://www.kth.se/student/kurser/kurs/SF1624?l=sv')

Expand All @@ -75,13 +75,13 @@ describe('<AdminStartPage> (and subordinates)', () => {
expect(allLinks[5]).toHaveTextContent(/^Ladda upp kurs-PM som PDF/)
expect(allLinks[5].href).toBe('http://localhost/kursinfoadmin/pm/SF1624?l=sv')

expect(allLinks[6]).toHaveTextContent(/^Publicera ny/)
expect(allLinks[6].href).toBe(
expect(allLinks[7]).toHaveTextContent(/^Publicera ny/)
expect(allLinks[7].href).toBe(
'http://localhost/kursinfoadmin/kursutveckling/SF1624?l=sv&status=n&serv=admin&title=Algebra%20och%20geometri_7.5'
)

expect(allLinks[7]).toHaveTextContent(/^Ändra publicerad/)
expect(allLinks[7].href).toBe(
expect(allLinks[8]).toHaveTextContent(/^Ändra publicerad/)
expect(allLinks[8].href).toBe(
'http://localhost/kursinfoadmin/kursutveckling/SF1624?l=sv&status=p&serv=admin&title=Algebra%20och%20geometri_7.5'
)
done()
Expand Down
12 changes: 6 additions & 6 deletions test/RolesAdminStartPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('User roles for this course <AdminStartPage>', () => {
test('User: only responsible. Show all cards: course memo, course description and course analysis', done => {
const { getAllByRole } = renderEditPage(ONLY_RESPONSIBLE)
const allH4Headers = getAllByRole('heading', { level: 4 })
expect(allH4Headers.length).toBe(3)
expect(allH4Headers.length).toBe(4)
expect(allH4Headers[0]).toHaveTextContent(/^Sidan Inför kursval/)
expect(allH4Headers[1]).toHaveTextContent(/^Kurs-PM/)
expect(allH4Headers[2]).toHaveTextContent(/^Kursanalys och kursdata/)
Expand All @@ -126,7 +126,7 @@ describe('User roles for this course <AdminStartPage>', () => {
test('User: only examinator. Show all cards: course memo, course description and course analysis', done => {
const { getAllByRole } = renderEditPage(ONLY_EXAMINATOR)
const allH4Headers = getAllByRole('heading', { level: 4 })
expect(allH4Headers.length).toBe(3)
expect(allH4Headers.length).toBe(4)
expect(allH4Headers[0]).toHaveTextContent(/^Sidan Inför kursval/)
expect(allH4Headers[1]).toHaveTextContent(/^Kurs-PM/)
expect(allH4Headers[2]).toHaveTextContent(/^Kursanalys och kursdata/)
Expand All @@ -136,7 +136,7 @@ describe('User roles for this course <AdminStartPage>', () => {
test('User: only superuser. Show all cards: course memo, course description and course analysis', done => {
const { getAllByRole } = renderEditPage(ONLY_SUPERUSER)
const allH4Headers = getAllByRole('heading', { level: 4 })
expect(allH4Headers.length).toBe(3)
expect(allH4Headers.length).toBe(4)
expect(allH4Headers[0]).toHaveTextContent(/^Sidan Inför kursval/)
expect(allH4Headers[1]).toHaveTextContent(/^Kurs-PM/)
expect(allH4Headers[2]).toHaveTextContent(/^Kursanalys och kursdata/)
Expand All @@ -146,7 +146,7 @@ describe('User roles for this course <AdminStartPage>', () => {
test('User has two roles: teacher and superuser. Show all cards: course memo, course description and course analysis', done => {
const { getAllByRole } = renderEditPage(TEACHER_AND_SUPERUSER)
const allH4Headers = getAllByRole('heading', { level: 4 })
expect(allH4Headers.length).toBe(3)
expect(allH4Headers.length).toBe(4)
expect(allH4Headers[0]).toHaveTextContent(/^Sidan Inför kursval/)
expect(allH4Headers[1]).toHaveTextContent(/^Kurs-PM/)
expect(allH4Headers[2]).toHaveTextContent(/^Kursanalys och kursdata/)
Expand All @@ -156,7 +156,7 @@ describe('User roles for this course <AdminStartPage>', () => {
test('User has two roles: teacher and examinator. Show all cards: course memo, course description and course analysis', done => {
const { getAllByRole } = renderEditPage(TEACHER_AND_EXAMINATOR)
const allH4Headers = getAllByRole('heading', { level: 4 })
expect(allH4Headers.length).toBe(3)
expect(allH4Headers.length).toBe(4)
expect(allH4Headers[0]).toHaveTextContent(/^Sidan Inför kursval/)
expect(allH4Headers[1]).toHaveTextContent(/^Kurs-PM/)
expect(allH4Headers[2]).toHaveTextContent(/^Kursanalys och kursdata/)
Expand All @@ -166,7 +166,7 @@ describe('User roles for this course <AdminStartPage>', () => {
test('User has two roles: teacher and resonsible. Show all cards: course memo, course description and course analysis', done => {
const { getAllByRole } = renderEditPage(TEACHER_AND_RESPONSIBLE)
const allH4Headers = getAllByRole('heading', { level: 4 })
expect(allH4Headers.length).toBe(3)
expect(allH4Headers.length).toBe(4)
expect(allH4Headers[0]).toHaveTextContent(/^Sidan Inför kursval/)
expect(allH4Headers[1]).toHaveTextContent(/^Kurs-PM/)
expect(allH4Headers[2]).toHaveTextContent(/^Kursanalys och kursdata/)
Expand Down

0 comments on commit 8f6962e

Please sign in to comment.