Skip to content

Commit

Permalink
Release 1.16.0 (#745)
Browse files Browse the repository at this point in the history
* fixed modal layout issues on wide modals (#603)

* ARACHNE-2646. Fixed resetting select on blur (#605)

* Updated dep version (arachne-ui-components) (#609)

* fixed region select (#612)

* update version to 1.13.1-QA (#622)

* Update version to 1.13.1 (#623)

* update version for 1.13.1 release (#625)

* update arachne-ui-components dependency version for 1.13.1 release

* update arachne-ui-components dependency version for 1.13.1 release

* Fixed prefilling of data in edit DS form (#620)

* Fixed height of code files list (#618)

* 1.14.0-QA (#646)

* Fixed Import list in Analysis (#652)
(cherry picked from commit 54d20ee)

* Version increment

* Fixed Import list in Analysis #2 (#653)
(cherry picked from commit ca28f9b)

* Fixes layout of Analysis Summary when CSV viewer is used (#655)
(cherry picked from commit 66fad00)

* Fix package.json

* Fixed bottom padding in 'Add data source' modal (#657)
(cherry picked from commit 659d594)

* Fixed overflow in 'Add manual datasource' modal (#656)
(cherry picked from commit 419ee12)

* Version increment

* Fixed display of Achilles Dashboard and Heracles Heel Report (#658)
(cherry picked from commit ccd6af6)

* Fixed user menu rendering (#659)

* bump npm package version for publishing (#661)

* QA 1.15.0 (#683)

* Changed order of tabs in submission modal (#690)

* Added confirmation modal before removal of atlas (#689)

* Adds CDM v5.3.1 type (#688)

* Added scroll to code files list (#692)

* Increase version

* Fixes results summary block for IRs with multiple target/outcome cohorts (#693)

* Add default label in case of invalid IR result info (#694)

* Added support to upload keyfile for BigQuery (#697)

* Fixed addition of IMPALA datasource (#698)

* Arachne 2729 iap auth support (#703)

* ARACHNE-2729 Add IAP auth support into Standalone Node

* ARACHNE-2729 Add IAP auth support into Standalone Node
- show alert for iap unauthorized exception.

* ARACHNE-2729 Add IAP auth support into Standalone Node
- add AuthMode method

* set qa prefix for version in frontend

* ARACHNE-2729 Add IAP auth support into Standalone Node (#707)

* ARACHNE-2729 Add IAP auth support into Standalone Node
- fix for handel user not authorized exception

* Issue 2715 no connection check for new data source
- update version in package.json

* QA 1.16.0 (#739)

* Added redirect for non-existing page

* ARACHNE-2520. Fixed reinitializing of kindpromise

* ARACHNE-2520. Incremented version to 1.13.77

* Version changed to 1.13.77

* no message

* New version: 1.14.0

* Version changed to 1.14.1

* updated version

* Version changed to 1.14.2

* ARACHNE-2541. Fixed selection of deleted datasources

* ARACHNE-2541. Fixed permission check in submission group list

* ARACHNE-2541. NOw insight cannot be reached by dsowner from another ds

* ARACHNE-2541. Reverted forgotten code

* Version changed to 1.14.3

* Update package.json

fixed auto-increment

* Update package.json

fixed auto-increment

* Version changed to 1.14.5

* ARACHNE-2548. Fixed IR fails in Oracle and schroot (#539)

* Version changed to 1.14.7

* Fixed document loading (#548)

* Version changed to 1.14.9

* fixed modelType and cdmVersion attribute types

* Version changed to 1.14.10

* use breadcrumbs builder from utils

* Version changed to 1.14.11

* ARACHNE-2497. User creation in admin panel doesn't clean filters but updates user list (#560)

* Version changed to 1.14.13

* added reload of atlases list after checking connection

* Version changed to 1.14.14

* Added empty states for permission denied cases [back_merge]  (#564)

* Version changed to 1.14.15

* Block UI for not permitted actions [back_merge] (#562)

* Version changed to 1.14.16

* fixed build (#568)

* Version changed to 1.14.17

* ARACHNE-2524. Fixed wrong page redirection [back_merge] (#570)

* Version changed to 1.14.18

* Fixed pagination in submissions list [back_merge] (#574)

* Version changed to 1.14.19

* ARACHNE-2564. Added new reg form fields [back_merge] (#572)

* Version changed to 1.14.20

* Reordering of registration form fields (#576)

* Version changed to 1.14.22

* ARACHNE-2564. Added new fields into Users section of Admin panel [back_merge] (#578)

* Version changed to 1.14.24

* Tab ordering for Registration form fields  (#579) (#580)

* Version changed to 1.14.26

* ARACHNE-2579, ARACHNE-2581, ARACHNE-2583, ARACHNE-2587, ARACHNE-2596. Bugfixing [back-merge] (#582)

* fixed circumstances for publishing an insight

* ARACHNE-2581 Show message about absent DS-es
fixed role warning
ARACHNE-2583 Broken link to the analysis from a insight of submission
ARACHNE-2587 Achilles charts styling issues

* added empty state to expert finder
fixed page size in report tables
attempt to fix pie chart colors

* ARACHNE-2579 [Central] Incorrect CDM warning

* ARACHNE-2596 [front] Fix the year

* ARACHNE-2597. Fixed opening of the Workspace [back_merge] (#584)

* Version changed to 1.14.27

* ARACHNE-2584. Fixed wrong import (#587)

* Version changed to 1.14.28

* fixed reloading of the insights list

* ARACHNE-2606 Loader is not shown while data for My Workspace is being retrieved

* ARACHNE-2604 Page buttons in PDF viewer change location on zoom

* ARACHNE-2602 Count of result documents

* attempt to fix colors of the pie charts

* fixed import error
2608 cannot attach ds

* Version changed to 1.14.29

* Forgotten file
(cherry picked from commit f692176)

* Version changed to 1.14.30

* [back_merge] ARACHNE-2629. Fixed blanking image in Media viewer (#597)

fixed image positioning

* Version changed to 1.14.31

* [back_merge] ARACHNE-2602. Fixed keys on listed elements (#599)

Fixed keys on listed elements

* Version changed to 1.14.32

* [back_merge] fixed markup for expert finder (#595)

fixed markup for expert finder

* Version changed to 1.14.33

* [back_merge] ARACHNE-2625. Made fields mandatory on registration form (#593)

Made fields mandatory on registration form

* Version changed to 1.14.34

* ARACHNE-2625. Removed extra 'required' (#601)

* Version changed to 1.14.35

* ARACHNE-2646. Fixed reset on blur [back-merge] (#608)

* Version changed to 1.14.36

* Fixed height of code files list (#617)

* Version changed to 1.14.37

* Fixed prefilling of data in edit DS form (#619)

* Version changed to 1.14.38

* ARACHNE-2645 fix workspace breadcrumb creation algorithm (#627)

* Version changed to 1.14.39

* Fixes Country field in Registration form (#631)

* Version changed to 1.14.40

* Fixed markup issue with modal dropdowns (#629)

* Version changed to 1.14.41

* ARACHNE-593. Allows adding owners to manual Node (#630)

* ARACHNE-593. Allows adding owners to manual Node

* Review fixes

* Version changed to 1.14.42

* Fixed horizontal scroll in File viewer (#638)

* Version changed to 1.14.43

* Fixed overflow for 'Add owner' modal at Edit DS page (#633)

* Version changed to 1.14.44

* Backmerge of fixes from 1.13 QA (#640)

* Version changed to 1.14.45

* Fixed loader when reimporting analysis (#642)

* Version changed to 1.14.46

* Fixes latest back-merge (#644)

* Version changed to 1.14.47

* Implements new CC import (#624)

* Fixed tooltip for Download button in Analysis files (#637)

* Fixed user menu rendering (#643)

* Version changed to 1.14.48

* Fixed horizontal scrollbar in File viewer on reload (#645)

* Version changed to 1.14.49

* Improved styling for csv table (#648)

* Version changed to 1.14.50

* Fixed Import list in Analysis (#652)

* Version changed to 1.14.51

* Fixed Import list in Analysis #2 (#653)

* Version changed to 1.14.52

* Fixes layout of Analysis Summary when CSV viewer is used (#655)

* Version changed to 1.14.53

* Fixed bottom padding in 'Add data source' modal (#657)

* Version changed to 1.14.54

* Fixed overflow in 'Add manual datasource' modal (#656)

* Version changed to 1.14.55

* Fixed display of Achilles Dashboard and Heracles Heel Report (#658)

* Version changed to 1.14.56

* Back merge from 1.14 & version increment (#663)

* Version changed to 1.15.1

* Updated atlascharts and arachne-ui-components versions (#665)

* Version changed to 1.15.2

* Updated arachne-ui-components version (#666)

* Version changed to 1.15.3

* Update readme documentation for the Community Edition (#667)

* Update readme documentation for the Community Edition

* update readme with the actual guide

* update readme with the actual guide

* update readme with the actual guide

* Version changed to 1.15.4

* Update readme documentation (#669)

* Update readme documentation for the Community Edition

* update readme with the actual guide

* update readme with the actual guide

* update readme with the actual guide

* update readme with the actual guide

* Version changed to 1.15.5

* Sync token refresh (#670)

* Version changed to 1.15.7

* Analysis submission via Datanode (#668)

* Version changed to 1.15.8

* Added ability to upload zip with result files (#671)

* Version changed to 1.15.9

* Added ability to submit unarchived files for execution (#673)

* Version changed to 1.15.10

* Adds support for Node standalone mode (#672)

* Version changed to 1.15.12

* Fixes Data source details are not cleaned up from DS creation popup (#676)

* Version changed to 1.15.13

* Prohibits update of published Data source name in Standalone mode (#678)

* Version changed to 1.15.14

* make import button disabled if import attempt failed

* Version changed to 1.15.15

* ARACHNE User manual

ARACHNE user manual - will need to figure out where this file will long longer term

* ARACHNE Deployment Guide

ARACHNE de,ployment Guide. To join the OHDSI Network, sites only need to be installing the Data Node component

* fix drilldown details retrieval for measurements

* update npm packages version to 1.15.16

* Changed order of tabs in submission modal (#686)

* Added confirmation modal before removal of atlas (#687)

* Added scroll to code files list (#691)

* Version changed to 1.15.17

* Back merge release 1.15.0 (#701)

* updated package version

* Forgotten file

* ARACHNE-2625. Made fields mandatory on registration form (#592)

* ARACHNE-2625. Removed extra required; updated versions

* ARACHNE-2629. Fixed blanking image in Media viewer (#596)

fixed image positioning

* ARACHNE-2602. Fixed keys on listed elements (#598)

* ARACHNE-2620. Fixed markup for expert finder (#594)

* ARACHNE-2629. Image viewer fixes (#600)

Fixed image viewer issues

* fixed modal layout issues on wide modals (#603)

* ARACHNE-2646. Fixed resetting select on blur (#605)

* Updated dep version (arachne-ui-components) (#609)

* fixed region select (#612)

* update version to 1.13.1-QA (#622)

* Update version to 1.13.1 (#623)

* update version for 1.13.1 release (#625)

* update arachne-ui-components dependency version for 1.13.1 release

* update arachne-ui-components dependency version for 1.13.1 release

* Fixed prefilling of data in edit DS form (#620)

* Fixed height of code files list (#618)

* 1.14.0-QA (#646)

* Fixed Import list in Analysis (#652)
(cherry picked from commit 54d20ee)

* Version increment

* Fixed Import list in Analysis #2 (#653)
(cherry picked from commit ca28f9b)

* Fixes layout of Analysis Summary when CSV viewer is used (#655)
(cherry picked from commit 66fad00)

* Fix package.json

* Fixed bottom padding in 'Add data source' modal (#657)
(cherry picked from commit 659d594)

* Fixed overflow in 'Add manual datasource' modal (#656)
(cherry picked from commit 419ee12)

* Version increment

* Fixed display of Achilles Dashboard and Heracles Heel Report (#658)
(cherry picked from commit ccd6af6)

* Fixed user menu rendering (#659)

* bump npm package version for publishing (#661)

* QA 1.15.0 (#683)

* Changed order of tabs in submission modal (#690)

* Added confirmation modal before removal of atlas (#689)

* Adds CDM v5.3.1 type (#688)

* Added scroll to code files list (#692)

* Increase version

* Fixes results summary block for IRs with multiple target/outcome cohorts (#693)

* Add default label in case of invalid IR result info (#694)

* Added support to upload keyfile for BigQuery (#697)

* Fixed addition of IMPALA datasource (#698)

* Version changed to 1.16.1

* Implements New pathway (#664)

* Implements new CC import

* added cohort pathway to import

* Implements new Pathway import

* Implement new CC import

* Implement new CC import

* pathways summary chart

* pathways summary chart

* Implements new Pathway import

* Implements new Pathway import

* Implements new Pathway import

* filter empty pathways

* merge develop

* pathway results summary duck

* Updates Pathways to 1.16

* Updates Pathways to 1.16

* Version changed to 1.16.3

* redesign participant list - working (#702)

* Version changed to 1.16.4

* Version changed to 1.16.5

* add notification for password update (#709)

* Version changed to 1.16.7

* add notification for password update (#711)

* fix delete study call (#713)

* fix overflow mode for the status tooltip in status-history-modal (#715)

* Added warning message for non-admin user (#714)

* added warning message for non-admin user

* updated versions

* moved protected functionality to a component

* removed extra spaces and fixed license

* redesign participants tab according to the analyses tab on the right (#712)

* Updated version (#718)

* added warning message for non-admin user

* updated versions

* moved protected functionality to a component

* removed extra spaces and fixed license

* changed version

* redesign participants tweaks (#719)

* redesign participants view changes (#721)

* redesign participants view changes

* Redesign participants views changes (#722)

* redesign participants view changes

* Redesign partisipant views changes (#723)

* redesign participants view changes - question mark, lines

* show password confirmation validation error only for password confirmation field (#724)

* support users soft-delete (#717)

* analyses import error (#720)

* issue-660: add error handling for the Atlas Analyses import

* bump version

* Fixed message during Atlas import (#699)

* Update package.json (#725)

update version to deploy recent changes

* Users administration filtering improvements (#727)

* Make users grid filtering triple-state
* message tweak

* Users grid filtering improvements (#728)

* users administration filter labels tweak

* Fixed closing of modal (#726)

* Fixed closing of modal

* Fixed package.json version

* Fixed multiple scrollbars when modal is opened (#729)

* Fixed multiple scrollbars when modal is opened

* Fixed multiple scrollbars when modal is opened

* Fixed multiple scrollbars when modal is opened

* Fixed package.json version

* Fixed number formatting (#730)

* Fixed number formatting

* Raised versions

* Disabled closing of popup on outside click by default (#731)

* Fixed number formatting (#734)

* Fixed number formatting

* Raised version of arachne-ui-components

* Fixed horizontal scroll and width of content (#735)

* Fixed horizontal scroll and width of content

* Raised components package version

* Fixed markup in DataSources List (#736)

Fixed markup in DataSources List

* Version changed to 1.16.26

* Version changed to 1.16.27

* Generate analysis description field during import (#737)

* Version changed to 1.16.29

* ARACHNE-2719  Update AD/LDAP user import routines to work with Authen… (#732)

* ARACHNE-2719  Update AD/LDAP user import routines to work with Authenticator. fix PR remarks
- remove UserOrigin class
- add AuthenticationHelperService

* ARACHNE-2719  Update AD/LDAP user import routines to work with Authenticator. fix PR remarks
- upgrade version

* ARACHNE-2719  Update AD/LDAP user import routines to work with Authenticator. fix PR remarks
- set JDBC auth-method

* Version changed to 1.16.31

* fix typo in the status label (#738)

* Version changed to 1.16.32

* update version to 1.16.0-QA

Co-authored-by: Anton Gackovka <[email protected]>
Co-authored-by: Alex Saltykov <[email protected]>
Co-authored-by: Vitaly Koulakov <[email protected]>
Co-authored-by: OdysseusBot <[email protected]>
Co-authored-by: Pavel Grafkin <[email protected]>
Co-authored-by: anastasiia klochkova <[email protected]>
Co-authored-by: Vlad Belousov <[email protected]>
Co-authored-by: Alex Cumarav <[email protected]>
Co-authored-by: gklebanov <[email protected]>

* QA 1.16.0 fix merge (#740)

* fix merge conflict

* ARACHNE-2729 Add IAP auth support into Standalone Node (#742) (#743)

* Version changed to 1.16.33

Co-authored-by: Alex Saltykov <[email protected]>
Co-authored-by: Alex Cumarav <[email protected]>
Co-authored-by: Alex Cumarav <[email protected]>
Co-authored-by: alexandr cumarav <https://localhost:8080/study-manager/studies/6>
Co-authored-by: Vlad Belousov <[email protected]>
Co-authored-by: Pavel Grafkin <[email protected]>
Co-authored-by: molodkov yaroslav <[email protected]>
Co-authored-by: Anton Gackovka <[email protected]>
Co-authored-by: OdysseusBot <[email protected]>
Co-authored-by: anastasiia klochkova <[email protected]>
Co-authored-by: gklebanov <[email protected]>
  • Loading branch information
11 people authored Mar 6, 2020
1 parent fd0e09e commit 4b6b2ba
Show file tree
Hide file tree
Showing 62 changed files with 1,877 additions and 605 deletions.
362 changes: 181 additions & 181 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arachne-ui",
"version": "1.15.25",
"version": "1.16.34",
"licenses": [
{
"type": "Apache-2.0",
Expand Down Expand Up @@ -46,15 +46,15 @@
"dependencies": {
"@ohdsi/atlascharts": "^1.7.3",
"@stomp/stompjs": "github:stomp-js/stomp-websocket",
"arachne-ui-components": "1.15.6",
"arachne-ui-components": "1.16.4",
"autoprefixer": "^6.7.6",
"clamp-js": "^0.7.0",
"classnames": "^2.2.5",
"codemirror": "^5.22.0",
"comma-separated-values": "^3.6.4",
"compression": "^1.6.0",
"core-js": "^2.4.1",
"d3": "^4.9.1",
"d3": "^4.10.0",
"d3-scale": "^1.0.6",
"d3-selection": "^1.1.0",
"d3-tip": "^0.7.1",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.odysseusinc.arachne</groupId>
<artifactId>${final.artifactId}</artifactId>
<version>1.15.0</version>
<version>1.16.0</version>
<packaging>pom</packaging>
<name>Frontend Resources Bundle</name>

Expand Down
2 changes: 2 additions & 0 deletions src/AppContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class AppContainer extends Component {
componentDidMount() {
if (__APP_TYPE_NODE__) {
this.props.getNodeMode();
this.props.getAuthMode();
}
if (__APP_TYPE_CENTRAL__) {
this.props.getPasswordPolicies();
Expand Down Expand Up @@ -151,6 +152,7 @@ const mapDispatchToProps = {
logout: (backurl) => actions.auth.clearToken(backurl),
getPasswordPolicies: () => actions.auth.passwordPolicy.find(),
getNodeMode: () => (__APP_TYPE_NODE__) ? actions.auth.nodeMode.find() : true,
getAuthMode: () => (__APP_TYPE_NODE__) ? actions.auth.authMode.find() : true
};

export default (navItems) => {
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import React from 'react';
import NotFound from 'components/NotFound';
import pluralize from 'pluralize';
import AppContainer from './AppContainer';
import { authenticationModes } from 'modules/Auth/const';

require('styles/appContainer.scss');

Expand Down Expand Up @@ -147,7 +148,9 @@ function initializeApi(store) {
.setUserTokenGetter(() => AuthService.getToken())
.setUserRequestedGetter(() => AuthService.getUserRequest())
.setUnauthorizedHandler(() => {
if (store.getState().auth.principal.queryResult !== null) {
if (!!store.getState().auth.authMode.data && store.getState().auth.authMode.data.result.mode == authenticationModes.Proxy) {
window.location = '/_gcp_iap/clear_login_cookie';
} else if (store.getState().auth.principal.queryResult !== null) {
store.dispatch(actions.auth.clearToken(store.getState().routing.locationBeforeTransitions.pathname));
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/components/Comment/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@
&__description {
line-height: 1.5;
margin-top: 5px;
word-break: break-all;
}

&__actions {
margin-top: 5px;
margin-top: 5px;
}

&__action {
Expand Down
10 changes: 7 additions & 3 deletions src/components/VirtualScroller/components/List/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/

@import 'styles/vars-and-mixins.scss';
.#{$namespace} {

.#{$namespace} {
&virtual-list {
& .react-grid-Header {
display: none;
Expand All @@ -33,6 +33,10 @@
/* compensate hidden header */
top: 0 !important;
}

& .react-grid-Canvas {
max-height: 40rem;
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ $width: 26rem;
}
}

}
}
23 changes: 13 additions & 10 deletions src/modules/Admin/components/AdminList/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,25 @@ import ModalAddUser from './ModalAddUser';
import {
LoadingPanel,
} from 'arachne-ui-components';
import ProtectedView from 'modules/Admin/components/ProtectedView';

require('./style.scss');

function AdminList({ isLoading, openModal, isStandalone }) {
function AdminList({ isLoading, openModal, isStandalone}) {
const classes = new BEMHelper('admin-panel-admin-list');

return (
<PageWrapper>
<Table/>
{ !isStandalone && (<div {...classes('add')} onClick={openModal}>
<span {...classes('add-icon')}>add_circle_outline</span>
<span {...classes('add-label')}>Add admin user</span>
</div>) }
<ModalAddUser />
<LoadingPanel active={ isLoading } />
</PageWrapper>
<ProtectedView>
<PageWrapper>
<Table/>
{ !isStandalone && (<div {...classes('add')} onClick={openModal}>
<span {...classes('add-icon')}>add_circle_outline</span>
<span {...classes('add-label')}>Add admin user</span>
</div>) }
<ModalAddUser />
<LoadingPanel active={ isLoading } />
</PageWrapper>
</ProtectedView>
);
}

Expand Down
22 changes: 15 additions & 7 deletions src/modules/Admin/components/PortalUserList/Filters/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,31 @@
*
*/

import { types as fieldTypes } from 'const/modelAttributes';
import {types as fieldTypes} from 'const/modelAttributes';

export default function getFields(props) {
return [
{
label: 'Enabled',
label: 'Status',
name: 'enabled',
type: fieldTypes.toggle,
type: fieldTypes.enum,
forceOpened: true,
hasTitle: false
hasTitle: true,
options: [
{label: 'Enabled', value: 'true',},
{label: 'Disabled', value: 'false',},
],
},
{
label: 'E-mail confirm',
label: 'E-mail confirmed',
name: 'emailConfirmed',
type: fieldTypes.toggle,
type: fieldTypes.enum,
forceOpened: true,
hasTitle: false
hasTitle: true,
options: [
{label: 'Yes', value: 'true',},
{label: 'No', value: 'false',},
]
},
{
label: 'Tenant',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ import isEmpty from 'lodash/isEmpty';
import React, { Component } from 'react';
import { Button } from 'arachne-ui-components';
import { batchOperationType } from 'modules/Admin/const';
import pluralize from 'pluralize';
import { formatNumberWithLabel } from 'services/Utils';

require('./style.scss');

/** @augments{ Component<any, any>} */
export default class ActionsToolbar extends Component{


getButtons() {

const areUndeletableUsersSelected = !isEmpty(this.props.selectedUndeletableUsers);

return [
{
onClick: this.props.openAddUsersBatchModal,
Expand All @@ -58,15 +58,15 @@ export default class ActionsToolbar extends Component{
}),
this.createButton({
onClick: areUndeletableUsersSelected ? () => {} : this.props.batch.bind(null, batchOperationType.DELETE),
tooltipText: areUndeletableUsersSelected ? `${pluralize('user', this.props.selectedUndeletableUsers.length, true)} cannot be deleted` : 'Delete',
tooltipText: this.buildDeleteUsersTooltipMessage(areUndeletableUsersSelected),
icon: 'delete',
mods: { invalid: areUndeletableUsersSelected}
}),
];
}

createButton({ onClick, tooltipText, icon, mods = {} }) {

const areUsersSelected = !isEmpty(this.props.selectedUsers);
return {
disabled: !areUsersSelected,
Expand All @@ -76,28 +76,38 @@ export default class ActionsToolbar extends Component{
mods,
}
}


buildDeleteUsersTooltipMessage(areUndeletableUsersSelected) {

if (areUndeletableUsersSelected) {
const count = this.props.selectedUndeletableUsers.length;
const have = count === 1 ? 'has' : 'have';
const errorMessage = `${formatNumberWithLabel({ label: 'user', value: count })} ${have} records and cannot be removed`;
return errorMessage;
}
return 'Delete';
}

render() {

const classes = new BEMHelper('admin-portal-user-list-actions-toolbar');
const tooltipClass = new BEMHelper('tooltip');

const selectedUsers = this.props.selectedUsers.length;
return (
<div {...classes()}>
<div>
{
this.getButtons().map(buttonSettings =>
<Button onClick={buttonSettings.onClick}>
<i
<i
{...classes({element: 'btn-ico', modifiers: { ...buttonSettings.mods, disabled: buttonSettings.disabled }, extra: tooltipClass().className})}
aria-label={buttonSettings.tooltipText}
data-tootik-conf="bottom"
>{buttonSettings.icon}</i>
</Button>)
}
</div>
<span>{`Selected ${pluralize('user', this.props.selectedUsers.length, true)}`}</span>
<span>{`Selected ${formatNumberWithLabel({ label: 'user', value: selectedUsers })}`}</span>
</div>
);
}
Expand Down
33 changes: 18 additions & 15 deletions src/modules/Admin/components/PortalUserList/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import ModalAddUser from './ModalAddUser';
import ModalAddUserBatch from './ModalAddUserBatch';
import Grid from 'components/Grid';
import PortalUserListActions from './Actions';
import ProtectedView from 'modules/Admin/components/ProtectedView';

require('./style.scss');

Expand All @@ -46,21 +47,23 @@ export default class UserList extends Component {
onPageOutOfRange,
} = this.props;
return (
<PageWrapper>
<Grid
isLoading={isLoading}
title="Settings | Users"
paginationDetails={paginationDetails}
filterFields={filterFields}
Actions={<PortalUserListActions />}
searchQueryDecode={searchQueryDecode}
searchQueryEncode={searchQueryEncode}
onPageOutOfRange={onPageOutOfRange}
>
<Table />
</Grid>
{ this.getModals() }
</PageWrapper>
<ProtectedView>
<PageWrapper>
<Grid
isLoading={isLoading}
title="Settings | Users"
paginationDetails={paginationDetails}
filterFields={filterFields}
Actions={<PortalUserListActions />}
searchQueryDecode={searchQueryDecode}
searchQueryEncode={searchQueryEncode}
onPageOutOfRange={onPageOutOfRange}
>
<Table />
</Grid>
{ this.getModals() }
</PageWrapper>
</ProtectedView>
);
}
}
56 changes: 56 additions & 0 deletions src/modules/Admin/components/ProtectedView/container.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
*
* Copyright 2018 Odysseus Data Services, inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Company: Odysseus Data Services, Inc.
* Product Owner/Architecture: Gregory Klebanov
* Authors: Anastasiia Klochkova
* Created: December 09, 2019
*
*/

import { Component } from 'react';
import { get, ContainerBuilder } from 'services/Utils';
import ProtectedViewPresenter from './presenter';


class ProtectedView extends Component {

render() {
return ProtectedViewPresenter({
...this.props,
});
}
}

class ProtectedViewBuilder extends ContainerBuilder {
getComponent() {
return ProtectedView;
}

mapStateToProps(state) {
return {
isAdmin: get(state, 'auth.principal.queryResult.result.isAdmin'),
};
}

mergeProps(stateProps, dispatchProps, ownProps) {
return {
...stateProps,
...dispatchProps,
...ownProps,
};
}
}
export default ProtectedViewBuilder;
Loading

0 comments on commit 4b6b2ba

Please sign in to comment.