Members
# COMPONENTIDS
Define IDs to identify components in the system. This is used for testing.
# constant docToShortDescription
Return the first sentence of the description field of the passed document, or the passed description if we get a sentence.
# constant ensureFutureAcademicTerms
Ensures that there are AcademicTerms for the next 4 years.
# EXPLORER_FILTER_KEYS
Define Sort keys used to sort the cards in the explorer pages. It is used in Interests, Career Goals, Opportunities and Courses component
# EXPLORER_SORT_KEYS
Define Sort keys used to sort the cards in the explorer pages. It is used in Interests, Career Goals, Opportunities and Courses component
# EXPLORER_TYPE
Define each ExplorerType in the system, this is different from the EXPLORER_TYPE defined in route-constants.ts. This is used for Interests, CareerGoals, Opportunities and Courses pages and components
# EXPLORER_TYPE_ICON
Define icon names for each explorer type
# constant getCourseNumber
Returns the number portion of the getCourseSlug.
# constant getMostPopular
Calculates and returns the number of users associated with Interests, Career Goals, Courses, and Opportunities.
# constant getPlanCount
Returns the count of the given planChoice.
# constant getPublicProfileData
Meteor method used to retrieve public data for a student profile card. Returns an object with fields containing the visible profile data.
# constant getRandomCourseSlug
Returns a random course slug for a random department.
# constant getRandomCourseSlugForDept
Returns a random course slug for the given department.
# constant getRandomDepartment
Returns a random department string.
# constant getSimpleChoiceNumber
Returns the number portion of the getCourseSlug.
# constant getTermsAndConditions
Meteor method used to retrieve the terms and conditions string from a file and return it to the client.
# constant getWhatsNew
Meteor method used to retrieve the terms and conditions string from a file and return it to the client.
# constant makeSampleCareerGoal
Defines a sample CareerGoal.
# constant makeSampleCareerGoalArray
Returns an array of defined CareerGoal ids.
# constant makeSampleCareerGoalSlugArray
Returns an array of defined CareerGoal slugs.
# constant makeSampleCourseSlugArray
Creates an array of defined course slugs.
# constant makeSampleInterestArray
Returns an array of interestIDs.
# constant makeSampleInterestSlugArray
Returns an array of defined Interest slugs.
# constant makeSampleOpportunitySlugArray
Creates an array of defined opportunity slugs.
# constant makeSampleUserArray
Returns an array of defined usernames.
# constant matchKeywords
Returns the keywords that match the internship. This is a very dumb function just filtering the keywords that don't appear in the internship.description.
# PAGEIDS
Define IDs to identify each page in the system. This is used for lastVisited, UserInteractions, and Testing.
# constant routes
Here are the routes for RadGrad2. The keys are the Roles, the values are an array of route information. Route information consists of a path, the path to the component, a Component to render.
# constant sendEmail
Email sender to distribute RadGrad newsletter. Utilizes SSR to compile and render HTML/CSS code within the email.
# constant setPublicProfileData
Meteor method to set a Profile field (usually a "share" field). After setting the share value, generates and returns an object with fields containing the visible profile data.
# constant USER_INTERACTION_DESCRIPTIONS
Provide short documentation string for each User Interaction behavior.
# constant validateCourseSlugFormat
Checks the format of the getCourseSlug. Does not check to see if the slug is defined. Valid course
slugs have the format
# VISIBILITY
The boolean fields in a student's profile used to indicate what's visible.
# WHATS_NEW_FIELDS
What's New is implemented via the following mechanisms:
- This server-side class, which stores the current state of What's New along with updateData() and getData() methods.
- The WhatsNew method, which is called by the client to obtain what's new data via the getData() method.
- The WhatsNew server-side cron job, which updates what's new once a day via updateData().
Methods
# AdminProtectedRoute({)
AdminProtectedRoute (see React Router v4 sample) Checks for Meteor login and admin role before routing to the requested page, otherwise goes to signin page.
Parameters:
Name | Type | Description |
---|---|---|
{ |
any | component: Component, ...rest } |
# CareerGoalLabel(slug, userID, size)
Returns a React Component representing a Career Goal label.
Parameters:
Name | Type | Description |
---|---|---|
slug |
Required slug. Error if not found. |
|
userID |
Optional userID. If provided, then Label will colored if present in the user's profile. |
|
size |
Optional size. Defaults to 'Large'. |
# CompletedVerifications(completedVerifications, username) → {Segment}
Component that naively displays a supplied array of IVerificationRequests and the UI for users to handle them. The parent component is expected to handle permissions and filtering (role and status are not checked in this component).
Parameters:
Name | Type | Description |
---|---|---|
completedVerifications |
Array.<VerificationRequest> | |
username |
string | Current user's username. Used primarily for getting name of user when making changes to records. |
# CourseLabel(slug, userID, size)
Returns a React Component representing a Course label.
Parameters:
Name | Type | Description |
---|---|---|
slug |
Required slug. Error if not found. |
|
userID |
Optional userID. If provided, then Label will colored if present in the user's profile. |
|
size |
Optional size. Defaults to 'Large'. |
# defineAcademicTermsForYear(year)
Defines the academic terms for the given year.
Parameters:
Name | Type | Description |
---|---|---|
year |
number | the year. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# descriptionPairs(item)
Returns an array of Description pairs used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# EventVerifications(eventOpportunities) → {Segment}
This component naively displays a supplied array of IEventOpportunities and a form to verify individual students. The parent component is expected to handle permissions and filtering (eventDate property is not checked in this component).
Parameters:
Name | Type | Description |
---|---|---|
eventOpportunities |
Array.<IEventOpportunity> | An array of IOpportunities where eventDate exists |
# filterByShareField()
Returns a function that is passed a userID and returns true if shareField in their profile is true.
# generatePublicProfileDataObject(username) → {PublicProfileData}
Helper function to create and return an object with fields for all the publicly shared profile data for username.
Parameters:
Name | Type | Description |
---|---|---|
username |
The user who's public data is to be shared. |
# InterestLabel(slug, userID, size)
Returns a React Component representing a Interest label.
Parameters:
Name | Type | Description |
---|---|---|
slug |
Required slug. Error if not found. |
|
userID |
Optional userID. If provided, then Label will colored if present in the user's profile. |
|
size |
Optional size. Defaults to 'Large'. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitle(item)
Returns the ReactNode used in the ListCollectionWidget. By default we indicate if the item is retired.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# itemTitleString(item)
Returns the title string for the item. Used in the ListCollectionWidget.
Parameters:
Name | Type | Description |
---|---|---|
item |
an item from the collection. |
# LandingNavBar()
LandingNavBar rendered on each of the landing pages.
# normalInitialization()
Set up system for operation in a non-testing environment.
# NotAuthorizedPage()
Render a not authorized page if the user enters a URL that they are not allowed to see.
# NotFoundPage()
Render a Not Found page if the user enters a URL that doesn't match any route.
# OpportunityLabel(slug, userID, size)
Returns a React Component representing an Opportunity label.
Parameters:
Name | Type | Description |
---|---|---|
slug |
Required slug. Error if not found. |
|
userID |
Optional userID. If provided, then Label will colored if present in the user's profile. |
|
size |
Optional size. Defaults to 'Large'. |
# PendingVerifications(pendingVerifications) → {Segment}
Component that naively displays a supplied array of IVerificationRequests and the UI for users to handle them. The parent component is expected to handle permissions and filtering (role and status are not checked in this component).
Parameters:
Name | Type | Description |
---|---|---|
pendingVerifications |
Array.<VerificationRequest> |
# PictureField()
Augment the Uniforms TextField with an to support Cloudinary upload for pictures. Adapted from https://github.com/vazco/uniforms/blob/master/packages/uniforms-semantic/src/TextField.tsx
The MIT License (MIT)
Copyright (c) 2016-2019 Vazco
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# ProtectedRoute({)
ProtectedRoute (see React Router v4 sample) Checks for Meteor login before routing to the requested page, otherwise goes to signin page.
Parameters:
Name | Type | Description |
---|---|---|
{ |
any | component: Component, ...rest } |
# ScrollToTop()
Scroll to top when navigating to non-Explorer pages.
# SigninPage()
SigninPage page overrides the form’s submit event and call Meteor’s loginWithPassword(). Authentication errors modify the component’s state to be displayed
# SignoutDidntAgreeToTermsPage()
After the user clicks the "SignoutPage" link in the NavBar, log them out and display this page.
# SignoutPage()
After the user clicks the "SignoutPage" link in the NavBar, log them out and display this page.
# TermsAndConditionsPage()
See https://www.radgrad.org/docs/developers/patterns/components-methods for documentation.
# testModeInitialization()
Set up entities and users appropriately for testing environment.