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

Implement a Community Goal to sync with Tebex webstore. #94

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
449acec
Delete message after filtering prohibited content.
benrobson Nov 14, 2023
3f3ab87
Fix spacing in network log messages.
benrobson Nov 14, 2023
08276c8
Make usernames more presentable in logs.
benrobson Nov 14, 2023
6dffe68
Remove deleted channel field from being mentioned twice.
benrobson Nov 14, 2023
e6e86b3
Fixed issue where filter errors after response is sent.
benrobson Nov 14, 2023
9461d6d
Changed from HEX to Colour
benrobson Nov 14, 2023
bb011d4
Add /poll command.
benrobson Nov 14, 2023
8c8c14d
Add page descriptions to headers.
benrobson Nov 14, 2023
582aa41
Added keywords and SEO option to configuration.
benrobson Nov 14, 2023
7d3f93d
Add documentation badges for list and editors.
benrobson Nov 15, 2023
af0bce5
Push mobile view changes for session views.
benrobson Nov 15, 2023
e55c5d9
Resolved mobile styling issues with dashboard views.
benrobson Nov 15, 2023
7b4b73e
Added a staffChannel config option and a /staffhelp command
benrobson Nov 15, 2023
ed2c96e
Resolve issues with cookie banner not showing on /register
benrobson Nov 15, 2023
75e2f8d
Made urgent change to hasPermission, allowing non-logged in users to …
benrobson Nov 16, 2023
89f7834
Reformat all project files using Prettier. (#90)
benrobson Nov 20, 2023
726cf14
Resolve issue with logout crashing.
benrobson Nov 20, 2023
f61ffa5
Commence work on /ranks page and Tebex integration.
benrobson Nov 21, 2023
4e9d8d4
Transitioning back to JSON file, using catagory and packages
benrobson Nov 21, 2023
3976ea6
Finish rank page implementation.
benrobson Nov 22, 2023
d338db5
Update perks.
benrobson Nov 22, 2023
a09513a
Implement a call to action button style instead and make mobile frien…
benrobson Nov 22, 2023
04f672f
Commit Community Goal tab
benrobson Nov 23, 2023
2bd95cb
Separate redirect route into own file, add config option for kb and a…
benrobson Nov 24, 2023
781f49d
Change node engine to support node 18. (#92)
benrobson Nov 24, 2023
57da364
Implementation of a Ranks/donation page. (#91)
benrobson Nov 24, 2023
b3d55c3
Change rank page descriptor.
benrobson Nov 24, 2023
43f8163
Merge branch 'stage' of https://github.com/ModularSoftAU/zander-web i…
benrobson Nov 25, 2023
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
327 changes: 171 additions & 156 deletions api/common.js

Large diffs are not rendered by default.

99 changes: 48 additions & 51 deletions api/internal_redirect/announcement.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
import {hasPermission, setBannerCookie, postAPIRequest} from '../common'
import { hasPermission, postAPIRequest } from "../common";

export default function announcementRedirectRoute(app, config, lang) {
const baseEndpoint = '/redirect/announcement';

app.post(baseEndpoint + '/create', async function(req, res) {
if (!hasPermission('zander.web.announcements', req, res))
return;

postAPIRequest(
`${process.env.siteAddress}/api/announcement/create`,
req.body,
`${process.env.siteAddress}/dashboard/announcements`,
res
)

res.redirect(`${process.env.siteAddress}/dashboard/announcements`);

return res;
});

app.post(baseEndpoint + '/edit', async function(req, res) {
if (!hasPermission('zander.web.announcements', req, res))
return;

postAPIRequest(
`${process.env.siteAddress}/api/announcement/edit`,
req.body,
`${process.env.siteAddress}/dashboard/announcements`,
res
)

res.redirect(`${process.env.siteAddress}/dashboard/announcements`);

return res;
});

app.post(baseEndpoint + '/delete', async function(req, res) {
if (!hasPermission('zander.web.announcements', req, res))
return;

postAPIRequest(
`${process.env.siteAddress}/api/announcement/delete`,
req.body,
`${process.env.siteAddress}/dashboard/announcements`,
res
)

res.redirect(`${process.env.siteAddress}/dashboard/announcements`);

return res;
});
}
const baseEndpoint = "/redirect/announcement";

app.post(baseEndpoint + "/create", async function (req, res) {
if (!hasPermission("zander.web.announcements", req, res)) return;

postAPIRequest(
`${process.env.siteAddress}/api/announcement/create`,
req.body,
`${process.env.siteAddress}/dashboard/announcements`,
res
);

res.redirect(`${process.env.siteAddress}/dashboard/announcements`);

return res;
});

app.post(baseEndpoint + "/edit", async function (req, res) {
if (!hasPermission("zander.web.announcements", req, res)) return;

postAPIRequest(
`${process.env.siteAddress}/api/announcement/edit`,
req.body,
`${process.env.siteAddress}/dashboard/announcements`,
res
);

res.redirect(`${process.env.siteAddress}/dashboard/announcements`);

return res;
});

app.post(baseEndpoint + "/delete", async function (req, res) {
if (!hasPermission("zander.web.announcements", req, res)) return;

postAPIRequest(
`${process.env.siteAddress}/api/announcement/delete`,
req.body,
`${process.env.siteAddress}/dashboard/announcements`,
res
);

res.redirect(`${process.env.siteAddress}/dashboard/announcements`);

return res;
});
}
100 changes: 48 additions & 52 deletions api/internal_redirect/application.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@
import {hasPermission, setBannerCookie, postAPIRequest} from '../common'
import { hasPermission, postAPIRequest } from "../common";

export default function applicationRedirectRoute(app, config, lang) {
const baseEndpoint = '/redirect/application';

app.post(baseEndpoint + '/create', async function(req, res) {
if (!hasPermission('zander.web.application', req, res))
return;

postAPIRequest(
`${process.env.siteAddress}/api/application/create`,
req.body,
`${process.env.siteAddress}/dashboard/applications`,
res
)

res.redirect(`${process.env.siteAddress}/dashboard/applications`);

return res;
});

app.post(baseEndpoint + '/edit', async function(req, res) {
if (!hasPermission('zander.web.application', req, res))
return;

postAPIRequest(
`${process.env.siteAddress}/api/application/edit`,
req.body,
`${process.env.siteAddress}/dashboard/applications`,
res
)

res.redirect(`${process.env.siteAddress}/dashboard/applications`);

return res;
});

app.post(baseEndpoint + '/delete', async function(req, res) {
if (!hasPermission('zander.web.application', req, res))
return;

postAPIRequest(
`${process.env.siteAddress}/api/application/delete`,
req.body,
`${process.env.siteAddress}/dashboard/applications`,
res
)

res.redirect(`${process.env.siteAddress}/dashboard/applications`);

return res;
});

}
const baseEndpoint = "/redirect/application";

app.post(baseEndpoint + "/create", async function (req, res) {
if (!hasPermission("zander.web.application", req, res)) return;

postAPIRequest(
`${process.env.siteAddress}/api/application/create`,
req.body,
`${process.env.siteAddress}/dashboard/applications`,
res
);

res.redirect(`${process.env.siteAddress}/dashboard/applications`);

return res;
});

app.post(baseEndpoint + "/edit", async function (req, res) {
if (!hasPermission("zander.web.application", req, res)) return;

postAPIRequest(
`${process.env.siteAddress}/api/application/edit`,
req.body,
`${process.env.siteAddress}/dashboard/applications`,
res
);

res.redirect(`${process.env.siteAddress}/dashboard/applications`);

return res;
});

app.post(baseEndpoint + "/delete", async function (req, res) {
if (!hasPermission("zander.web.application", req, res)) return;

postAPIRequest(
`${process.env.siteAddress}/api/application/delete`,
req.body,
`${process.env.siteAddress}/dashboard/applications`,
res
);

res.redirect(`${process.env.siteAddress}/dashboard/applications`);

return res;
});
}
18 changes: 9 additions & 9 deletions api/internal_redirect/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import applicationRedirectRoute from './application'
import serverRedirectRoute from './server'
import webRedirectRoute from './web'
import announcementsRedirectRoute from './announcement'
import applicationRedirectRoute from "./application";
import serverRedirectRoute from "./server";
import webRedirectRoute from "./web";
import announcementsRedirectRoute from "./announcement";

export default (app, config, lang) => {
applicationRedirectRoute(app, config, lang);
serverRedirectRoute(app, config, lang);
webRedirectRoute(app, config, lang);
announcementsRedirectRoute(app, config, lang);
}
applicationRedirectRoute(app, config, lang);
serverRedirectRoute(app, config, lang);
webRedirectRoute(app, config, lang);
announcementsRedirectRoute(app, config, lang);
};
76 changes: 36 additions & 40 deletions api/internal_redirect/server.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@
import {hasPermission, setBannerCookie, postAPIRequest} from '../common'
import { hasPermission, postAPIRequest } from "../common";

export default function serverRedirectRoute(app, config, lang) {
const baseEndpoint = '/redirect/server';

app.post(baseEndpoint + '/create', async function(req, res) {
if (!hasPermission('zander.web.server', req, res))
return;
const baseEndpoint = "/redirect/server";

postAPIRequest(
`${process.env.siteAddress}/api/server/create`,
req.body,
`${process.env.siteAddress}/dashboard/servers`,
res
)
app.post(baseEndpoint + "/create", async function (req, res) {
if (!hasPermission("zander.web.server", req, res)) return;

res.redirect(`${process.env.siteAddress}/dashboard/servers`);
postAPIRequest(
`${process.env.siteAddress}/api/server/create`,
req.body,
`${process.env.siteAddress}/dashboard/servers`,
res
);

return res;
});
res.redirect(`${process.env.siteAddress}/dashboard/servers`);

app.post(baseEndpoint + '/edit', async function(req, res) {
if (!hasPermission('zander.web.server', req, res))
return;
return res;
});

postAPIRequest(
`${process.env.siteAddress}/api/server/edit`,
req.body,
`${process.env.siteAddress}/dashboard/servers`,
res
)
app.post(baseEndpoint + "/edit", async function (req, res) {
if (!hasPermission("zander.web.server", req, res)) return;

res.redirect(`${process.env.siteAddress}/dashboard/servers`);
postAPIRequest(
`${process.env.siteAddress}/api/server/edit`,
req.body,
`${process.env.siteAddress}/dashboard/servers`,
res
);

return res;
});
res.redirect(`${process.env.siteAddress}/dashboard/servers`);

app.post(baseEndpoint + '/delete', async function(req, res) {
if (!hasPermission('zander.web.server', req, res))
return;
return res;
});

postAPIRequest(
`${process.env.siteAddress}/api/server/delete`,
req.body,
`${process.env.siteAddress}/dashboard/servers`,
res
)
app.post(baseEndpoint + "/delete", async function (req, res) {
if (!hasPermission("zander.web.server", req, res)) return;

res.redirect(`${process.env.siteAddress}/dashboard/servers`);
postAPIRequest(
`${process.env.siteAddress}/api/server/delete`,
req.body,
`${process.env.siteAddress}/dashboard/servers`,
res
);

return res;
});
res.redirect(`${process.env.siteAddress}/dashboard/servers`);

}
return res;
});
}
27 changes: 13 additions & 14 deletions api/internal_redirect/web.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { postAPIRequest } from '../common'
import { postAPIRequest } from "../common";

export default function webRedirectRoute(app, config, lang) {
const baseEndpoint = '/redirect/web';
const baseEndpoint = "/redirect/web";

app.post(baseEndpoint + '/register', async function(req, res) {
postAPIRequest(
`${process.env.siteAddress}/api/web/register/create`,
req.body,
`${process.env.siteAddress}/register`,
res
)
app.post(baseEndpoint + "/register", async function (req, res) {
await postAPIRequest(
`${process.env.siteAddress}/api/web/register/create`,
req.body,
`${process.env.siteAddress}/register`,
res
);

res.redirect(`${process.env.siteAddress}/register`);
res.redirect(`${process.env.siteAddress}/register`);

return res;
});

}
return res;
});
}
Loading