-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Separated component user selector * Change job assignee * Basic create task window * Bug fixes and refactoring * Create task connected with a server * Loading status for a button * Reset loading on error response * UI improvements * Github/feedback/share window
- Loading branch information
Showing
32 changed files
with
1,637 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { AnyAction, Dispatch, ActionCreator } from 'redux'; | ||
import { ThunkAction } from 'redux-thunk'; | ||
|
||
import { ShareFileInfo } from '../reducers/interfaces'; | ||
import getCore from '../core'; | ||
|
||
const core = getCore(); | ||
|
||
export enum ShareActionTypes { | ||
LOAD_SHARE_DATA = 'LOAD_SHARE_DATA', | ||
LOAD_SHARE_DATA_SUCCESS = 'LOAD_SHARE_DATA_SUCCESS', | ||
LOAD_SHARE_DATA_FAILED = 'LOAD_SHARE_DATA_FAILED', | ||
} | ||
|
||
function loadShareData(): AnyAction { | ||
const action = { | ||
type: ShareActionTypes.LOAD_SHARE_DATA, | ||
payload: {}, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
function loadShareDataSuccess(values: ShareFileInfo[], directory: string): AnyAction { | ||
const action = { | ||
type: ShareActionTypes.LOAD_SHARE_DATA_SUCCESS, | ||
payload: { | ||
values, | ||
directory, | ||
}, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
function loadShareDataFailed(error: any): AnyAction { | ||
const action = { | ||
type: ShareActionTypes.LOAD_SHARE_DATA_FAILED, | ||
payload: { | ||
error, | ||
}, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
export function loadShareDataAsync(directory: string, success: () => void, failure: () => void): | ||
ThunkAction<Promise<void>, {}, {}, AnyAction> { | ||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => { | ||
try { | ||
dispatch(loadShareData()); | ||
const values = await core.server.share(directory); | ||
success(); | ||
dispatch(loadShareDataSuccess(values as ShareFileInfo[], directory)); | ||
} catch (error) { | ||
dispatch(loadShareDataFailed(error)); | ||
failure(); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.