Skip to content

Commit

Permalink
disable user updates; remove sponsor solicitation
Browse files Browse the repository at this point in the history
  • Loading branch information
toBeOfUse committed May 2, 2024
1 parent 151ee6a commit 4a929dd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
24 changes: 20 additions & 4 deletions global-includes/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,12 @@ export type Registration = z.infer<typeof FullRegistration>;
const noUpdate = { allowApiUpdate: false };

@Entity<User>("users", {
allowApiCrud: true,
apiPrefilter: () => (
remult.isAllowed([UserRole.Admin, UserRole.Staff]) ? {} : { id: remult.user?.id }
),
// TODO: uncomment this to allow user updates again:
// allowApiCrud: true,
// apiPrefilter: () => (
// remult.isAllowed([UserRole.Admin, UserRole.Staff]) ? {} : { id: remult.user?.id }
// ),
...noUpdate
})
export class User extends EntityBase {
@Fields.uuid()
Expand Down Expand Up @@ -380,6 +382,11 @@ export class User extends EntityBase {

@BackendMethod({ allowed: true })
static async submitRegistration() {

// TODO: uncomment this to allow registrations to be submitted again
return;


const user = remult.user as User;
if (!user) {
throw "Not logged in";
Expand All @@ -396,6 +403,10 @@ export class User extends EntityBase {

@BackendMethod({ allowed: true })
static async withdrawRegistration() {

// TODO: change this to allow registrations to be withdrawn again.
return;

const user = remult.user as User;
if (!user) {
throw "Not logged in";
Expand All @@ -407,6 +418,11 @@ export class User extends EntityBase {

@BackendMethod({allowed: true})
static async uploadResume(base64Resume: string, filename: string) {

// TODO: change this to allow resumes to be submitted again. but see
// also issue #45
return;

const user = remult.user as User;
if (!user) {
throw "Not logged in";
Expand Down
20 changes: 15 additions & 5 deletions public-frontend/src/views/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<Card>
<template #title> Registration for KHE 2024 </template>
<template #content>
<p style="color:red" v-if="registrationClosed">
KHE registration is currently closed! Your profile is
preserved below for archival purposes, but cannot be
changed.
</p>
<label v-if="submissionStatus == 'failed'" style="color: red">Please fill out marked items</label>
<div class="labeled-field">
<span>The email currently associated with your account is: {{ user.email }}</span>
Expand Down Expand Up @@ -219,11 +224,14 @@
</template>
<template #footer>
<div class="action-buttons">
<Button icon="pi pi-check" :label="submissionStatus == 'success' ? 'Revise' : 'Save Draft'" iconPos="right" @click="saveUser" />
<Button :disabled="submissionStatus == 'success'" @click="submissionStatus != 'success' && submitForm()"
icon="pi pi-envelope" :label="submissionStatus == 'success' ? 'Application Submitted!' : 'Submit'" iconPos="right"
:style="(formComplete ? `color: #333; background-color: white;` : '')" />
<Button v-if="submissionStatus == 'success'" label="Withdraw Application" @click="deregister" />
<Button icon="pi pi-check" :label="submissionStatus == 'success' ? 'Revise' : 'Save Draft'"
iconPos="right" @click="saveUser" :disabled=registrationClosed />
<Button :disabled="submissionStatus == 'success' || registrationClosed"
@click="submissionStatus != 'success' && submitForm()"
icon="pi pi-envelope" :label="submissionStatus == 'success' ? 'Application Submitted!' : 'Submit'"
iconPos="right" :style="(formComplete ? `color: #333; background-color: white;` : '')" />
<Button :disabled="registrationClosed" v-if="submissionStatus == 'success'" label="Withdraw Application"
@click="deregister" />
</div>
<p v-if="saveStatus == 'failed'" style="text-align: left; color: red;">
Could not update application! Make sure all fields are filled out.
Expand Down Expand Up @@ -273,6 +281,8 @@ import RadioButton from "primevue/radiobutton";
import FileUpload from "primevue/fileupload";
import failureLabel from "@/components/failureLabel.vue";
// change to re-enable registration!
const registrationClosed = true;
const otherSexuality = ref(false);
const otherRestriction = ref(false);
Expand Down
2 changes: 1 addition & 1 deletion public-frontend/src/views/Sponsor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div style="margin: 100px 40px 50px; text-align: center;">
<h1 style="margin-bottom: 40px">2024 Sponsors</h1>
<Sponsors :showAd="true" />
<Sponsors :showAd="false" />
</div>
</template>

Expand Down

0 comments on commit 4a929dd

Please sign in to comment.