• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ProjektAdLer / 2D_3D_AdLer / #1311

12 Aug 2025 12:33PM UTC coverage: 96.454% (-0.02%) from 96.469%
#1311

push

mountler
added display of other available learning spaces to exit modal

2606 of 3061 branches covered (85.14%)

19 of 22 new or added lines in 4 files covered. (86.36%)

1 existing line in 1 file now uncovered.

5766 of 5978 relevant lines covered (96.45%)

50.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.75
/src/Components/Core/Presentation/React/GeneralComponents/NarrativeFramework/NarrativeFramework.tsx
1
import useBuilder from "~ReactComponents/ReactRelated/CustomHooks/useBuilder";
2
import NarrativeFrameworkViewModel from "./NarrativeFrameworkViewModel";
3
import INarrativeFrameworkController from "./INarrativeFrameworkController";
4
import BUILDER_TYPES from "~DependencyInjection/Builders/BUILDER_TYPES";
5
import { LearningSpaceThemeType } from "src/Components/Core/Domain/Types/LearningSpaceThemeTypes";
6
import explainAdler from "src/Assets/narrativeFramework/g-narrativeframe-explainadler-angled.png";
7

8
// Import background images
9
import campusABBackground from "src/Assets/misc/narrativeFrameworkBackgrounds/a-background-narrativeframework-campusab.png";
10
import campusKEBackground from "src/Assets/misc/narrativeFrameworkBackgrounds/a-background-narrativeframework-campuske.png";
11
import suburbBackground from "src/Assets/misc/narrativeFrameworkBackgrounds/a-background-narrativeframework-suburb.png";
12
import companyBackground from "src/Assets/misc/narrativeFrameworkBackgrounds/a-background-narrativeframework-company.png";
13

14
type NarrativeFrameworkProps = {
15
  type: "intro" | "outro";
16
};
17

18
function getBackgroundImage(theme: LearningSpaceThemeType): string {
19
  // Convert theme to string for comparison
20
  const themeString = theme?.toString();
8✔
21

22
  // Check for main world themes and their variations
23
  if (
8✔
24
    themeString === LearningSpaceThemeType.CampusAB ||
14✔
25
    themeString?.startsWith("CAMPUSASCHAFFENBURG")
26
  ) {
27
    return campusABBackground;
2✔
28
  }
29
  if (
6✔
30
    themeString === LearningSpaceThemeType.CampusKE ||
11✔
31
    themeString?.startsWith("CAMPUSKEMPTEN")
32
  ) {
33
    return campusKEBackground;
1✔
34
  }
35
  if (
5✔
36
    themeString === LearningSpaceThemeType.Suburb ||
6✔
37
    themeString?.startsWith("SUBURB")
38
  ) {
39
    return suburbBackground;
4✔
40
  }
41
  if (
1!
42
    themeString === LearningSpaceThemeType.Company ||
1!
43
    themeString?.startsWith("COMPANY")
44
  ) {
45
    return companyBackground;
1✔
46
  }
47

48
  // Fallback to suburb background if theme is undefined or doesn't match
UNCOV
49
  return suburbBackground;
×
50
}
51

52
export default function NarrativeFramework(props: NarrativeFrameworkProps) {
53
  const [viewModel, controller] = useBuilder<
17✔
54
    NarrativeFrameworkViewModel,
55
    INarrativeFrameworkController
56
  >(BUILDER_TYPES.INarrativeFrameworkBuilder);
57

58
  if (!viewModel || !controller) return null;
17✔
59
  if (props.type === "intro" && !viewModel.introText) return null;
15✔
60
  if (props.type === "outro" && !viewModel.outroText) return null;
12✔
61

62
  const backgroundImage = getBackgroundImage(
8✔
63
    viewModel.theme || LearningSpaceThemeType.Suburb,
11✔
64
  );
65

66
  return (
8✔
67
    <div
68
      className="relative h-80 w-full rounded-lg bg-cover bg-no-repeat p-4 mobile-landscape:h-32 mobile-landscape:w-[70vw] tablet-portrait:h-[60vh]"
69
      style={{ backgroundImage: `url(${backgroundImage})` }}
70
    >
71
      <div className="absolute -left-6 top-56 flex items-start justify-start xl:-left-2 xl:top-56 mobile-landscape:top-16 tablet-portrait:top-56">
72
        <img alt="AdLer with a thumb up" src={explainAdler} className="w-32" />
73
        <div className="twok:top-15 relative -left-4 -top-24 z-50 mt-4 translate-y-[-50%] xl:-top-24 xl:left-4 xl:w-3/4 onek:-left-0 onek:-top-20 onek:mt-0 twok:left-2 mobile-landscape:-top-4 mobile-portrait:w-56 tablet-portrait:-top-12">
74
          <span className="bubblecornerbottomleft invisible absolute -bottom-20 -left-3 h-20 w-20 bg-buttonbgblueopacity md:visible mobile-landscape:invisible"></span>
75
          <div className="rounded-lg bg-buttonbgblueopacity p-4 text-adlerdarkblue mobile-portrait:p-2">
76
            <p className="text-2xs font-bold lg:text-base xl:text-lg onek:text-lg tablet-portrait:text-lg">
77
              {props.type === "intro" && viewModel.introText}
15✔
78
              {props.type === "outro" && viewModel.outroText}
9✔
79
            </p>
80
          </div>
81
        </div>
82
      </div>
83
    </div>
84
  );
85
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc