Skip to content

Commit

Permalink
Merge branch 'v3' into Deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sjschlapbach authored Oct 16, 2024
2 parents 760e7ca + 4e47fb2 commit 69e26a1
Show file tree
Hide file tree
Showing 28 changed files with 223 additions and 66 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [3.3.0-alpha.1](https://github.com/uzh-bf/klicker-uzh/compare/v3.3.0-alpha.0...v3.3.0-alpha.1) (2024-10-16)


### Bug Fixes

* ensure that feedback and response interactions return correct mutation content and trigger subscriptions ([#4309](https://github.com/uzh-bf/klicker-uzh/issues/4309)) ([140cabd](https://github.com/uzh-bf/klicker-uzh/commit/140cabd1636f2cbb49606aca30390ae8933ab85d))

## [3.3.0-alpha.0](https://github.com/uzh-bf/klicker-uzh/compare/v3.2.0...v3.3.0-alpha.0) (2024-10-16)


### Features

* add possibility to end group activity manually and introduce additional ended status ([#4303](https://github.com/uzh-bf/klicker-uzh/issues/4303)) ([fa6c196](https://github.com/uzh-bf/klicker-uzh/commit/fa6c196f8225e976b2d9ea656ed8b9f6a585dcc6))
* add possibility to start group activity synchronously before scheduled start date ([#4306](https://github.com/uzh-bf/klicker-uzh/issues/4306)) ([3e9b53e](https://github.com/uzh-bf/klicker-uzh/commit/3e9b53e93d0eb1f183f2aa81a0e65f4ad9cc3718))


### Refactors

* **cypress:** improve structure of test suite and separate deletion steps ([#4307](https://github.com/uzh-bf/klicker-uzh/issues/4307)) ([ef4e2d4](https://github.com/uzh-bf/klicker-uzh/commit/ef4e2d4611acf27667e3b3ed529106352addaacc))


### Enhancements

* **apps/frontend-pwa:** show scheduled activities on group activity list ([#4308](https://github.com/uzh-bf/klicker-uzh/issues/4308)) ([77fdd39](https://github.com/uzh-bf/klicker-uzh/commit/77fdd39682109149324e115ba77dcac193973d21))
* resolve seed-dependency of group activity through extended test suite ([#4305](https://github.com/uzh-bf/klicker-uzh/issues/4305)) ([dd00908](https://github.com/uzh-bf/klicker-uzh/commit/dd00908932eb6dc18201d9811636765d795dbf4e))

## [3.2.0](https://github.com/uzh-bf/klicker-uzh/compare/v3.2.0-rc.5...v3.2.0) (2024-10-09)

## [3.2.0-rc.5](https://github.com/uzh-bf/klicker-uzh/compare/v3.2.0-rc.4...v3.2.0-rc.5) (2024-10-09)
Expand Down
2 changes: 1 addition & 1 deletion apps/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klicker-uzh/auth",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"dependencies": {
"@klicker-uzh/i18n": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/backend-docker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klicker-uzh/backend-docker",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/docs",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"dependencies": {
"@docusaurus/core": "3.5.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-control/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/frontend-control",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"dependencies": {
"@apollo/client": "3.11.8",
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-manage/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/frontend-manage",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"dependencies": {
"@azure/storage-blob": "12.24.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import {
DeleteFeedbackResponseDocument,
Feedback,
FeedbackCreatedDocument,
GetCockpitSessionDocument,
PinFeedbackDocument,
PublishFeedbackDocument,
ResolveFeedbackDocument,
RespondToFeedbackDocument,
Session,
} from '@klicker-uzh/graphql/dist/ops'
import { push } from '@socialgouv/matomo-next'
import { H2, Switch } from '@uzh-bf/design-system'
Expand Down Expand Up @@ -53,12 +55,21 @@ function AudienceInteraction({
const feedbackAdded = subscribeToMore({
document: FeedbackCreatedDocument,
variables: { sessionId },
updateQuery: (prev, { subscriptionData }) => {
updateQuery: (
prev: { cockpitSession: Session },
{
subscriptionData,
}: { subscriptionData: { data: { feedbackCreated: Feedback } } }
) => {
if (!subscriptionData.data) return prev
const newItem = subscriptionData.data.feedbackCreated
const updatedSession = {
...prev.cockpitSession,
feedbacks: [newItem, ...(prev.cockpitSession.feedbacks ?? [])],
}

return {
...prev,
feedbacks: [newItem, ...prev.cockpitSession.feedbacks],
cockpitSession: updatedSession,
}
},
})
Expand Down Expand Up @@ -163,13 +174,73 @@ function AudienceInteraction({
sessionName={sessionName}
feedbacks={feedbacks}
handleDeleteFeedback={(feedbackId: number): void => {
deleteFeedback({ variables: { id: feedbackId } })
deleteFeedback({
variables: { id: feedbackId },
optimisticResponse: {
deleteFeedback: {
id: feedbackId,
__typename: 'Feedback',
},
},
update(cache, res) {
const removedFeedback = res.data?.deleteFeedback
const data = cache.readQuery({
query: GetCockpitSessionDocument,
variables: { id: sessionId },
})

if (data?.cockpitSession && removedFeedback) {
cache.writeQuery({
query: GetCockpitSessionDocument,
variables: { id: sessionId },
data: {
cockpitSession: {
...data.cockpitSession,
feedbacks:
data.cockpitSession.feedbacks?.filter(
(feedback) =>
feedback.id !== removedFeedback.id
) ?? [],
},
},
})
}
},
})
push(['trackEvent', 'Running Session', 'Feedback Deleted'])
}}
handleDeleteFeedbackResponse={(responseId: number) => {
deleteFeedbackResponse({
variables: { id: responseId },
update(cache, res) {
const updatedFeedback = res.data?.deleteFeedbackResponse
const data = cache.readQuery({
query: GetCockpitSessionDocument,
variables: { id: sessionId },
})

if (data?.cockpitSession && updatedFeedback) {
cache.writeQuery({
query: GetCockpitSessionDocument,
variables: { id: sessionId },
data: {
cockpitSession: {
...data.cockpitSession,
feedbacks: data.cockpitSession.feedbacks?.map(
(feedback) => {
if (feedback.id === updatedFeedback.id) {
return updatedFeedback
}
return feedback
}
),
},
},
})
}
},
})

push([
'trackEvent',
'Running Session',
Expand Down
6 changes: 3 additions & 3 deletions apps/frontend-manage/src/pages/sessions/[id]/cockpit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ import { useState } from 'react'

import Loader from '@klicker-uzh/shared-components/src/Loader'
import { GetStaticPropsContext } from 'next'
import { useTranslations } from 'next-intl'
import Layout from '../../../components/Layout'
import AudienceInteraction from '../../../components/interaction/AudienceInteraction'
import SessionTimeline from '../../../components/sessions/cockpit/SessionTimeline'

function Cockpit() {
const router = useRouter()
const t = useTranslations()

const [isEvaluationPublic, setEvaluationPublic] = useState(false)

const [activateSessionBlock] = useMutation(ActivateSessionBlockDocument)
Expand All @@ -37,6 +34,9 @@ function Cockpit() {
],
})

// TODO: when refactoring this code to be compatible with the new live quiz setup,
// think about modifying this logic to only refetch the required live quiz elements
// regularly (feedbacks should be handled entirely through subscriptions, etc.)
const {
loading: cockpitLoading,
error: cockpitError,
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/frontend-pwa",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"dependencies": {
"@apollo/client": "3.11.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import {
faCheck,
faHourglassEnd,
faHourglassStart,
faPlay,
faXmark,
} from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { H3 } from '@uzh-bf/design-system'

import { faClock } from '@fortawesome/free-regular-svg-icons'
import {
faClock,
faFileLines,
faPlayCircle,
} from '@fortawesome/free-regular-svg-icons'
import {
GroupActivity,
GroupActivityInstance,
Expand Down Expand Up @@ -73,6 +76,13 @@ function GroupActivityList({
</div>
</div>

{activity.status === GroupActivityStatus.Scheduled && (
<div className="flex h-max w-max flex-row items-center gap-2 rounded bg-orange-300 px-2 py-0.5 text-sm">
<FontAwesomeIcon icon={faClock} />
<div>{t('shared.generic.scheduled')}</div>
</div>
)}

{activity.status === GroupActivityStatus.Published && (
<div className="flex h-max flex-row items-center gap-1.5">
<ActivityInstanceLink
Expand All @@ -84,7 +94,7 @@ function GroupActivityList({
}}
/>
<div className="flex h-max w-max flex-row items-center gap-2 rounded bg-green-300 px-2 py-0.5 text-sm">
<FontAwesomeIcon icon={faPlay} />
<FontAwesomeIcon icon={faPlayCircle} />
<div>
{!groupActivityInstances[activity.id]?.id
? t('pwa.groupActivity.available')
Expand Down Expand Up @@ -120,7 +130,7 @@ function GroupActivityList({
>
{existingSubmission ? (
<>
<FontAwesomeIcon icon={faClock} />
<FontAwesomeIcon icon={faFileLines} />
<div>{t('pwa.groupActivity.submitted')}</div>
</>
) : (
Expand Down
2 changes: 1 addition & 1 deletion apps/func-incoming-responses/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/func-incoming-responses",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion apps/func-migration-v2-export/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/func-migration-v2-export",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion apps/func-migration-v3-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/func-migration-v3-import",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion apps/func-response-processor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@klicker-uzh/func-response-processor",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion apps/office-addin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klicker-uzh/office-addin",
"version": "3.2.0",
"version": "3.3.0-alpha.1",
"license": "AGPL-3.0",
"dependencies": {
"@uzh-bf/design-system": "3.0.0-alpha.32",
Expand Down
Loading

0 comments on commit 69e26a1

Please sign in to comment.