From 92ce608c662f4e4f2862f29c9673534c9a0243e0 Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Mon, 16 Oct 2023 13:39:33 -0400 Subject: [PATCH 1/3] Bumping version --- VERSION | 2 +- src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 266146b87..9edc58bb1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.3 +1.6.4 diff --git a/src/package.json b/src/package.json index e99df26b8..032749b7b 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "portal-ui", - "version": "1.6.3", + "version": "1.6.4", "private": true, "scripts": { "run": "npm-run-all --parallel dev sass", From 33e20df1c23cf116073e57a42b8be577a58b1267 Mon Sep 17 00:00:00 2001 From: Lisa-Ann B Date: Tue, 17 Oct 2023 18:26:14 -0400 Subject: [PATCH 2/3] Redirect to confirmation page on logout - #982 --- src/components/custom/js/functions.js | 4 ---- src/pages/logout.js | 5 +---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/custom/js/functions.js b/src/components/custom/js/functions.js index c0cb9bd5f..30fb33ddd 100644 --- a/src/components/custom/js/functions.js +++ b/src/components/custom/js/functions.js @@ -332,10 +332,6 @@ export function goToSearch() { goIntent('search') } -export function gotToLogin() { - goIntent('login') -} - export function getEntityViewUrl(entity, uuid, {isEdit = false}) { const pre = isEdit ? '/edit' : '' return pre + "/" + entity?.toLowerCase() + "?uuid=" + uuid diff --git a/src/pages/logout.js b/src/pages/logout.js index 626ae35b0..318cb5f8e 100644 --- a/src/pages/logout.js +++ b/src/pages/logout.js @@ -1,16 +1,13 @@ import { useEffect, useContext } from 'react' import Spinner from '../components/custom/Spinner' import AppContext from '../context/AppContext' -import { gotToLogin } from '../components/custom/js/functions' import { getLogoutURL } from '../config/config' function logout() { const { logout } = useContext(AppContext) useEffect(() => { - const xhr = new XMLHttpRequest() - xhr.open('GET', getLogoutURL(), true) logout() - gotToLogin() + window.location = getLogoutURL() }) return } From 992c4b0bf757cd79e0611fcffa75a6cc83accf79 Mon Sep 17 00:00:00 2001 From: Lisa-Ann B Date: Wed, 18 Oct 2023 11:25:02 -0400 Subject: [PATCH 3/3] Sort group select dropdown, add sortOnProperty function - #981 --- src/components/custom/edit/GroupSelect.js | 7 ++++++- src/components/custom/js/functions.js | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/components/custom/edit/GroupSelect.js b/src/components/custom/edit/GroupSelect.js index 77680dd92..1639324ed 100644 --- a/src/components/custom/edit/GroupSelect.js +++ b/src/components/custom/edit/GroupSelect.js @@ -1,4 +1,4 @@ -import React, {useContext} from 'react'; +import React, {useContext, useEffect} from 'react'; import {QuestionCircleFill} from "react-bootstrap-icons"; import {Form} from 'react-bootstrap'; import SenNetPopover from "../../SenNetPopover"; @@ -6,6 +6,11 @@ import AppContext from "../../../context/AppContext"; const GroupSelect = ({groups, onGroupSelectChange, entity_type, plural}) => { const {cache} = useContext(AppContext) + + useEffect(() => { + groups.sortOnProperty('displayname') + }) + return ( <> diff --git a/src/components/custom/js/functions.js b/src/components/custom/js/functions.js index 30fb33ddd..495086da3 100644 --- a/src/components/custom/js/functions.js +++ b/src/components/custom/js/functions.js @@ -377,6 +377,24 @@ Object.assign(String.prototype, { } }) +Object.assign(Array.prototype, { + sortOnProperty(key) { + return this.sort((a, b) => { + let fa = a[key].toLowerCase(), + fb = b[key].toLowerCase() + + if (fa < fb) { + return -1 + } + if (fa > fb) { + return 1 + } + return 0 + }) + } +}) + + export const flipObj = (obj) => { return Object.keys(obj).reduce((ret, key) => { ret[obj[key]] = key;