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

refactor: static content assets directory #4775

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion deployment/docker/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
reverse_proxy @api scrumlr-backend:8080

@frontend {
path / /static* /locales* /login* /board* /new* /timer_finished.mp3 /hotkeys.pdf /legal/* /manifest.json /service-worker.js
path / /static* /locales* /login* /board* /new* /assets/* /legal/* /manifest.json /service-worker.js
}
reverse_proxy @frontend scrumlr-frontend:8080
}
2 changes: 1 addition & 1 deletion k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ spec:
services:
- name: scrumlr-backend-PR_NUMBER
port: 8080
- match: Host(`PR_NUMBER.development.scrumlr.fra.ics.inovex.io`) && (PathPrefix(`/static`) || PathPrefix(`/locales`) || PathPrefix(`/login`) || PathPrefix(`/board`) || PathPrefix(`/new`) || PathPrefix(`/timer_finished.mp3`) || PathPrefix(`/hotkeys.pdf`) || PathPrefix(`/legal/`))
- match: Host(`PR_NUMBER.development.scrumlr.fra.ics.inovex.io`) && (PathPrefix(`/static`) || PathPrefix(`/locales`) || PathPrefix(`/login`) || PathPrefix(`/board`) || PathPrefix(`/new`) || PathPrefix(`/assets/`) || PathPrefix(`/legal/`))
kind: Rule
services:
- name: scrumlr-frontend-PR_NUMBER
Expand Down
5 changes: 5 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ server {
add_header Cache-Control "no-store, no-cache, must-revalidate";
}

location /assets {
try_files $uri $uri/ =404;
add_header Cache-Control "public, max-age=604800"; # cache 1 week
}

location /index.html {
# Application specific feature toggles
add_header Set-Cookie "scrumlr__show-legal-documents=${SCRUMLR_SHOW_LEGAL_DOCUMENTS};Path=/;Max-Age=3600";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const ProfileSettings = () => {
>
<Toggle active={state.hotkeysAreActive} />
</SettingsButton>
<a className="profile-settings__open-cheat-sheet-button" href={`${process.env.PUBLIC_URL}/hotkeys.pdf`} target="_blank" rel="noopener noreferrer">
<a className="profile-settings__open-cheat-sheet-button" href={`${process.env.PUBLIC_URL}/assets/hotkeys.pdf`} target="_blank" rel="noopener noreferrer">
<p>{t("Hotkeys.cheatSheet")}</p>
<Info />
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Timer/Timer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const Timer = (props: TimerProps) => {
const boardId = useAppSelector((state) => state.board.data!.id);
const me = useAppSelector((state) => state.participants?.self);

const [playTimesUpSound, {sound: timesUpSoundObject}] = useSound(`${process.env.PUBLIC_URL}/timer_finished.mp3`, {volume: 0.5, interrupt: true});
const [playTimesUpSound, {sound: timesUpSoundObject}] = useSound(`${process.env.PUBLIC_URL}/assets/timer_finished.mp3`, {volume: 0.5, interrupt: true});
const [timeLeft, setTimeLeft] = useState<{h: number; m: number; s: number}>(TimerUtils.calculateTimeLeft(props.endTime));
const [elapsedTimePercentage, setElapsedTimePercentage] = useState<number>(TimerUtils.calculateElapsedTimePercentage(props.startTime, props.endTime));
const [timesUpShouldPlay, setTimesUpShouldPlay] = useState(false);
Expand Down
Loading