Skip to content

Commit c28e23b

Browse files
committed
feat: Add public file storage waitlist alert
Signed-off-by: Andrew Burnes <[email protected]>
1 parent 185e83c commit c28e23b

File tree

7 files changed

+39
-42
lines changed

7 files changed

+39
-42
lines changed

frontend/pages/sites/$siteId/siteRoutes.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,13 @@ export default [
5757
icon: 'IconGear',
5858
showInSidebar: true,
5959
},
60-
61-
...(process.env.FEATURE_FILE_STORAGE_SERVICE === 'true'
62-
? [
63-
{
64-
Component: FileStorage,
65-
title: 'Public file storage',
66-
path: 'storage',
67-
icon: 'IconCloudUpload',
68-
showInSidebar: true,
69-
},
70-
]
71-
: []),
60+
{
61+
Component: FileStorage,
62+
title: 'Public file storage',
63+
path: 'storage',
64+
icon: 'IconCloudUpload',
65+
showInSidebar: true,
66+
},
7267
...(process.env.FEATURE_FILE_STORAGE_SERVICE === 'true'
7368
? [
7469
{

frontend/pages/sites/$siteId/siteRoutes.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('siteRoutes', () => {
4141
it('should not include storage routes when FEATURE_FILE_STORAGE_SERVICE is false', () => {
4242
process.env.FEATURE_FILE_STORAGE_SERVICE = 'false';
4343
const routes = jest.requireActual('./siteRoutes').default;
44-
expect(routes.some((route) => route.path === 'storage')).toBe(false);
44+
expect(routes.some((route) => route.path === 'storage')).toBe(true);
4545
expect(routes.some((route) => route.path === 'storage/logs')).toBe(false);
4646
});
4747
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import AlertBanner from '@shared/alertBanner';
3+
4+
export default function Announcement() {
5+
const message = (
6+
<span>
7+
We&apos;re excited to announce an upcoming new public file storage feature! 🎉 With
8+
this new feature, you&apos;ll be able to upload and share files publicly from your
9+
existing site and simply manage your public files in Pages.
10+
<br />
11+
<br />
12+
Interested in trying out the new public file storage? Reach out to us at{' '}
13+
<a
14+
title="Email support to launch a custom domain."
15+
href="mailto:[email protected]"
16+
>
17+
18+
</a>{' '}
19+
to get on the waitlist.
20+
</span>
21+
);
22+
23+
return <AlertBanner status="info" header="Coming Soon!" message={message} />;
24+
}

frontend/pages/sites/$siteId/storage/index.jsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useSelector } from 'react-redux';
44
import useFileStorage from '@hooks/useFileStorage';
55

66
import AlertBanner from '@shared/alertBanner';
7+
import Announcement from './Announcement';
78
import LocationBar from './LocationBar';
89
import FileDetails from './FileDetails';
910
import NewFileOrFolder from './NewFileOrFolder';
@@ -17,20 +18,9 @@ function FileStoragePage() {
1718
const { id } = useParams();
1819
const site = useSelector((state) => currentSite(state.sites, id));
1920
const fileStorageServiceId = site.fileStorageServiceId;
21+
2022
if (!fileStorageServiceId) {
21-
const errorMessage = (
22-
<span>
23-
This site does not have Public File Storage enabled. Please contact{' '}
24-
<a
25-
title="Email support to launch a custom domain."
26-
href="mailto:[email protected]"
27-
>
28-
29-
</a>{' '}
30-
to request access.
31-
</span>
32-
);
33-
return <AlertBanner status="info" header="" message={errorMessage} />;
23+
return <Announcement />;
3424
}
3525

3626
const [searchParams, setSearchParams] = useSearchParams();

frontend/pages/sites/$siteId/storage/logs/index.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import useFileStorageLogs from '@hooks/useFileStorageLogs';
55
import PropTypes from 'prop-types';
66
import QueryPage from '@shared/layouts/QueryPage';
77
import Pagination from '@shared/Pagination';
8-
import AlertBanner from '@shared/alertBanner';
8+
import Announcement from '../Announcement';
99

1010
import { dateAndTimeSimple, timeFrom } from '@util/datetime';
1111
import { currentSite } from '@selectors/site';
@@ -18,19 +18,7 @@ function FileStorageLogs() {
1818
const initalPage = parseInt(searchParams.get('page')) || 1;
1919

2020
if (!fileStorageServiceId) {
21-
const errorMessage = (
22-
<span>
23-
This site does not have Public File Storage enabled. Please contact{' '}
24-
<a
25-
title="Email support to launch a custom domain."
26-
href="mailto:[email protected]"
27-
>
28-
29-
</a>{' '}
30-
to request access.
31-
</span>
32-
);
33-
return <AlertBanner status="info" header="" message={errorMessage} />;
21+
return <Announcement />;
3422
}
3523

3624
const { data, isPending, error, currentPage, totalPages, totalItems } =

frontend/pages/sites/$siteId/storage/logs/index.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('storage/logs/index', () => {
9191
setup();
9292

9393
expect(
94-
screen.getByText(/This site does not have Public File Storage enabled/i),
94+
screen.getByText(/excited to announce an upcoming new public file storage/i),
9595
).toBeInTheDocument();
9696
expect(useFileStorageLogs).not.toHaveBeenCalled();
9797
});

scripts/create-dev-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ async function createData() {
364364
defaultConfig: {
365365
hello: 'world',
366366
},
367-
}),
367+
}).then((site) => addSiteToOrg(site, agency1)),
368368

369369
siteFactory({
370370
engine: 'node.js',

0 commit comments

Comments
 (0)