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

Remove feature flag and change the ranking initial date #125

Merged
merged 5 commits into from
Nov 5, 2024
Merged
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
10 changes: 1 addition & 9 deletions components/SuccessDonation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ import { red } from "@material-ui/core/colors";
import axios from "axios";
import styles from "./Form.module.css";

import RoxContainer from "../services/rox/RoxContainer";
import service from "../services/rox/RoxService";
import { DonationContext } from "./contexts/DonationContext";

service(RoxContainer);

function createYearList(): Array<number> {
const year = new Date().getFullYear();
const range = 89;
Expand Down Expand Up @@ -109,8 +105,6 @@ export const SuccessDonation = () => {
const [errorUrl, setErrorUrl] = useState(false);

const isUserAlreadyRegistered = () => donation.userExists.value;
const registrationFlagEnabled = () =>
JSON.parse(RoxContainer.shouldShowRegistrationForm.getValue());

const yearsList = createYearList();

Expand Down Expand Up @@ -242,9 +236,7 @@ export const SuccessDonation = () => {
<h1>Muito obrigado!</h1>
<p>Agradecemos por escolher fazer parte dessa iniciativa.</p>
<p>Enviaremos também um email de confirmando sua doação.</p>
{registrationFlagEnabled() &&
!isUserAlreadyRegistered() &&
!signupFinish ? (
{!isUserAlreadyRegistered() && !signupFinish ? (
<>
<p>
Conclua o seu cadastro para somar pontos à sua turma no Ranking
Expand Down
1 change: 1 addition & 0 deletions pages/api/contributions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async function runCreateContribution(
const prismaClient: PrismaClient = req.scope.resolve("dbClient");
const validator = CreateContributionSchema.destruct();
const [err, args] = validator(req.body);

if (!err && args) {
let birthday: Date | undefined = new Date(args.dob);
if (!isValidBirthday(birthday)[0]) {
Expand Down
3 changes: 2 additions & 1 deletion pages/api/ranking/contants.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const RANKING_INITIAL_DATA = new Date("2024-06-10");
// TODO: transform to feature flag
export const RANKING_INITIAL_DATA = new Date("2024-10-31");
Loading