Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Tervala authored and Justin Tervala committed Jan 18, 2018
2 parents 84f0509 + 44010d2 commit d5cc78d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Changelog
<!-- Use the tags Added, Changed, Deprecated, Removed, Fixed, Security, and
Contributor to describe changes -->
## [0.6.4]
###### 2018-01-18

### Changed
* The accept/decline method returns status codes indicating if the action was
accepted or declined instead of true/false


### Fixed
* Fixed a bug where roles weren't being deleted from the database
* Fixed a bug on the UI where correct permissions weren't being displayed for
roles

## [0.6.3]
###### 2018-01-18

Expand Down
3 changes: 2 additions & 1 deletion apps/Utilities/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,5 @@ def send_full_message(message, users=None, roles=None):

@action
def accept_decline(action):
return action.lower() == 'accept'
r = action.lower() == 'accept'
return r, "Accepted" if r else "Declined"
7 changes: 6 additions & 1 deletion apps/Utilities/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,13 @@ actions:
- name: action
type: string
required: true
default_return: Accepted
returns:
Success:
Accepted:
schema:
type: boolean
Declined:
failure: true
schema:
type: boolean
conditions:
Expand Down
4 changes: 2 additions & 2 deletions apps/Utilities/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ def reverse_boolean(value):

@condition
def accept_decline(value):
return value.lower() == 'accept'

r = value.lower() == 'accept'
return r, "Accepted" if r else "Declined"
2 changes: 1 addition & 1 deletion walkoff/client/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class MainComponent {
// (this.messageModalRef.componentInstance.message as Message).read_by.push(update.username);
// }
// });
eventSource.addEventListener('respond', (message: any) => {
eventSource.addEventListener('responded', (message: any) => {
const update: MessageUpdate = JSON.parse(message.data);

const existingMessage = this.messageListings.find(m => m.id === update.id);
Expand Down
2 changes: 1 addition & 1 deletion walkoff/client/settings/settings.roles.modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class SettingsRoleModalComponent {

removeResource(resource: Resource): void {
this.workingRole.resources.splice(this.workingRole.resources.indexOf(resource), 1);
delete this.selectPermissionMapping[resource.resource_id];
// delete this.selectPermissionMapping[resource.resource_id];
}

permissionSelectChange(event: any, resource: Resource) {
Expand Down
1 change: 1 addition & 0 deletions walkoff/server/endpoints/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def delete_role(role_id):
def __func(role):
clear_resources_for_role(role.name)
db.session.delete(role)
db.session.commit()
return {}, SUCCESS

return __func()
Expand Down

0 comments on commit d5cc78d

Please sign in to comment.