Remove QR code feature (#14038)

This commit is contained in:
sau226
2022-06-11 05:06:25 +10:00
committed by GitHub
parent 4d10c53216
commit a0884b5d24
5 changed files with 0 additions and 53 deletions

View File

@@ -1,33 +0,0 @@
import superagent from 'superagent';
import nconf from 'nconf';
import {
generateUser,
translate as t,
} from '../../../../helpers/api-integration/v3';
const API_TEST_SERVER_PORT = nconf.get('PORT');
xdescribe('GET /qr-code/user/:memberId', () => {
let user;
before(async () => {
user = await generateUser();
});
it('validates req.params.memberId', async () => {
await expect(user.get('/qr-code/user/invalidUUID')).to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: t('invalidReqParams'),
});
});
it('redirects to profile page', async () => {
const url = `http://localhost:${API_TEST_SERVER_PORT}/qr-code/user/${user._id}`;
const response = await superagent.get(url).end((err, res) => {
expect(err).to.be(undefined);
return res;
});
expect(response.status).to.eql(200);
expect(response.request.url).to.eql(`http://localhost:${API_TEST_SERVER_PORT}/static/front/#?memberId=${user._id}`);
});
});

View File

@@ -40,7 +40,6 @@ function _requestMaker (user, method, additionalSets = {}) {
|| route.indexOf('/paypal') === 0 || route.indexOf('/paypal') === 0
|| route.indexOf('/amazon') === 0 || route.indexOf('/amazon') === 0
|| route.indexOf('/stripe') === 0 || route.indexOf('/stripe') === 0
|| route.indexOf('/qr-code') === 0
|| route.indexOf('/analytics') === 0 || route.indexOf('/analytics') === 0
) { ) {
url += `${route}`; url += `${route}`;

View File

@@ -28,7 +28,6 @@
"deleteAccount": "Delete Account", "deleteAccount": "Delete Account",
"deleteAccPop": "Cancel and remove your Habitica account.", "deleteAccPop": "Cancel and remove your Habitica account.",
"feedback": "If you'd like to give us feedback, please enter it below - we'd love to know what you liked or didn't like about Habitica! Don't speak English well? No problem! Use the language you prefer.", "feedback": "If you'd like to give us feedback, please enter it below - we'd love to know what you liked or didn't like about Habitica! Don't speak English well? No problem! Use the language you prefer.",
"qrCode": "QR Code",
"dataExport": "Data Export", "dataExport": "Data Export",
"saveData": "Here are a few options for saving your data.", "saveData": "Here are a few options for saving your data.",
"habitHistory": "Habit History", "habitHistory": "Habit History",

View File

@@ -1,17 +0,0 @@
const api = {};
api.redirectProfileQRCode = {
method: 'GET',
url: '/qr-code/user/:memberid',
runCron: false,
async handler (req, res) {
req.checkParams('memberid', res.t('memberIdRequired')).notEmpty().isUUID();
const validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;
res.redirect(301, `/static/front/#?memberId=${req.params.memberid}`);
},
};
export default api;

View File

@@ -13,7 +13,6 @@ const TOP_LEVEL_ROUTES = [
'/stripe', '/stripe',
'/export', '/export',
'/email', '/email',
'/qr-code',
// logout, old-client // logout, old-client
// and /static/user/auth/local/reset-password-set-new-one don't need the not found // and /static/user/auth/local/reset-password-set-new-one don't need the not found
// handler because they don't have any child route // handler because they don't have any child route