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

Enhanced preview #275

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4813680
173: Added preview component that iframes screen client into admin
tuj May 14, 2024
6b350ca
172: Added preview to playlist
tuj May 17, 2024
e1683e5
173: Added preview to slide
tuj May 21, 2024
969590a
173: Changed to translation prefix
tuj May 22, 2024
2a20910
173: Made preview configurable
tuj May 22, 2024
7d9dfce
173: Added sticky footer for action buttons
tuj May 29, 2024
798448c
173: Changed how preview is integrated in UI
tuj May 31, 2024
ed4e278
173: Added moved sticky preview top
tuj Jun 6, 2024
e7b70ca
173: Fixed padding
tuj Jun 7, 2024
a215ac1
173: Added preview to screen
tuj Jun 11, 2024
e830783
173: Added preview to playlist
tuj Jun 17, 2024
7457453
173: Applied coding standards
tuj Jun 17, 2024
d4823f6
173: Fixed merge
tuj Jun 17, 2024
e19b2c5
173: Removed comment
tuj Jun 17, 2024
7d28e95
173: Fixed merge
tuj Jun 19, 2024
fb40b1d
173: Fixed merge
tuj Jun 19, 2024
64bc8e8
173: Fixed playlist preview
tuj Jun 24, 2024
ce0d2f0
3068: Fixed merge
tuj Nov 25, 2024
5fdff58
3068: Fixed merge bugs
tuj Nov 25, 2024
cf68e58
3068: Fixed merge bugs
tuj Nov 25, 2024
d7ab287
3068: Fixed translations
tuj Nov 25, 2024
3cf16c1
3068: Removed cypress screenshots
tuj Nov 25, 2024
d0ef952
3068: Fixed merge
tuj Nov 25, 2024
d874d5e
Merge branch 'develop' into feature/preview
tuj Dec 4, 2024
1355a74
3172: Fixed save slide without redirect
tuj Dec 4, 2024
4f21be8
3172: Work on applying sticky footer to all edit pages
tuj Dec 5, 2024
77d13aa
3172: Added to remaining forms
tuj Dec 5, 2024
bb98a4a
3172: Added to activation code form
tuj Dec 5, 2024
3599a91
3172: Applied coding standards
tuj Dec 5, 2024
6ad0377
3172: Added orientation select
tuj Dec 6, 2024
e3b6dba
3172: New preview is only used if previewClient config parameter is s…
tuj Dec 10, 2024
136e85e
3172: Fixed test issues
tuj Dec 10, 2024
62de69d
Update src/components/activation-code/activation-code-form.jsx
tuj Dec 11, 2024
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
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Changelog

All notable changes to this project will be documented in this file.
Expand Down
10 changes: 5 additions & 5 deletions e2e/feed-sources.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ test.describe("fest", () => {

test("It loads create datakilde page", async ({ page }) => {
page.getByText("Opret ny datakilde").click();
await expect(page.locator("#save_feed-source")).toBeVisible();
await expect(page.locator("#save")).toBeVisible();
});

test("It display error toast on save error", async ({ page }) => {
Expand All @@ -238,7 +238,7 @@ test.describe("fest", () => {
await expect(
page.locator(".Toastify").locator(".Toastify__toast--error")
).not.toBeVisible();
await page.locator("#save_feed-source").click();
await page.locator("#save").click();
await expect(
page.locator(".Toastify").locator(".Toastify__toast--error")
).toBeVisible();
Expand All @@ -253,9 +253,9 @@ test.describe("fest", () => {
});
test("Cancel create datakilde", async ({ page }) => {
page.getByText("Opret ny datakilde").click();
await expect(page.locator("#cancel_feed-source")).toBeVisible();
await page.locator("#cancel_feed-source").click();
await expect(page.locator("#cancel_feed-source")).not.toBeVisible();
await expect(page.locator("#cancel")).toBeVisible();
await page.locator("#cancel").click();
await expect(page.locator("#cancel")).not.toBeVisible();
});
});

Expand Down
2 changes: 1 addition & 1 deletion e2e/playlist.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.describe("Playlist create tests", () => {
await expect(
page.locator(".Toastify").locator(".Toastify__toast--success")
).not.toBeVisible();
await page.locator("#save_playlist").click();
await page.locator("#save_slide_and_close").click();
await expect(
page
.locator(".Toastify")
Expand Down
1 change: 1 addition & 0 deletions infrastructure/itkdev/etc/confd/templates/config.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"api": "{{ getenv "API_PATH" "/" }}",
"touchButtonRegions": "{{ getenv "APP_TOUCH_BUTTON_REGIONS" "false"}}",
"previewClient": "{{ getenv "APP_PREVIEW_CLIENT" "null"}}",
"rejseplanenApiKey": "{{ getenv "APP_REJSEPLANEN_API_KEY" "null"}}",
"loginMethods": [
{
Expand Down
1 change: 1 addition & 0 deletions infrastructure/os2display/etc/confd/templates/config.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"api": "{{ getenv "API_PATH" "/" }}",
"touchButtonRegions": "{{ getenv "APP_TOUCH_BUTTON_REGIONS" "false"}}",
"previewClient": "{{ getenv "APP_PREVIEW_CLIENT" "null"}}",
"rejseplanenApiKey": "{{ getenv "APP_REJSEPLANEN_API_KEY" "null"}}",
"loginMethods": [
{
Expand Down
1 change: 1 addition & 0 deletions public/example_config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"api": "/",
"touchButtonRegions": false,
"previewClient": null,
"rejseplanenApiKey": null,
"loginMethods": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function App() {
<Col lg={9} xl={10}>
<Topbar />
{accessConfig && (
<main className="col p-3">
<main>
<Routes>
<Route path="campaign">
<Route
Expand Down
4 changes: 2 additions & 2 deletions src/components/activation-code/activation-code-activate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function ActivationCodeActivate() {
};

return (
<>
<div className="p-3">
<LoadingComponent
isLoading={isSaving}
loadingMessage={t("loading-messages.saving-activation-code")}
Expand Down Expand Up @@ -99,7 +99,7 @@ function ActivationCodeActivate() {
</Button>
</ContentFooter>
</Form>
</>
</div>
);
}

Expand Down
76 changes: 39 additions & 37 deletions src/components/activation-code/activation-code-form.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { React } from "react";
import { useNavigate } from "react-router-dom";
import { Button } from "react-bootstrap";
import { Button, Col, Row } from "react-bootstrap";
import { useTranslation } from "react-i18next";
import PropTypes from "prop-types";
import Form from "react-bootstrap/Form";
import LoadingComponent from "../util/loading-component/loading-component";
import ContentBody from "../util/content-body/content-body";
import ContentFooter from "../util/content-footer/content-footer";
import FormInput from "../util/forms/form-input";
import RadioButtons from "../util/forms/radio-buttons";
import StickyFooter from "../util/sticky-footer";

/**
* The user form component.
Expand Down Expand Up @@ -48,44 +48,48 @@ function ActivationCodeForm({
<>
<LoadingComponent isLoading={isLoading} loadingMessage={loadingMessage} />
<Form>
<h1 id="h1UserDisplayName">{headerText}</h1>
<ContentBody>
<div className="mb-2">
<FormInput
title="display-name"
type="text"
label={t("display-name-label")}
placeholder={t("display-name-placeholder")}
value={activationCode.displayName}
onChange={handleInput}
name="displayName"
required
/>
</div>
<div className="mb-2">
<RadioButtons
radioGroupName="role"
handleChange={handleInput}
options={roles}
label={t("role-label")}
selected={activationCode.role}
/>
<div>
<small>{t("role-external-user-helptext")}</small>
</div>
<div>
<small>{t("role-external-user-admin-helptext")}</small>
</div>
</div>
</ContentBody>
<ContentFooter>
<Row className="m-3">
<h1 id="h1UserDisplayName">{headerText}</h1>
tuj marked this conversation as resolved.
Show resolved Hide resolved
<Col>
<ContentBody>
<div className="mb-2">
<FormInput
title="display-name"
type="text"
label={t("display-name-label")}
placeholder={t("display-name-placeholder")}
value={activationCode.displayName}
onChange={handleInput}
name="displayName"
required
/>
</div>
<div className="mb-2">
<RadioButtons
radioGroupName="role"
handleChange={handleInput}
options={roles}
label={t("role-label")}
selected={activationCode.role}
/>
<div>
<small>{t("role-external-user-helptext")}</small>
</div>
<div>
<small>{t("role-external-user-admin-helptext")}</small>
</div>
</div>
</ContentBody>
</Col>
</Row>

<StickyFooter>
<Button
variant="secondary"
type="button"
id="cancel_user"
onClick={() => navigate("/activation/list/")}
className="margin-right-button"
size="lg"
>
{t("cancel-button")}
</Button>
Expand All @@ -94,12 +98,10 @@ function ActivationCodeForm({
type="button"
onClick={handleSubmit}
id="save_user"
size="lg"
className="col"
>
{t("save-button")}
</Button>
</ContentFooter>
</StickyFooter>
</Form>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/activation-code/activation-code-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function ActivationCodeList() {
}, [listData]);

return (
<>
<div className="p-3">
<ContentHeader
title={t("header")}
newBtnTitle={t("create-activation-codes")}
Expand All @@ -208,7 +208,7 @@ function ActivationCodeList() {
)}
</>
</ContentBody>
</>
</div>
);
}

Expand Down
Loading
Loading