diff --git a/backend/dataall/core/organizations/api/resolvers.py b/backend/dataall/core/organizations/api/resolvers.py index 08d095e75..45d849d63 100644 --- a/backend/dataall/core/organizations/api/resolvers.py +++ b/backend/dataall/core/organizations/api/resolvers.py @@ -25,9 +25,11 @@ def update_organization(context, source, organizationUri=None, input=None): def get_organization(context: Context, source, organizationUri=None): return OrganizationService.get_organization(uri=organizationUri) + def get_organization_simplified(context: Context, source, organizationUri=None): return OrganizationService.get_organization_simplified(uri=organizationUri) + def list_organizations(context: Context, source, filter=None): if not filter: filter = {'page': 1, 'pageSize': 5} diff --git a/backend/dataall/core/organizations/api/types.py b/backend/dataall/core/organizations/api/types.py index 3d176ca54..24acbef1e 100644 --- a/backend/dataall/core/organizations/api/types.py +++ b/backend/dataall/core/organizations/api/types.py @@ -57,6 +57,6 @@ fields=[ gql.Field(name='organizationUri', type=gql.ID), gql.Field(name='label', type=gql.String), - gql.Field(name='name', type=gql.String) + gql.Field(name='name', type=gql.String), ], ) diff --git a/backend/dataall/modules/dataset_sharing/services/share_notification_service.py b/backend/dataall/modules/dataset_sharing/services/share_notification_service.py index faaf7d30f..33a3e8e18 100644 --- a/backend/dataall/modules/dataset_sharing/services/share_notification_service.py +++ b/backend/dataall/modules/dataset_sharing/services/share_notification_service.py @@ -43,35 +43,37 @@ def __init__(self, session, dataset: Dataset, share: ShareObject): def notify_share_object_submission(self, email_id: str): share_link_text = '' - if os.environ.get("frontend_domain_url"): + if os.environ.get('frontend_domain_url'): share_link_text = f'

Please visit data.all share link to take action or view more details' msg = f'User {email_id} SUBMITTED share request for dataset {self.dataset.label} for principal {self.share.principalId}' subject = f'Data.all | Share Request Submitted for {self.dataset.label}' email_notification_msg = msg + share_link_text notifications = self._register_notifications( - notification_type=DataSharingNotificationType.SHARE_OBJECT_SUBMITTED.value, msg=msg) + notification_type=DataSharingNotificationType.SHARE_OBJECT_SUBMITTED.value, msg=msg + ) self._create_notification_task(subject=subject, msg=email_notification_msg) return notifications def notify_share_object_approval(self, email_id: str): share_link_text = '' - if os.environ.get("frontend_domain_url"): + if os.environ.get('frontend_domain_url'): share_link_text = f'

Please visit data.all share link to take action or view more details' msg = f'User {email_id} APPROVED share request for dataset {self.dataset.label} for principal {self.share.principalId}' subject = f'Data.all | Share Request Approved for {self.dataset.label}' email_notification_msg = msg + share_link_text notifications = self._register_notifications( - notification_type=DataSharingNotificationType.SHARE_OBJECT_APPROVED.value, msg=msg) + notification_type=DataSharingNotificationType.SHARE_OBJECT_APPROVED.value, msg=msg + ) self._create_notification_task(subject=subject, msg=email_notification_msg) return notifications def notify_share_object_rejection(self, email_id: str): share_link_text = '' - if os.environ.get("frontend_domain_url"): + if os.environ.get('frontend_domain_url'): share_link_text = f'

Please visit data.all share link to take action or view more details' if self.share.status == ShareObjectStatus.Rejected.value: msg = f'User {email_id} REJECTED share request for dataset {self.dataset.label} for principal {self.share.principalId}' @@ -85,7 +87,8 @@ def notify_share_object_rejection(self, email_id: str): email_notification_msg = msg + share_link_text notifications = self._register_notifications( - notification_type=DataSharingNotificationType.SHARE_OBJECT_REJECTED.value, msg=msg) + notification_type=DataSharingNotificationType.SHARE_OBJECT_REJECTED.value, msg=msg + ) self._create_notification_task(subject=subject, msg=email_notification_msg) return notifications @@ -94,7 +97,8 @@ def notify_new_data_available_from_owners(self, s3_prefix): msg = f'New data (at {s3_prefix}) is available from dataset {self.dataset.datasetUri} shared by owner {self.dataset.owner}' notifications = self._register_notifications( - notification_type=DataSharingNotificationType.DATASET_VERSION.value, msg=msg) + notification_type=DataSharingNotificationType.DATASET_VERSION.value, msg=msg + ) return notifications def _get_share_object_targeted_users(self): @@ -114,7 +118,7 @@ def _register_notifications(self, notification_type, msg): """ notifications = [] for recipient in self.notification_target_users: - log.info(f"Creating notification for {recipient}, msg {msg}") + log.info(f'Creating notification for {recipient}, msg {msg}') notifications.append( NotificationRepository.create_notification( session=self.session, @@ -144,8 +148,8 @@ def _create_notification_task(self, subject, msg): notification_recipient_groups_list = [self.dataset.SamlAdminGroupName, self.dataset.stewards] notification_recipient_email_ids = [] - if share_notification_config_type == "email": - if params.get("group_notifications", False) == True: + if share_notification_config_type == 'email': + if params.get('group_notifications', False) == True: notification_recipient_groups_list.append(self.share.groupUri) else: notification_recipient_email_ids = [self.share.owner] @@ -158,7 +162,7 @@ def _create_notification_task(self, subject, msg): 'subject': subject, 'message': msg, 'recipientGroupsList': notification_recipient_groups_list, - 'recipientEmailList': notification_recipient_email_ids + 'recipientEmailList': notification_recipient_email_ids, }, ) self.session.add(notification_task) diff --git a/deploy/stacks/param_store_stack.py b/deploy/stacks/param_store_stack.py index 02060f690..d4c7f9f6b 100644 --- a/deploy/stacks/param_store_stack.py +++ b/deploy/stacks/param_store_stack.py @@ -3,10 +3,7 @@ import string import boto3 -from aws_cdk import ( - aws_ssm, - custom_resources as cr -) +from aws_cdk import aws_ssm, custom_resources as cr from .pyNestedStack import pyNestedClass from .deploy_config import deploy_config @@ -134,20 +131,19 @@ def __init__( ) if prod_sizing: cr.AwsCustomResource( - self, - "SSMParamSettingHighThroughput", + self, + 'SSMParamSettingHighThroughput', on_update=cr.AwsSdkCall( - service="SSM", - action="UpdateServiceSettingCommand", - parameters={ - "SettingId": "/ssm/parameter-store/high-throughput-enabled", - "SettingValue": "true" - }, - physical_resource_id=cr.PhysicalResourceId.of(f"ssm-high-throughput-{self.account}-{self.region}") + service='SSM', + action='UpdateServiceSettingCommand', + parameters={'SettingId': '/ssm/parameter-store/high-throughput-enabled', 'SettingValue': 'true'}, + physical_resource_id=cr.PhysicalResourceId.of(f'ssm-high-throughput-{self.account}-{self.region}'), ), policy=cr.AwsCustomResourcePolicy.from_sdk_calls( - resources=[f"arn:aws:ssm:{self.region}:{self.account}:servicesetting/ssm/parameter-store/high-throughput-enabled"] - ) + resources=[ + f'arn:aws:ssm:{self.region}:{self.account}:servicesetting/ssm/parameter-store/high-throughput-enabled' + ] + ), )