Skip to content

Commit

Permalink
Merge pull request #1046 from rokwire/release/1.17.0
Browse files Browse the repository at this point in the history
Release/1.17.0
  • Loading branch information
sandeep-ps authored Jan 3, 2023
2 parents fcc5c6a + 15f92dc commit 432c7e8
Show file tree
Hide file tree
Showing 21 changed files with 749 additions and 609 deletions.
45 changes: 38 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.17.0] - 2022-12-06
### Added
- Cancel button in contribution edit page. [#986](https://github.com/rokwire/rokwire-building-blocks-api/issues/986)
- Add group ids and user ids fields in events yaml file. [#1017](https://github.com/rokwire/rokwire-building-blocks-api/issues/1017)
- Compound text indexes for contribution collection. [#1004](https://github.com/rokwire/rokwire-building-blocks-api/issues/1004)
- Hide data deletion api key in capability view page. [#1010](https://github.com/rokwire/rokwire-building-blocks-api/issues/1010)
- Support multiple group ids in post endpoint in events building block. [#1020](https://github.com/rokwire/rokwire-building-blocks-api/issues/1020)
- User confirmation on cancel contribution. [#1022](https://github.com/rokwire/rokwire-building-blocks-api/issues/1022)
- Close button to remove environment key value pairs. [#980](https://github.com/rokwire/rokwire-building-blocks-api/issues/980)
- Make environmentVariable key required if present in Catalog. [#1028](https://github.com/rokwire/rokwire-building-blocks-api/issues/1028)
- Added set and get functions for ApiBaseUrl in catalog. [#1047](https://github.com/rokwire/rokwire-building-blocks-api/issues/1047)

## [1.16.0] - 2022-08-29
### Changed
- Show appropriate error message when catalog cannot display a contribution. [#961](https://github.com/rokwire/rokwire-building-blocks-api/issues/961)
- Position of Add capability and talent buttons in catalog form. [#971](https://github.com/rokwire/rokwire-building-blocks-api/issues/971)
- Page re-direct after contribution edit. [#976](https://github.com/rokwire/rokwire-building-blocks-api/issues/976)
- Add more fields button changed to Add environment variables. [#975](https://github.com/rokwire/rokwire-building-blocks-api/issues/975)
- Edit contribution button color changed to grey. [#981](https://github.com/rokwire/rokwire-building-blocks-api/issues/981)
- Heading for add a talent or capability in contribution edit page if talent or capability exists. [#984](https://github.com/rokwire/rokwire-building-blocks-api/issues/984)
- Arrange environment variables into single row in capability view page. [#993](https://github.com/rokwire/rokwire-building-blocks-api/issues/993)
- Arrange environment variables and data deletion endpoint into single row in capability. [#989](https://github.com/rokwire/rokwire-building-blocks-api/issues/989)
- API Doc Dockerfile URLs to include new building blocks and remove unsupported building blocks. [#831](https://github.com/rokwire/rokwire-building-blocks-api/issues/831)
- Talent fields yaml configuration [#949](https://github.com/rokwire/rokwire-building-blocks-api/issues/949)
- Drop old indexes in contributions collection in mongodb. [#1029](https://github.com/rokwire/rokwire-building-blocks-api/issues/1029)

### Fixed
- Fix Core BB service token support in events [#994](https://github.com/rokwire/rokwire-building-blocks-api/issues/994)
- Updated gevent in contributions. [#1003](https://github.com/rokwire/rokwire-building-blocks-api/issues/1003)
- Updated gevent in catalog. [#1007](https://github.com/rokwire/rokwire-building-blocks-api/issues/1007)
- Delete capability and talent functionality in catalog. [#1009](https://github.com/rokwire/rokwire-building-blocks-api/issues/1009)
- Edit database detail field in catalog. [#1048](https://github.com/rokwire/rokwire-building-blocks-api/issues/1048)
- Display multiple contribution admins in catalog. [#1050](https://github.com/rokwire/rokwire-building-blocks-api/issues/1050)
- VersionUrl field name in contribution edit page. [#1056](https://github.com/rokwire/rokwire-building-blocks-api/issues/1056)
- SourceUrl field display on IsOpenSourceUrl radio button in catalog. [#1053](https://github.com/rokwire/rokwire-building-blocks-api/issues/1053)

## [1.16.0] - 2022-08-29
### Added
- Ability to delete a capability or talent from contribution. [#951](https://github.com/rokwire/rokwire-building-blocks-api/issues/951)
- Hide sensitive data in capability view page. [#950](https://github.com/rokwire/rokwire-building-blocks-api/issues/950)
- Minimum user privacy level in talent form. [#970](https://github.com/rokwire/rokwire-building-blocks-api/issues/970)

### Security
- Upgrade Swagger UI base Docker image to v4.13.2. [#991](https://github.com/rokwire/rokwire-building-blocks-api/issues/991)

### Changed
- Change to allow all group admins to manage group events. [#996](https://github.com/rokwire/rokwire-building-blocks-api/issues/996)

### Fixed

### Security
- Upgrade Swagger UI base Docker image to v4.13.2. [#991](https://github.com/rokwire/rokwire-building-blocks-api/issues/991)

## [1.15.0] - 2022-07-11
### Added
Expand Down Expand Up @@ -518,7 +548,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- References to AWS keys and variables in the Events Building Block.

[Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.16.0...HEAD
[Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.17.0...HEAD
[1.17.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.16.0...1.17.0
[1.16.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.15.0...1.16.0
[1.15.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.14.1...1.15.0
[1.14.1]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.14.0...1.14.1
Expand Down
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@

FROM swaggerapi/swagger-ui:v4.13.2

COPY appconfigservice/appconfig.yaml /usr/share/nginx/html/app/
COPY authservice/auth.yaml /usr/share/nginx/html/app/
COPY eventservice/events.yaml /usr/share/nginx/html/app/
COPY profileservice/profile.yaml /usr/share/nginx/html/app/
COPY loggingservice/logging.yaml /usr/share/nginx/html/app/
COPY appconfigservice/appconfig.yaml eventservice/events.yaml profileservice/profile.yaml loggingservice/logging.yaml /usr/share/nginx/html/app/

ENV URLS "[{url: 'app/appconfig.yaml', name: 'App Config Building Block'}, {url: 'app/auth.yaml', name: 'Authentication Building Block'}, {url: 'app/events.yaml', name: 'Events Building Block'}, {url: 'app/profile.yaml', name: 'Profile Building Block'}, {url: 'app/logging.yaml', name: 'Logging Building Block'}, {url: 'https://api.rokwire.illinois.edu/health/doc', name: 'Health Building Block'}, {url: 'https://api.rokwire.illinois.edu/talent-chooser/doc', name: 'Talent Chooser Building Block'} ]"

VOLUME /usr/share/nginx/html/app/

ENV BASE_URL="/docs"
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Patches for **Rokwire Building Blocks** in this repository will only be applied

| Version | Supported |
|----------| ------------------ |
| 1.17.0 | :white_check_mark: |
| 1.16.0 | :white_check_mark: |
| 1.15.0 | :white_check_mark: |
| 1.14.1 | :white_check_mark: |
Expand Down
213 changes: 55 additions & 158 deletions contributions/api/controllers/contributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def search(token_info=None, name=None):
# return the list of all records
out_json = mongoutils.get_result(coll_contribution, query)
else:
# search based on query
try:
query = query_params.format_query_contribution(name, query)
except Exception as ex:
Expand Down Expand Up @@ -444,95 +445,43 @@ def delete(token_info, id):
# logging.error("DELETE " + json.dumps(msg_json))
# return rs_handlers.not_found(msg_json)

def allcapabilitiessearch(token_info=None, name=None):
def allcapabilitiessearch(token_info=None):
# returns a list of all capabilities
query = dict()
is_list = False

login_id, is_login = otherutils.get_login(token_info)

query = query_params.format_query_status_login(query, login_id, is_login)

if name is None:
is_list = True

if is_list:
try:
out_json = mongoutils.get_result(coll_contribution, query)
else:
try:
query = query_params.format_query_capability(name, query)
except Exception as ex:
msg = {
"reason": "The query is wrong or bad argument",
"error": "Bad Request: " + request.url,
}
msg_json = jsonutils.create_log_json("Capability", "SEARCH", msg)
logging.error("Capability SEARCH " + json.dumps(msg_json))
return rs_handlers.bad_request(msg_json)

try:
out_json = mongoutils.get_result(coll_contribution, query)
except Exception as ex:
msg = {
"reason": "The query is wrong or bad argument",
"error": "Bad Request: " + request.url,
}
msg_json = jsonutils.create_log_json("Capability", "SEARCH", msg)
logging.error("Capability SEARCH " + json.dumps(msg_json))
return rs_handlers.bad_request(msg_json)
except Exception as ex:
msg = {
"reason": "The query is wrong or bad argument",
"error": "Bad Request: " + request.url,
}
msg_json = jsonutils.create_log_json("Contribution", "SEARCH", msg)
logging.error("Contribution SEARCH " + json.dumps(msg_json))
return rs_handlers.bad_request(msg_json)

return_json = []
if out_json is None:
return_json = []
else:
if is_list: # list all
if isinstance(out_json, list):
for in_json in out_json:
contribution_id = in_json["id"]
if in_json['capabilities'] is not None:
for capability in in_json['capabilities']:
capability["contributionId"] = contribution_id
return_json.append(capability)
else:
contribution_id = out_json["id"]
capability = out_json['capabilities']
capability["contributionId"] = contribution_id
return_json.append(capability)
else: # extract out capabilities with the given name
if isinstance(out_json, list):
for tmp_json in out_json:
capabilities_json = tmp_json["capabilities"]
contribution_id = tmp_json["id"]
# TODO this is the case of only 1 args that is name.
# If there are more args this should be updated
for tmp_capability_json in capabilities_json:
capability_json = None
if tmp_capability_json["name"] == name:
capability_json = tmp_capability_json
capability_json["contributionId"] = contribution_id
return_json.append(capability_json)
else:
capabilities_json = out_json["capabilities"]
contribution_id = out_json["id"]
# TODO this is the case of only 1 args that is name.
# If there are more args this should be updated
for tmp_capability_json in capabilities_json:
capability_json = None
if tmp_capability_json["name"] == name:
capability_json = tmp_capability_json
capability_json["contributionId"] = contribution_id
return_json.append(capability_json)
if is_list:
msg = {
"GET": "Capabilities list"
}
msg_json = jsonutils.create_log_json("Capabilities", "GET", msg)
logging.info("Capabilities GET " + json.dumps(msg_json))
else:
msg = {
"search": "Capability search performed with " + str(name)
}
msg_json = jsonutils.create_log_json("Capability", "SEARCH", msg)
logging.info("Capability SEARCH " + json.dumps(msg_json))
if isinstance(out_json, list):
for in_json in out_json:
contribution_id = in_json["id"]
if in_json['capabilities'] is not None:
for capability in in_json['capabilities']:
capability["contributionId"] = contribution_id
return_json.append(capability)
else:
contribution_id = out_json["id"]
capability = out_json['capabilities']
capability["contributionId"] = contribution_id
return_json.append(capability)

msg = {"GET": "Capabilities list"}
msg_json = jsonutils.create_log_json("Capabilities", "GET", msg)
logging.info("Capabilities GET " + json.dumps(msg_json))

return return_json

Expand Down Expand Up @@ -599,95 +548,43 @@ def capabilities_search(token_info=None, id=None):

return capability_dataset

def alltalentssearch(token_info=None, name=None):
def alltalentssearch(token_info=None):
# returns list of all talents
query = dict()
is_list = False

login_id, is_login = otherutils.get_login(token_info)

query = query_params.format_query_status_login(query, login_id, is_login)

if name is None:
is_list = True

if is_list:
try:
out_json = mongoutils.get_result(coll_contribution, query)
else:
try:
query = query_params.format_query_talent(name, query)
except Exception as ex:
msg = {
"reason": "The query is wrong or bad argument",
"error": "Bad Request: " + request.url,
}
msg_json = jsonutils.create_log_json("Talent", "SEARCH", msg)
logging.error("Talent SEARCH " + json.dumps(msg_json))
return rs_handlers.bad_request(msg_json)

try:
out_json = mongoutils.get_result(coll_contribution, query)
except Exception as ex:
msg = {
"reason": "The query is wrong or bad argument",
"error": "Bad Request: " + request.url,
}
msg_json = jsonutils.create_log_json("Talent", "SEARCH", msg)
logging.error("Talent SEARCH " + json.dumps(msg_json))
return rs_handlers.bad_request(msg_json)
except Exception as ex:
msg = {
"reason": "The query is wrong or bad argument",
"error": "Bad Request: " + request.url,
}
msg_json = jsonutils.create_log_json("Contribution", "SEARCH", msg)
logging.error("Contribution SEARCH " + json.dumps(msg_json))
return rs_handlers.bad_request(msg_json)

return_json = []
if out_json is None:
return_json = []
else:
if is_list: # list all
if isinstance(out_json, list):
for in_json in out_json:
contribution_id = in_json["id"]
if in_json['talents'] is not None:
for talent in in_json['talents']:
talent["contributionId"] = contribution_id
return_json.append(talent)
else:
contribution_id = out_json["id"]
talent = out_json['talents']
talent["contributionId"] = contribution_id
return_json.append(talent)
else: # extract out talent with the given name
if isinstance(out_json, list):
for tmp_json in out_json:
contribution_id = tmp_json["id"]
talents_json = tmp_json["talents"]
# TODO this is the case of only 1 args that is name.
# If there are more args this should be updated
for tmp_talent_json in talents_json:
talent_json = None
if tmp_talent_json["name"] == name:
talent_json = tmp_talent_json
talent_json["contributionId"] = contribution_id
return_json.append(talent_json)
else:
talents_json = out_json["talents"]
contribution_id = out_json["id"]
# TODO this is the case of only 1 args that is name.
# If there are more args this should be updated
for tmp_talent_json in talents_json:
talent_json = None
if tmp_talent_json["name"] == name:
talent_json = tmp_talent_json
talent_json["contributionId"] = contribution_id
return_json.append(talent_json)
if is_list:
msg = {
"GET": "Talent list"
}
msg_json = jsonutils.create_log_json("Talent", "GET", msg)
logging.info("Talent GET " + json.dumps(msg_json))
else:
msg = {
"search": "Talent search performed with " + str(name)
}
msg_json = jsonutils.create_log_json("Talent", "SEARCH", msg)
logging.info("Talent SEARCH " + json.dumps(msg_json))
if isinstance(out_json, list):
for in_json in out_json:
contribution_id = in_json["id"]
if in_json['talents'] is not None:
for talent in in_json['talents']:
talent["contributionId"] = contribution_id
return_json.append(talent)
else:
contribution_id = out_json["id"]
talent = out_json['talents']
talent["contributionId"] = contribution_id
return_json.append(talent)

msg = {"GET": "Talent list"}
msg_json = jsonutils.create_log_json("Talent", "GET", msg)
logging.info("Talent GET " + json.dumps(msg_json))

return return_json

Expand Down
6 changes: 6 additions & 0 deletions contributions/api/models/capabilities/capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ def set_api_doc_url(self, apiDocUrl):
def get_api_doc_url(self):
return self.apiDocUrl

def set_api_base_url(self, apiBaseUrl):
self.apiBaseUrl = apiBaseUrl

def get_api_base_url(self):
return self.apiBaseUrl

def set_deployment_details(self, deploymentDetails):
self.deploymentDetails = deploymentDetails

Expand Down
2 changes: 1 addition & 1 deletion contributions/api/models/contribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class Contribution():
def __init__(self, injson):
self.name = None
self.contributionAdmins = None
self.contributionAdmins = []
self.shortDescription = None
self.longDescription = None
self.contributors = None
Expand Down
8 changes: 5 additions & 3 deletions contributions/api/utils/datasetutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,11 @@ def update_capability_dataset_from_json(dataset, injson):
environment_variable = EnvironmentVariable()
key = env_var["key"]
value = env_var["value"]
environment_variable.set_key(key)
environment_variable.set_value(value)
env_var_list.append(environment_variable)
# check if non-empty key
if key:
environment_variable.set_key(key)
environment_variable.set_value(value)
env_var_list.append(environment_variable)
deployment_details.set_environment_variables(env_var_list)
del outjson["environmentVariables"]
except Exception as e:
Expand Down
Loading

0 comments on commit 432c7e8

Please sign in to comment.