Skip to content

Commit

Permalink
chore(accounts): disable accounts import during rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Apr 10, 2022
1 parent bfadc7d commit d5695cf
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
12 changes: 12 additions & 0 deletions src/client/components/StepWizard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,22 @@ class StepWizard extends React.Component {
this.init = this.init.bind(this)
this.show = this.show.bind(this)
this.hide = this.hide.bind(this)

this.onImportStatusChange = this.onImportStatusChange.bind(this)
}

componentDidMount () {
this.init()

socket.socket.on('$trudesk:accounts:import:onStatusChange', this.onImportStatusChange)
}

componentWillUnmount () {
socket.socket.removeAllListeners('$trudesk:accounts:import:onStatusChange')
}

onImportStatusChange = data => {
console.log(data)
}

init = () => {
Expand Down
32 changes: 16 additions & 16 deletions src/client/containers/Accounts/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,22 @@ class AccountsContainer extends React.Component {
extraClass={'hover-accent'}
onClick={() => this.props.showModal('CREATE_ACCOUNT')}
/>
{helpers.canUser('accounts:import', true) && (
<DropdownTrigger mode={'click'} pos={'bottom-right'} offset={5} extraClass={'uk-float-right'}>
<Button
text={''}
hasDropdown={true}
small={true}
waves={false}
styleOverride={{ padding: '0 5px 0 0' }}
extraClass={'pr-5 no-border-radius nbl bg-accent md-color-white hover-accent'}
/>
<Dropdown small={true}>
<DropdownHeader text={'Account Actions'} />
<DropdownItem text={'Import'} href={'/accounts/import'} />
</Dropdown>
</DropdownTrigger>
)}
{/*{helpers.canUser('accounts:import', true) && (*/}
{/* <DropdownTrigger mode={'click'} pos={'bottom-right'} offset={5} extraClass={'uk-float-right'}>*/}
{/* <Button*/}
{/* text={''}*/}
{/* hasDropdown={true}*/}
{/* small={true}*/}
{/* waves={false}*/}
{/* styleOverride={{ padding: '0 5px 0 0' }}*/}
{/* extraClass={'pr-5 no-border-radius nbl bg-accent md-color-white hover-accent'}*/}
{/* />*/}
{/* <Dropdown small={true}>*/}
{/* <DropdownHeader text={'Account Actions'} />*/}
{/* <DropdownItem text={'Import'} href={'/accounts/import'} />*/}
{/* </Dropdown>*/}
{/* </DropdownTrigger>*/}
{/*)}*/}
</ButtonGroup>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ function mainRoutes (router, middleware, controllers) {
router.get('/accounts/agents', middleware.redirectToLogin, middleware.loadCommonData, controllers.accounts.getAgents)
router.get('/accounts/admins', middleware.redirectToLogin, middleware.loadCommonData, controllers.accounts.getAdmins)
router.post('/accounts/uploadimage', middleware.redirectToLogin, controllers.accounts.uploadImage)
router.get('/accounts/import', middleware.redirectToLogin, middleware.loadCommonData, controllers.accounts.importPage)
router.post('/accounts/import/csv/upload', middleware.redirectToLogin, controllers.accounts.uploadCSV)
router.post('/accounts/import/json/upload', middleware.redirectToLogin, controllers.accounts.uploadJSON)
router.post('/accounts/import/ldap/bind', middleware.redirectToLogin, controllers.accounts.bindLdap)
// router.get('/accounts/import', middleware.redirectToLogin, middleware.loadCommonData, controllers.accounts.importPage)
// router.post('/accounts/import/csv/upload', middleware.redirectToLogin, controllers.accounts.uploadCSV)
// router.post('/accounts/import/json/upload', middleware.redirectToLogin, controllers.accounts.uploadJSON)
// router.post('/accounts/import/ldap/bind', middleware.redirectToLogin, controllers.accounts.bindLdap)

// Groups
router.get('/groups', middleware.redirectToLogin, middleware.loadCommonData, controllers.groups.get)
Expand Down
2 changes: 1 addition & 1 deletion src/socketio/accountImportSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function register (socket) {

function eventLoop () {}

events.onImportCSV = async socket => {
events.onImportCSV = socket => {
socket.on('$trudesk:accounts:import:csv', async data => {
const authUser = socket.request.user
if (!permissions.canThis(authUser.role, 'accounts:import')) {
Expand Down

0 comments on commit d5695cf

Please sign in to comment.