Skip to content

Commit

Permalink
Merge pull request #1964 from bcgov/feature/grad-collection
Browse files Browse the repository at this point in the history
EGC-3: UI Tile for Grad
  • Loading branch information
arcshiftsolutions authored Oct 2, 2024
2 parents 41d6993 + ef9e603 commit 199dbd1
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ nconf.defaults({
bannerEnvironment: process.env.BANNER_ENVIRONMENT,
bannerColor: process.env.BANNER_COLOR,
disableSdcFunctionality: process.env.DISABLE_SDC_FUNCTIONALITY === 'true',
disableGradFunctionality: process.env.DISABLE_GRAD_FUNCTIONALITY === 'true',
termsOfUseURL: process.env.TERMS_OF_USE,
helpURL: process.env.HELP,
webSocketURL: process.env.WEB_SOCKET_URL,
Expand Down
1 change: 1 addition & 0 deletions backend/src/routes/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ async function getConfig(req, res) {
BANNER_ENVIRONMENT: frontendConfig.bannerEnvironment,
BANNER_COLOR: frontendConfig.bannerColor,
DISABLE_SDC_FUNCTIONALITY: frontendConfig.disableSdcFunctionality,
DISABLE_GRAD_FUNCTIONALITY: frontendConfig.disableGradFunctionality,
TERMS_OF_USE_URL: frontendConfig.termsOfUseURL,
HELP_URL: frontendConfig.helpURL,
WEB_SOCKET_URL: frontendConfig.webSocketURL,
Expand Down
44 changes: 43 additions & 1 deletion frontend/src/components/DashboardTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,43 @@
</v-row>
</v-card>
</v-col>

<v-col
v-if="hasRequiredPermission('GRAD_SCH_EDIT') && isLoggedInSchoolUser && !disableGradFunctionality"
cols="12"
md="6"
>
<v-card
id="graduationCard"
class="mx-auto"
width="25em"
outlined
rounded
@click="openSchoolGraduationCard()"
>
<v-row class="pl-4">
<v-col cols="4">
<div>
<v-icon
icon="mdi-account-school-outline"
aria-hidden="false"
color="rgb(0, 51, 102)"
size="100"
/>
</div>
</v-col>
<v-col class="mt-2">
<v-row no-gutters>
<v-col>
<h4 class="dashboard-title">
{{ PAGE_TITLES.GRADUATION }}
</h4>
</v-col>
</v-row>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-container>
</template>
Expand Down Expand Up @@ -437,7 +474,8 @@ export default {
secureExchangeStatusCode: ''
},
PAGE_TITLES: PAGE_TITLES,
disableSdcFunctionality: null
disableSdcFunctionality: null,
disableGradFunctionality: null
};
},
computed: {
Expand All @@ -461,6 +499,7 @@ export default {
},
created() {
this.disableSdcFunctionality = this.config.DISABLE_SDC_FUNCTIONALITY;
this.disableGradFunctionality = this.config.DISABLE_GRAD_FUNCTIONALITY;
if (this.hasRequiredPermission('SECURE_EXCHANGE')) {
this.getExchangesCount();
}
Expand Down Expand Up @@ -579,6 +618,9 @@ export default {
openSDCDistrictCollection() {
router.push({name: 'sdcDistrictCollectionSummary', params: {districtID: this.userInfo.activeInstituteIdentifier}});
},
openSchoolGraduationCard() {
router.push({name: 'graduation', params: {schoolID: this.userInfo.activeInstituteIdentifier}});
},
getSDCCollectionBySchoolId() {
ApiService.apiAxios.get(ApiRoutes.sdc.SDC_COLLECTION_BY_SCHOOL_ID + `/${this.userInfo.activeInstituteIdentifier}`).then(response => {
if(response.data) {
Expand Down
102 changes: 102 additions & 0 deletions frontend/src/components/graduation/GraduationTableComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<template>
<v-container>
<v-row
justify="start"
align="center"
>
<v-col
v-if="hasRequiredPermission('GRAD_SCH_EDIT') && isLoggedInSchoolUser && !disableGradFunctionality"
cols="12"
md="6"
>
<v-card
id="graduationCard"
class="mx-auto"
width="25em"
outlined
rounded
@click="uploadFiles()"
>
<v-row class="pl-4">
<v-col cols="4">
<div>
<v-icon
icon="mdi-file-upload-outline"
aria-hidden="false"
color="rgb(0, 51, 102)"
size="100"
/>
</div>
</v-col>
<v-col class="mt-2">
<v-row no-gutters>
<v-col>
<h4 class="dashboard-title">
{{ PAGE_TITLES.GRAD_DATA_COLLECTION }}
</h4>
</v-col>
</v-row>
<v-row no-gutters>
<v-col>
<span>Upload Graduation Data Files (DEM, XAM and CRS)</span>
</v-col>
</v-row>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-container>
</template>

<script>
import alertMixin from '../../mixins/alertMixin';
import { authStore } from '../../store/modules/auth';
import { appStore } from '../../store/modules/app';
import { mapState } from 'pinia';
import {PAGE_TITLES} from '../../utils/constants';
export default {
name: 'GraduationTableComponent',
components: {
},
mixins: [alertMixin],
props: {
},
data() {
return {
PAGE_TITLES: PAGE_TITLES,
disableGradFunctionality: null
}
},
computed: {
...mapState(authStore, ['isAuthenticated','userInfo']),
...mapState(appStore, ['config']),
isLoggedInSchoolUser(){
return this.userInfo.activeInstituteType === 'SCHOOL';
}
},
created() {
this.disableGradFunctionality = this.config.DISABLE_GRAD_FUNCTIONALITY;
},
methods: {
hasRequiredPermission(permission){
return (this.userInfo?.activeInstitutePermissions?.filter(perm => perm === permission).length > 0);
},
uploadFiles() {
}
}
};
</script>
<style scoped>
.dashboard-title {
word-break: break-word;
font-size: 20px;
}
.v-container {
max-width: 51.5em !important;
}
</style>
12 changes: 12 additions & 0 deletions frontend/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import AccessSchoolUsersDetailsPage from './components/admin/SchoolUsersAccessDe
import ApiService from './common/apiService';
import SDCDistrictCollectionView from './components/sdcCollection/sdcDistrictCollection/SDCDistrictCollectionView.vue';
import {PERMISSION} from './utils/constants/Permission';
import GraduationTableComponent from './components/graduation/GraduationTableComponent.vue';

// a comment for commit.
const excludeInstituteNameFromPageTitleList=[PAGE_TITLES.SELECTION, PAGE_TITLES.ACTIVATE_USER];
Expand Down Expand Up @@ -316,6 +317,17 @@ const router = createRouter({
requiresAuth: true,
permission: PERMISSION.DISTRICT_SDC_VIEW
},
},
{
path: 'graduation/:schoolID',
name: 'graduation',
component: GraduationTableComponent,
props: true,
meta: {
pageTitle: PAGE_TITLES.GRADUATION,
requiresAuth: true,
permission: PERMISSION.GRAD_SCH_EDIT
},
}
]
},
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ export const PAGE_TITLES = Object.freeze({
DISTRICT_DETAILS:'District Details',
DISTRICT_CONTACTS: 'District Contacts',
SDC:'Student Level Data (1701)',
DATA_COLLECTION: 'Student Level Data Collection (1701)'
DATA_COLLECTION: 'Student Level Data Collection (1701)',
GRADUATION: 'Graduation',
GRAD_DATA_COLLECTION: 'GRAD Data Collection'
});


Expand Down
4 changes: 3 additions & 1 deletion frontend/src/utils/constants/Permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export const PERMISSION = Object.freeze(

EDX_DISTRICT_VIEW: 'EDX_DISTRICT_VIEW',

EDX_DISTRICT_EDIT: 'EDX_DISTRICT_EDIT'
EDX_DISTRICT_EDIT: 'EDX_DISTRICT_EDIT',

GRAD_SCH_EDIT: 'GRAD_SCH_EDIT'
}
);

5 changes: 4 additions & 1 deletion tools/config/update-configmap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,19 @@ then
bannerEnvironment="DEV"
bannerColor="#dba424"
disableSdcFunctionality=false
disableGradFunctionality=false
sldMigrationDate="2021-07-30"
elif [ "$envValue" = "test" ]
then
bannerEnvironment="TEST"
bannerColor="#8d28d7"
disableSdcFunctionality=false
disableGradFunctionality=false
sldMigrationDate="2021-07-30"
elif [ "$envValue" = "prod" ]
then
disableSdcFunctionality=true
disableGradFunctionality=true
sldMigrationDate="2025-02-01"
fi

Expand All @@ -135,7 +138,7 @@ echo Removing key files
rm tempPenBackendkey
rm tempPenBackendkey.pub
echo Creating config map $APP_NAME-backend-config-map
oc create -n $OPENSHIFT_NAMESPACE-$envValue configmap $APP_NAME-backend-config-map --from-literal=IS_RATE_LIMIT_ENABLED="$IS_RATE_LIMIT_ENABLED" --from-literal=RATE_LIMIT_WINDOW_IN_SEC="$RATE_LIMIT_WINDOW_IN_SEC" --from-literal=RATE_LIMIT_LIMIT="$RATE_LIMIT_LIMIT" --from-literal=WEB_SERVER_FRONTEND="$WEB_SERVER_FRONTEND" --from-literal=WEB_SOCKET_URL="$WEB_SOCKET_URL" --from-literal=HELP=$helpURL --from-literal=TERMS_OF_USE=$termsOfUseURL --from-literal=TZ=$TZVALUE --from-literal=CLAMAV_HOST="clamav.$COMMON_NAMESPACE-$envValue.svc.cluster.local" --from-literal=CLAMAV_PORT="3310" --from-literal=BANNER_COLOR=$bannerColor --from-literal=BANNER_ENVIRONMENT=$bannerEnvironment --from-literal=UI_PRIVATE_KEY="$UI_PRIVATE_KEY_VAL" --from-literal=UI_PUBLIC_KEY="$UI_PUBLIC_KEY_VAL" --from-literal=SOAM_CLIENT_ID=$APP_NAME-soam --from-literal=SOAM_CLIENT_SECRET=$edxServiceClientSecret --from-literal=SERVER_FRONTEND="$SERVER_FRONTEND" --from-literal=ISSUER=EDX_Application --from-literal=EDX_API_ENDPOINT="http://edx-api-master.$OPENSHIFT_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/edx" --from-literal=SOAM_PUBLIC_KEY="$formattedPublicKey" --from-literal=SOAM_DISCOVERY=https://$SOAM_KC/auth/realms/$SOAM_KC_REALM_ID/.well-known/openid-configuration --from-literal=SOAM_URL=https://$SOAM_KC --from-literal=STUDENT_API_ENDPOINT="http://student-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/student" --from-literal=DIGITALID_API_ENDPOINT="http://digitalid-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/digital-id" --from-literal=SCHOOL_API_ENDPOINT="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/schools" --from-literal=PEN_SERVICES_API_URL="http://pen-services-api-master.$PEN_NAMESPACE.svc.cluster.local:8080/api/v1/pen-services" --from-literal=INSTITUTE_API_ENDPOINT="http://institute-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/institute" --from-literal=SDC_API_ENDPOINT="http://student-data-collection-api-master.$OPENSHIFT_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/student-data-collection" --from-literal=EMAIL_SECRET_KEY="$JWT_SECRET_KEY" --from-literal=SITEMINDER_LOGOUT_ENDPOINT="$siteMinderLogoutUrl" --from-literal=LOG_LEVEL=info --from-literal=REDIS_HOST=redis --from-literal=REDIS_PORT=6379 --from-literal=TOKEN_TTL_MINUTES=1440 --from-literal=NATS_URL="$NATS_URL" --from-literal=NATS_CLUSTER="$NATS_CLUSTER" --from-literal=SCHEDULER_CRON_STALE_SAGA_RECORD_REDIS="0 0/5 * * * *" --from-literal=MIN_TIME_BEFORE_SAGA_IS_STALE_IN_MINUTES=5 --from-literal=NODE_ENV="openshift" --from-literal=DISABLE_SDC_FUNCTIONALITY="$disableSdcFunctionality" --from-literal=SLD_MIGRATION_DATE="$sldMigrationDate" --dry-run -o yaml | oc apply -f -
oc create -n $OPENSHIFT_NAMESPACE-$envValue configmap $APP_NAME-backend-config-map --from-literal=IS_RATE_LIMIT_ENABLED="$IS_RATE_LIMIT_ENABLED" --from-literal=RATE_LIMIT_WINDOW_IN_SEC="$RATE_LIMIT_WINDOW_IN_SEC" --from-literal=RATE_LIMIT_LIMIT="$RATE_LIMIT_LIMIT" --from-literal=WEB_SERVER_FRONTEND="$WEB_SERVER_FRONTEND" --from-literal=WEB_SOCKET_URL="$WEB_SOCKET_URL" --from-literal=HELP=$helpURL --from-literal=TERMS_OF_USE=$termsOfUseURL --from-literal=TZ=$TZVALUE --from-literal=CLAMAV_HOST="clamav.$COMMON_NAMESPACE-$envValue.svc.cluster.local" --from-literal=CLAMAV_PORT="3310" --from-literal=BANNER_COLOR=$bannerColor --from-literal=BANNER_ENVIRONMENT=$bannerEnvironment --from-literal=UI_PRIVATE_KEY="$UI_PRIVATE_KEY_VAL" --from-literal=UI_PUBLIC_KEY="$UI_PUBLIC_KEY_VAL" --from-literal=SOAM_CLIENT_ID=$APP_NAME-soam --from-literal=SOAM_CLIENT_SECRET=$edxServiceClientSecret --from-literal=SERVER_FRONTEND="$SERVER_FRONTEND" --from-literal=ISSUER=EDX_Application --from-literal=EDX_API_ENDPOINT="http://edx-api-master.$OPENSHIFT_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/edx" --from-literal=SOAM_PUBLIC_KEY="$formattedPublicKey" --from-literal=SOAM_DISCOVERY=https://$SOAM_KC/auth/realms/$SOAM_KC_REALM_ID/.well-known/openid-configuration --from-literal=SOAM_URL=https://$SOAM_KC --from-literal=STUDENT_API_ENDPOINT="http://student-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/student" --from-literal=DIGITALID_API_ENDPOINT="http://digitalid-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/digital-id" --from-literal=SCHOOL_API_ENDPOINT="http://school-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/schools" --from-literal=PEN_SERVICES_API_URL="http://pen-services-api-master.$PEN_NAMESPACE.svc.cluster.local:8080/api/v1/pen-services" --from-literal=INSTITUTE_API_ENDPOINT="http://institute-api-master.$COMMON_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/institute" --from-literal=SDC_API_ENDPOINT="http://student-data-collection-api-master.$OPENSHIFT_NAMESPACE-$envValue.svc.cluster.local:8080/api/v1/student-data-collection" --from-literal=EMAIL_SECRET_KEY="$JWT_SECRET_KEY" --from-literal=SITEMINDER_LOGOUT_ENDPOINT="$siteMinderLogoutUrl" --from-literal=LOG_LEVEL=info --from-literal=REDIS_HOST=redis --from-literal=REDIS_PORT=6379 --from-literal=TOKEN_TTL_MINUTES=1440 --from-literal=NATS_URL="$NATS_URL" --from-literal=NATS_CLUSTER="$NATS_CLUSTER" --from-literal=SCHEDULER_CRON_STALE_SAGA_RECORD_REDIS="0 0/5 * * * *" --from-literal=MIN_TIME_BEFORE_SAGA_IS_STALE_IN_MINUTES=5 --from-literal=NODE_ENV="openshift" --from-literal=DISABLE_SDC_FUNCTIONALITY="$disableSdcFunctionality" --from-literal=DISABLE_GRAD_FUNCTIONALITY="$disableGradFunctionality" --from-literal=SLD_MIGRATION_DATE="$sldMigrationDate" --dry-run -o yaml | oc apply -f -
echo
echo Setting environment variables for $APP_NAME-backend-$SOAM_KC_REALM_ID application
oc -n $OPENSHIFT_NAMESPACE-$envValue set env --from=configmap/$APP_NAME-backend-config-map dc/$APP_NAME-backend-$SOAM_KC_REALM_ID
Expand Down

0 comments on commit 199dbd1

Please sign in to comment.