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

feat: Clone DataDocs into other Environments #1419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baumandm
Copy link
Contributor

@baumandm baumandm commented Mar 4, 2024

Adds support for cloning a DataDoc into another environment.

  • Refactored the Clone button logic into a sub component of the DataDocRightSidebar
  • Added a <Select> with the environments available to the user
  • Defaults to the current environment
  • Added an optional POST parameter environment_id to the clone endpoint
  • The API call is backwards-compatible, defaults to the DataDoc's environment as before
  • Redirects to the DataDoc in the selected environment after cloning.

Screenshot 2024-03-04 at 1 16 59 PM

The cloned DataDoc may use Query Engines that are not available in the selected environment, which gives Invalid Query Cell warnings as shown below. This is not automatically adjusted during the clone process, it needs to be manually fixed after cloning. IMHO this is preferable since it ensures a human will review the selected Query Engines for correctness.

Screenshot 2024-03-04 at 1 50 11 PM

Copy link
Collaborator

@jczhong84 jczhong84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR @baumandm !

onEnvironmentChange: (environment: IEnvironment) => void;
}

export const DataDocCloneButtonConfirm: React.FunctionComponent<IProps> = ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this component name seems a bit weird to me. I think this component could be just an environment selector, and move the messages to the DataDocCloneButton component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants