diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-03-27 14:46:10 +0200 |
---|---|---|
committer | Grégoire Aubert <gregaubert@users.noreply.github.com> | 2017-03-31 10:29:27 +0200 |
commit | 5d4fa78653c23a9bb2314f7a49aba88709742f95 (patch) | |
tree | faf9cb4221c299bc18ab1c8b9a408c9eb541ed2e /server/sonar-web/src/main/js/store/organizationsMembers/actions.js | |
parent | bc5356a7c0c644e19dd2ce20716ba1b3e0d1cdc1 (diff) | |
download | sonarqube-5d4fa78653c23a9bb2314f7a49aba88709742f95.tar.gz sonarqube-5d4fa78653c23a9bb2314f7a49aba88709742f95.zip |
SONAR-8990 Create the organizations members store
Diffstat (limited to 'server/sonar-web/src/main/js/store/organizationsMembers/actions.js')
-rw-r--r-- | server/sonar-web/src/main/js/store/organizationsMembers/actions.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/store/organizationsMembers/actions.js b/server/sonar-web/src/main/js/store/organizationsMembers/actions.js new file mode 100644 index 00000000000..44de107c3f8 --- /dev/null +++ b/server/sonar-web/src/main/js/store/organizationsMembers/actions.js @@ -0,0 +1,62 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +//@flow +export type Member = { + login: string, + name: string, + avatar: string, + groupCount: number +}; + +type MembersState = { + paging?: number, + total?: number, + loading?: boolean, + query?: string | null +}; + +export const actions = { + UPDATE_STATE: 'organizations/UPDATE_STATE', + RECEIVE_MEMBERS: 'organizations/RECEIVE_MEMBERS', + RECEIVE_MORE_MEMBERS: 'organizations/RECEIVE_MORE_MEMBERS' +}; + +export const receiveMembers = (organizationKey: string, members: Array<Member>, stateChanges: MembersState) => ({ + type: actions.RECEIVE_MEMBERS, + organization: organizationKey, + members, + stateChanges +}); + +export const receiveMoreMembers = (organizationKey: string, members: Array<Member>, stateChanges: MembersState) => ({ + type: actions.RECEIVE_MORE_MEMBERS, + organization: organizationKey, + members, + stateChanges +}); + +export const updateState = ( + organizationKey: string, + stateChanges: MembersState +) => ({ + type: actions.UPDATE_STATE, + organization: organizationKey, + stateChanges +}); |