Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit Response info dataset queries #1665

Merged
merged 6 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions backend/dataall/modules/dashboards/api/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@
gql.Field('DashboardId', type=gql.String),
gql.Field('tags', type=gql.ArrayType(gql.String)),
gql.Field('created', type=gql.String),
gql.Field('AwsAccountId', type=gql.String),
gql.Field('updated', type=gql.String),
gql.Field('owner', type=gql.String),
gql.Field('SamlGroupName', type=gql.String),
gql.Field(
'organization',
type=gql.Ref('Organization'),
resolver=get_dashboard_organization,
),
gql.Field(
'environment',
type=gql.Ref('Environment'),
type=gql.Ref('EnvironmentSimplified'),
resolver=resolve_environment,
),
gql.Field(
Expand Down
7 changes: 1 addition & 6 deletions backend/dataall/modules/datasets_base/api/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@
gql.Field(name='imported', type=gql.Boolean),
gql.Field(
name='environment',
type=gql.Ref('Environment'),
type=gql.Ref('EnvironmentSimplified'),
resolver=get_dataset_environment,
),
gql.Field(
name='organization',
type=gql.Ref('Organization'),
resolver=get_dataset_organization,
),
gql.Field(
name='owners',
type=gql.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,9 @@
gql.Field('imported', gql.Boolean),
gql.Field(
name='environment',
type=gql.Ref('Environment'),
type=gql.Ref('EnvironmentSimplified'),
resolver=resolve_dataset_environment,
),
gql.Field(
name='organization',
type=gql.Ref('Organization'),
resolver=resolve_dataset_organization,
),
gql.Field(
name='owners',
type=gql.String,
Expand Down
7 changes: 1 addition & 6 deletions backend/dataall/modules/s3_datasets/api/dataset/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,9 @@
gql.Field(name='imported', type=gql.Boolean),
gql.Field(
name='environment',
type=gql.Ref('Environment'),
type=gql.Ref('EnvironmentSimplified'),
resolver=get_dataset_environment,
),
gql.Field(
name='organization',
type=gql.Ref('Organization'),
resolver=get_dataset_organization,
),
gql.Field(
name='owners',
type=gql.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const DashboardListItem = (props) => {
</Grid>
<Grid item md={8} xs={6}>
<Typography color="textPrimary" variant="body2">
{dashboard.environment.AwsAccountId}
{dashboard.AwsAccountId}
</Typography>
</Grid>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const DashboardOverview = (props) => {
<ObjectMetadata
environment={dashboard.environment}
region={dashboard.environment.region}
organization={dashboard.organization}
organization={dashboard.environment.organization}
owner={dashboard.owner}
admins={dashboard.SamlGroupName || '-'}
created={dashboard.created}
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/modules/Dashboards/services/getDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export const getDashboard = (dashboardUri) => ({
DashboardId
upvotes
environment {
environmentUri
label
region
}
organization {
organizationUri
label
name
organization {
organizationUri
label
}
}
terms {
count
Expand Down
8 changes: 1 addition & 7 deletions frontend/src/modules/Dashboards/services/searchDashboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,16 @@ export const searchDashboards = (filter) => ({
name
owner
SamlGroupName
AwsAccountId
description
label
created
tags
userRoleForDashboard
upvotes
organization {
organizationUri
label
name
}
environment {
environmentUri
name
label
AwsAccountId
region
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import {
Typography
} from '@mui/material';
import PropTypes from 'prop-types';
import { Label } from 'design';
import { Label, UserModal } from 'design';
import { isFeatureEnabled } from 'utils';
import { UserModal } from 'design';
import { useState } from 'react';

export const DatasetGovernance = (props) => {
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/modules/DatasetsBase/services/listDatasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ export const listDatasets = ({ filter }) => ({
userRoleInEnvironment
tags
topics
organization {
organizationUri
label
}
AwsAccountId
environment {
label
AwsAccountId
region
organization {
organizationUri
label
}
}
stack {
status
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { useState } from 'react';
import { Box, Grid } from '@mui/material';
import PropTypes from 'prop-types';
import { ObjectBrief, ObjectMetadata } from 'design';
import { UserModal } from 'design';
import { ObjectBrief, ObjectMetadata, UserModal } from 'design';
import { EnvironmentConsoleAccess } from './EnvironmentConsoleAccess';
import { EnvironmentFeatures } from './EnvironmentFeatures';

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/modules/Folders/components/FolderOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export const FolderOverview = (props) => {
</Grid>
<Grid item lg={4} xl={3} xs={12}>
<ObjectMetadata
environment={folder.dataset.environment.label}
environment={folder.dataset.environment}
region={folder.dataset.region}
organization={folder.dataset.organization.label}
organization={folder.dataset.environment.organization}
owner={folder.owner}
admins={folder.dataset.SamlAdminGroupName || '-'}
created={folder.created}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ export const getDatasetStorageLocation = (locationUri) => ({
S3BucketName
AwsAccountId
owner
organization {
label
}
environment {
environmentUri
label
region
subscriptionsEnabled
subscriptionsProducersTopicImported
subscriptionsConsumersTopicImported
subscriptionsConsumersTopicName
subscriptionsProducersTopicName
organization {
organizationUri
label
}
}
}
owner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { useState } from 'react';
import { Box, Grid } from '@mui/material';
import PropTypes from 'prop-types';
import { ObjectBrief, ObjectMetadata } from 'design';
import { UserModal } from 'design';
import { ObjectBrief, ObjectMetadata, UserModal } from 'design';

export const OrganizationOverview = (props) => {
const { organization, ...other } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const RedshiftDatasetOverview = (props) => {
<ObjectMetadata
environment={dataset.environment}
region={dataset.region}
organization={dataset.organization}
organization={dataset.environment.organization}
owner={dataset.owner}
created={dataset.created}
status={dataset.stack?.status}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const TableOverview = (props) => {
<ObjectMetadata
environment={table.dataset.environment}
region={table.dataset.region}
organization={table.dataset.organization}
organization={table.dataset.environment.organization}
owner={table.dataset.owner}
admins={table.dataset.SamlAdminGroupName || '-'}
created={table.created}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export const getRedshiftDataset = (datasetUri) => ({
topics
confidentiality
autoApprovalEnabled
organization {
organizationUri
label
}
terms {
count
nodes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ export const getRedshiftDatasetTable = ({ rsTableUri }) => ({
name
label
userRoleForDataset
organization {
label
}
environment {
environmentUri
label
region
organization {
organizationUri
label
}
}
region
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const DatasetOverview = (props) => {
<ObjectMetadata
environment={dataset.environment}
region={dataset.region}
organization={dataset.organization}
organization={dataset.environment.organization}
owner={dataset.owner}
created={dataset.created}
status={dataset.stack?.status}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/Tables/components/TableOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const TableOverview = (props) => {
<ObjectMetadata
environment={table.dataset.environment}
region={table.dataset.region}
organization={table.dataset.organization}
organization={table.dataset.environment.organization}
owner={table.owner}
admins={table.dataset.SamlAdminGroupName || '-'}
created={table.created}
Expand Down
13 changes: 5 additions & 8 deletions frontend/src/modules/Tables/services/getDatasetTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ export const getDatasetTable = (tableUri) => ({
SamlAdminGroupName
owner
confidentiality
organization {
label
}
environment {
environmentUri
label
region
subscriptionsEnabled
subscriptionsProducersTopicImported
subscriptionsConsumersTopicImported
subscriptionsConsumersTopicName
subscriptionsProducersTopicName
organization {
organizationUri
label
}
}
}
datasetUri
Expand Down
9 changes: 0 additions & 9 deletions frontend/src/services/graphql/Datasets/getDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ export const getDataset = (datasetUri) => ({
expirySetting
expiryMinDuration
expiryMaxDuration
organization {
organizationUri
label
}
terms {
count
nodes {
Expand All @@ -65,11 +61,6 @@ export const getDataset = (datasetUri) => ({
environmentUri
label
region
subscriptionsEnabled
subscriptionsProducersTopicImported
subscriptionsConsumersTopicImported
subscriptionsConsumersTopicName
subscriptionsProducersTopicName
organization {
organizationUri
label
Expand Down
24 changes: 12 additions & 12 deletions tests/modules/dashboards/test_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ def test_get_dashboard(client, env_fixture, db, dashboard, group):
label
created
tags
environment{
label
region
}
organization{
environment {
environmentUri
label
region
organization {
organizationUri
label
name
}
}
}
}
Expand Down Expand Up @@ -211,14 +211,14 @@ def test_request_dashboard_share(
label
created
tags
environment{
label
region
}
organization{
environment {
environmentUri
label
region
organization {
organizationUri
label
name
}
}
}
}
Expand Down
Loading
Loading