diff --git a/backend/src/components/edx/exchange.js b/backend/src/components/edx/exchange.js index 1ef672401..0b868e873 100644 --- a/backend/src/components/edx/exchange.js +++ b/backend/src/components/edx/exchange.js @@ -510,7 +510,8 @@ async function districtUserActivationInvite(req, res) { } const payload = { - ...req.body + ...req.body, + edxUserExpiryDate: req.body.edxUserExpiryDate }; try { const response = await utils.postData(token, config.get('server:edx:districtUserActivationInviteURL'), payload, null, utils.getUser(req).idir_username); @@ -536,7 +537,8 @@ async function schoolUserActivationInvite(req, res) { } const payload = { - ...req.body + ...req.body, + edxUserExpiryDate: req.body.edxUserExpiryDate }; try { const response = await utils.postData(token, config.get('server:edx:schoolUserActivationInviteURL'), payload, null, utils.getUser(req).idir_username); @@ -580,6 +582,7 @@ async function updateEdxUserSchoolRoles(req, res) { selectedUserSchool.updateDate = null; selectedUserSchool.createDate = null; + selectedUserSchool.expiryDate = req.body.params.expiryDate; const result = await utils.putData(token, `${config.get('server:edx:edxUsersURL')}/${selectedUserSchool.edxUserID}/school`, selectedUserSchool, userInfo.idir_username); return res.status(HttpStatus.OK).json(result); @@ -621,6 +624,7 @@ async function updateEdxUserDistrictRoles(req, res) { selectedUserDistrict.updateDate = null; selectedUserDistrict.createDate = null; + selectedUserDistrict.expiryDate = req.body.params.expiryDate; const result = await utils.putData(token, `${config.get('server:edx:edxUsersURL')}/${selectedUserDistrict.edxUserID}/district`, selectedUserDistrict, userInfo.idir_username); return res.status(HttpStatus.OK).json(result); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7d92530ac..8e61fe281 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -12,6 +12,7 @@ "@fortawesome/fontawesome-free": "6.4.0", "@js-joda/core": "^5.5.3", "@mdi/font": "^7.2.96", + "@vuepic/vue-datepicker": "^4.2.0", "axios": "^1.4.0", "chart.js": "^4.3.0", "chartjs-plugin-datalabels": "^2.2.0", @@ -43,7 +44,6 @@ "vue-meta": "^3.0.0-alpha.10", "vue-quick-chat": "^1.2.8", "vue-router": "^4.2.2", - "vue3-treeview": "^0.4.1", "vuetify": "npm:@vuetify/nightly@3.3.5-pr-17265.042d482" }, "devDependencies": { @@ -569,6 +569,22 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/runtime": { + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.1.tgz", + "integrity": "sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime/node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "node_modules/@babel/template": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", @@ -2239,6 +2255,21 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" }, + "node_modules/@vuepic/vue-datepicker": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@vuepic/vue-datepicker/-/vue-datepicker-4.5.1.tgz", + "integrity": "sha512-zdG37Q8iuwTPWnQEI9/WvabqmrDDfDLgdXUTW08FXHSbiHuNN2S+bVeN1Wm9yeD+onHgzEn6DiW6J3fYXEfa0Q==", + "dependencies": { + "date-fns": "^2.29.3", + "date-fns-tz": "^1.3.7" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "vue": ">=3.2.0" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -3097,6 +3128,29 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, + "node_modules/date-fns-tz": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-1.3.8.tgz", + "integrity": "sha512-qwNXUFtMHTTU6CFSFjoJ80W8Fzzp24LntbjFFBgL/faqds4e5mo9mftoRLgr3Vi1trISsg4awSpYVsOQCRnapQ==", + "peerDependencies": { + "date-fns": ">=2.0.0" + } + }, "node_modules/de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", @@ -6652,32 +6706,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.eq": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash.eq/-/lodash.eq-4.0.0.tgz", - "integrity": "sha512-vbrJpXL6kQNG6TkInxX12DZRfuYVllSxhwYqjYB78g2zF3UI15nFO/0AgmZnZRnaQ38sZtjCiVjGr2rnKt4v0g==" - }, - "node_modules/lodash.isnil": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash.isnil/-/lodash.isnil-4.0.0.tgz", - "integrity": "sha512-up2Mzq3545mwVnMhTDMdfoG1OurpA/s5t88JmQX809eH3C8491iu2sfKhTfhQtKY78oPNhiaHJUpT/dUDAAtng==" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.tointeger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.tointeger/-/lodash.tointeger-4.0.4.tgz", - "integrity": "sha512-UQbTdxNHMm4jGlf+LtxB5ZPJFufuND2gZCYjMxSOUmcxfq350x9KnwL3EzxDDNth8fOZ9wpwDTGWZQnFgdV3gg==" - }, - "node_modules/lodash.uniqueid": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.uniqueid/-/lodash.uniqueid-4.0.1.tgz", - "integrity": "sha512-GQQWaIeGlL6DIIr06kj1j6sSmBxyNMwI8kaX9aKpHR/XsMTiaXDVPNPAkiboOTK9OJpTJF/dXT3xYoFQnj386Q==" - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8420,18 +8454,6 @@ "he": "^1.2.0" } }, - "node_modules/vue3-treeview": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/vue3-treeview/-/vue3-treeview-0.4.1.tgz", - "integrity": "sha512-IUQN9Gzqxr66Qc6l+Js+ZBo57q5dHmiyD6FBRdt2WRnmMZ+wRtZ2UuwdLMiuGBT6gOVEzL7ucLIZGPZyKyyI4g==", - "dependencies": { - "lodash.eq": "^4.0.0", - "lodash.isnil": "^4.0.0", - "lodash.tointeger": "^4.0.4", - "lodash.uniqueid": "^4.0.1", - "vue": "^3.1.2" - } - }, "node_modules/vuetify": { "name": "@vuetify/nightly", "version": "3.3.5-pr-17265.042d482", @@ -9056,6 +9078,21 @@ "@babel/helper-plugin-utils": "^7.19.0" } }, + "@babel/runtime": { + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.1.tgz", + "integrity": "sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==", + "requires": { + "regenerator-runtime": "^0.14.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, "@babel/template": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", @@ -10270,6 +10307,15 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" }, + "@vuepic/vue-datepicker": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@vuepic/vue-datepicker/-/vue-datepicker-4.5.1.tgz", + "integrity": "sha512-zdG37Q8iuwTPWnQEI9/WvabqmrDDfDLgdXUTW08FXHSbiHuNN2S+bVeN1Wm9yeD+onHgzEn6DiW6J3fYXEfa0Q==", + "requires": { + "date-fns": "^2.29.3", + "date-fns-tz": "^1.3.7" + } + }, "@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -10929,6 +10975,20 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "requires": { + "@babel/runtime": "^7.21.0" + } + }, + "date-fns-tz": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-1.3.8.tgz", + "integrity": "sha512-qwNXUFtMHTTU6CFSFjoJ80W8Fzzp24LntbjFFBgL/faqds4e5mo9mftoRLgr3Vi1trISsg4awSpYVsOQCRnapQ==", + "requires": {} + }, "de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", @@ -13557,32 +13617,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "lodash.eq": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash.eq/-/lodash.eq-4.0.0.tgz", - "integrity": "sha512-vbrJpXL6kQNG6TkInxX12DZRfuYVllSxhwYqjYB78g2zF3UI15nFO/0AgmZnZRnaQ38sZtjCiVjGr2rnKt4v0g==" - }, - "lodash.isnil": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash.isnil/-/lodash.isnil-4.0.0.tgz", - "integrity": "sha512-up2Mzq3545mwVnMhTDMdfoG1OurpA/s5t88JmQX809eH3C8491iu2sfKhTfhQtKY78oPNhiaHJUpT/dUDAAtng==" - }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "lodash.tointeger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.tointeger/-/lodash.tointeger-4.0.4.tgz", - "integrity": "sha512-UQbTdxNHMm4jGlf+LtxB5ZPJFufuND2gZCYjMxSOUmcxfq350x9KnwL3EzxDDNth8fOZ9wpwDTGWZQnFgdV3gg==" - }, - "lodash.uniqueid": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.uniqueid/-/lodash.uniqueid-4.0.1.tgz", - "integrity": "sha512-GQQWaIeGlL6DIIr06kj1j6sSmBxyNMwI8kaX9aKpHR/XsMTiaXDVPNPAkiboOTK9OJpTJF/dXT3xYoFQnj386Q==" - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -14756,18 +14796,6 @@ "he": "^1.2.0" } }, - "vue3-treeview": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/vue3-treeview/-/vue3-treeview-0.4.1.tgz", - "integrity": "sha512-IUQN9Gzqxr66Qc6l+Js+ZBo57q5dHmiyD6FBRdt2WRnmMZ+wRtZ2UuwdLMiuGBT6gOVEzL7ucLIZGPZyKyyI4g==", - "requires": { - "lodash.eq": "^4.0.0", - "lodash.isnil": "^4.0.0", - "lodash.tointeger": "^4.0.4", - "lodash.uniqueid": "^4.0.1", - "vue": "^3.1.2" - } - }, "vuetify": { "version": "npm:@vuetify/nightly@3.3.5-pr-17265.042d482", "resolved": "https://registry.npmjs.org/@vuetify/nightly/-/nightly-3.3.5-pr-17265.042d482.tgz", diff --git a/frontend/src/components/secure-message/AccessUserCard.vue b/frontend/src/components/secure-message/AccessUserCard.vue index 5e06938cf..ef0516c5a 100644 --- a/frontend/src/components/secure-message/AccessUserCard.vue +++ b/frontend/src/components/secure-message/AccessUserCard.vue @@ -92,7 +92,8 @@ class="pt-2" :style="[editState ? {'background-color': '#e7ebf0'} : {'background-color': 'white'}]" > - +
+ - + + mdi-delete-clock-outline + + {{ formatExpiryDate(getExpiryDate(user)) }} +

+
+ +
+
+ + + + 0) { return this.instituteRoles.find((role) => role.edxRoleCode === curRole.edxRoleCode).label; @@ -344,6 +380,9 @@ export default { this.deleteState = false; this.relinkState = !this.relinkState; }, + formatExpiryDate(date) { + return formatDate(date, this.from, this.pickerFormat); + }, clickActionRelinkButton() { this.isRelinking = true; const payload = { @@ -405,7 +444,8 @@ export default { const payload = { params: { edxUserID: this.user.edxUserID, - selectedRoles: this.selectedRoles + selectedRoles: this.selectedRoles, + expiryDate: this.accessExpiryDate } }; let url = Routes.edx.EXCHANGE_ACCESS_ROLES_URL; @@ -440,7 +480,11 @@ export default { }); this.selectedRoles = [...mySelection]; - } + this.accessExpiryDate = this.user.edxUserSchools[0].expiryDate; + }, + clearExpiryDate(){ + this.accessExpiryDate = null; + }, } }; @@ -470,5 +514,10 @@ export default { transform: scale(1); } } + +.expiry-date { + color: grey; + text-align: right; +} diff --git a/frontend/src/components/secure-message/InviteUserPage.vue b/frontend/src/components/secure-message/InviteUserPage.vue index d2397e9fc..34d48bba9 100644 --- a/frontend/src/components/secure-message/InviteUserPage.vue +++ b/frontend/src/components/secure-message/InviteUserPage.vue @@ -114,6 +114,15 @@ + + @@ -155,12 +164,14 @@ import {Routes} from '@/utils/constants'; import {mapState} from 'pinia'; import {authStore} from '@/store/modules/auth'; import {appStore} from '@/store/modules/app'; +import DatePicker from '../util/DatePicker.vue'; export default { name: 'InviteUserPage', components: { PrimaryButton, ConfirmationDialog, + DatePicker }, mixins: [alertMixin], props: { @@ -207,7 +218,8 @@ export default { processing: false, edxAdminUserCode: '', rolesHint: 'Pick the roles to be assigned to the new user', - emailHint: 'Valid Email Required' + emailHint: 'Valid Email Required', + accessExpiryDate: null }; }, mounted() { @@ -286,7 +298,8 @@ export default { firstName: this.firstName, lastName: this.lastName, email: this.email, - edxActivationRoleCodes: this.edxActivationRoleCodes + edxActivationRoleCodes: this.edxActivationRoleCodes, + edxUserExpiryDate: this.accessExpiryDate }; let url = null; if (this.instituteTypeCode === 'SCHOOL') { @@ -316,6 +329,9 @@ export default { const isValid = this.$refs.newUserForm.validate(); this.isValidForm = isValid.valid; }, + clearExpiryDate(){ + this.accessExpiryDate = null; + }, } }; diff --git a/tools/config/update-configmap.sh b/tools/config/update-configmap.sh index fa43033d8..db285337f 100644 --- a/tools/config/update-configmap.sh +++ b/tools/config/update-configmap.sh @@ -278,7 +278,7 @@ elif [ "$envValue" = "test" ]; then bannerEnvironment="TEST" bannerColor="#58fe01" SCHEDULER_CRON_DOC_TYPE_MIGRATION="0 0 0 * * *" - disableSdcFunctionality=false + disableSdcFunctionality=true else SCHEDULER_CRON_DOC_TYPE_MIGRATION="0 0 0 17 9 *" disableSdcFunctionality=true