Skip to content

Commit

Permalink
Dataset Description on shares UI page (#1026)
Browse files Browse the repository at this point in the history
### Feature or Bugfix
- Feature


### Detail

As described by the problem in this GH issue -
#1025 . This will add
dataset description on the shares UI page.

### Testing 

1. Created a share for a dataset 
2. Shares Page now contains the dataset description in the  UI 

### Relates
- #1025

### Security
Please answer the questions below briefly where applicable, or write
`N/A`. Based on
[OWASP 10](https://owasp.org/Top10/en/).

- Does this PR introduce or modify any input fields or queries - this
includes
fetching data from storage outside the application (e.g. a database, an
S3 bucket)? No
  - Is the input sanitized?
- What precautions are you taking before deserializing the data you
consume?
  - Is injection prevented by parametrizing queries?
  - Have you ensured no `eval` or similar functions are used?
- Does this PR introduce any functionality or component that requires
authorization? No
- How have you ensured it respects the existing AuthN/AuthZ mechanisms?
  - Are you logging failed auth attempts?
- Are you using or adding any cryptographic features? No
  - Do you use a standard proven implementations?
- Are the used keys controlled by the customer? Where are they stored?
No
- Are you introducing any new policies/roles/users?
  - Have you used the least-privilege principle? How?


By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
  • Loading branch information
TejasRGitHub authored Feb 2, 2024
1 parent 6c3d91c commit 559f85e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/dataall/modules/dataset_sharing/api/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def resolve_dataset(context: Context, source: ShareObject, **kwargs):
'AwsAccountId': env.AwsAccountId if env else 'NotFound',
'region': env.region if env else 'NotFound',
'exists': True if ds else False,
'description' : ds.description
}


Expand Down
1 change: 1 addition & 0 deletions backend/dataall/modules/dataset_sharing/api/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
gql.Field(name='AwsAccountId', type=gql.String),
gql.Field(name='region', type=gql.String),
gql.Field(name='exists', type=gql.Boolean),
gql.Field(name='description', type=gql.String),
],
)

Expand Down
6 changes: 5 additions & 1 deletion frontend/src/design/components/ObjectBrief.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ export const ObjectBrief = (props) => {
<Typography color="textSecondary" variant="subtitle2">
Description
</Typography>
<Typography color="textPrimary" variant="subtitle2">
<Typography
color="textPrimary"
variant="subtitle2"
style={{ whiteSpace: 'pre-line' }}
>
{description}
</Typography>
</Box>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/modules/Shares/services/getShareObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const getShareObject = ({ shareUri, filter }) => ({
AwsAccountId
region
exists
description
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/modules/Shares/views/ShareView.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,28 @@ const ShareView = () => {
</Card>
</Grid>
</Grid>
<Box sx={{ mb: 3 }}>
<Card {...share}>
<Box>
<CardHeader title="Dataset Description" />
<Divider />
</Box>
<CardContent>
<Box sx={{ mt: 1 }}>
<Typography
color="textPrimary"
variant="subtitle2"
sx={{ wordBreak: 'break-word' }}
style={{ whiteSpace: 'pre-line' }}
>
{share.dataset.description.trim().length !== 0
? share.dataset.description
: 'No dataset description'}
</Typography>
</Box>
</CardContent>
</Card>
</Box>
<Box sx={{ mb: 3 }}>
<Card {...share}>
<Box>
Expand Down

0 comments on commit 559f85e

Please sign in to comment.