daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Jan 18th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. decideState(data) {
  2.     if (data.status === '0_pending') {
  3.       return {
  4.         projectCardClass: null,
  5.         projectName: data.project.projectName,
  6.         projectDescription: data.project.projectDescription,
  7.         showUnivSubmission: data.universitySubmission,
  8.         showDate: true,
  9.         submissionDateText: data.nextSubmissionDate ? 'NEXT SUBMISSION ON' : 'FINAL SUBMISSION ON',
  10.         showFinalSubmissionTooltip: !data.nextSubmissionDate,
  11.         submissionDate: data.nextSubmissionDate || data.dueOn,
  12.         timeLeftString: this.getTimeLeftString(data.nextSubmissionDate, data.currentTime),
  13.         showObjectivesAchievedProgressBar: true,
  14.         totalObjectives: data.projectObjectiveMetaInformation.totalCount,
  15.         correctlyDoneObjectives: data.projectObjectiveMetaInformation.completedCount,
  16.         showObjectivesWithoutProgressBar: false,
  17.         showMarksObtained: false,
  18.         marksObtained: null,
  19.         showButton: true,
  20.         objectivesPageUrl: '/student/projects/objectives/' + data.id,
  21.         showLink: false,
  22.         buttonText: 'View Objectives',
  23.         linkText: null,
  24.         showBottomNotification: data.isLastSubmissionMissed,
  25.         bottomNotificationText: 'You missed the last submission.',
  26.         bottomNotificationClass: 'av-project-warning'
  27.       };
  28.     }
  29.  
  30.     if (data.status === '1_submitted') {
  31.       let bottomNotificationDetails = this.getBottomNotificationDetails(data);
  32.       return {
  33.         projectCardClass: data.isInvalidUrl ? 'av-project-resubmission-card' : null,
  34.         projectName: data.project.projectName,
  35.         projectDescription: data.project.projectDescription,
  36.         showUnivSubmission: data.universitySubmission,
  37.         showDate: true,
  38.         submissionDateText: data.nextSubmissionDate ? 'NEXT SUBMISSION ON' : 'FINAL SUBMISSION ON',
  39.         showFinalSubmissionTooltip: !data.nextSubmissionDate,
  40.         submissionDate: data.nextSubmissionDate || data.dueOn,
  41.         timeLeftString: this.getTimeLeftString(data.nextSubmissionDate, data.currentTime),
  42.         showObjectivesAchievedProgressBar: true,
  43.         totalObjectives: data.projectObjectiveMetaInformation.totalCount,
  44.         correctlyDoneObjectives: data.projectObjectiveMetaInformation.completedCount,
  45.         showObjectivesWithoutProgressBar: false,
  46.         showMarksObtained: false,
  47.         marksObtained: null,
  48.         showButton: true,
  49.         objectivesPageUrl: '/student/projects/objectives/' + data.id,
  50.         showLink: false,
  51.         buttonText: data.isInvalidUrl ? 'Resubmit Project': 'View Objectives',
  52.         linkText: null,
  53.         showBottomNotification: bottomNotificationDetails.showBottomNotification,
  54.         bottomNotificationText: bottomNotificationDetails.bottomNotificationText,
  55.         bottomNotificationClass: bottomNotificationDetails.bottomNotificationClass
  56.       }
  57.     }
  58.  
  59.     if (data.status === '2_evaluated') {
  60.       return {
  61.         projectCardClass: null,
  62.         projectName: data.project.projectName,
  63.         projectDescription: data.project.projectDescription,
  64.         showUnivSubmission: data.universitySubmission,
  65.         showDate: false,
  66.         submissionDateText: null,
  67.         showFinalSubmissionTooltip: false,
  68.         submissionDate: null,
  69.         timeLeftString: null,
  70.         showObjectivesAchievedProgressBar: false,
  71.         totalObjectives: data.projectObjectiveMetaInformation.totalCount,
  72.         correctlyDoneObjectives: data.projectObjectiveMetaInformation.completedCount,
  73.         showObjectivesWithoutProgressBar: true,
  74.         showMarksObtained: true,
  75.         marksObtained: data.evaluation.overallScore.toFixed(2) + '/10',
  76.         showButton: false,
  77.         objectivesPageUrl: '/student/projects/objectives/' + data.id,
  78.         showLink: true,
  79.         buttonText: data.isInvalidUrl ? 'Resubmit Project': 'View Objectives',
  80.         linkText: 'View Evaluations',
  81.         showBottomNotification: data.showNotification,
  82.         bottomNotificationText: 'Your project has been evaluated, check your result now.',
  83.         bottomNotificationClass: null
  84.       }
  85.     }
  86.   }
RAW Paste Data
Top