Skip to content

feat(site): Duplicate template #6853

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

Merged
merged 11 commits into from
Mar 30, 2023
Merged

feat(site): Duplicate template #6853

merged 11 commits into from
Mar 30, 2023

Conversation

BrunoQuaresma
Copy link
Collaborator

Screen.Recording.2023-03-28.at.13.41.12.mov

I'm going to work on the tests when the flow is validated from @bpmct

Closes #6118

@BrunoQuaresma BrunoQuaresma requested a review from a team March 28, 2023 16:44
@BrunoQuaresma BrunoQuaresma self-assigned this Mar 28, 2023
@BrunoQuaresma BrunoQuaresma requested review from rodrimaia and removed request for a team March 28, 2023 16:44
bpmct
bpmct previously requested changes Mar 28, 2023
Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

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

Awesome! Noticed a few things:

  • Duplicating a template with no display name will make a display name Copy

  • Duplicating the built-in docker template returns the following error:

    Screen.Recording.2023-03-28.at.2.43.35.PM.mov

I tried importing another template with coder templates init (using Docker template) and ran into the same one. I tried with both localhost:3000 and localhost:8080. Any idea why this is happening?

@BrunoQuaresma
Copy link
Collaborator Author

Duplicating a template with no display name will make a display name Copy

Is it ok if we just left the field blank?

Duplicating the built-in docker template returns the following error:

I will take a look into that 🤔

@mtojek mtojek self-requested a review March 29, 2023 12:02
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

just a side note: do we need to check user template permissions here? so that only template authors can copy the template.

@BrunoQuaresma
Copy link
Collaborator Author

@mtojek Yes! Good catch.

@BrunoQuaresma
Copy link
Collaborator Author

@bpmct do you mind taking a look into it and see if that works as expected now pls?

@BrunoQuaresma BrunoQuaresma requested review from bpmct and mtojek March 29, 2023 18:15
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

The code logic is 👍 . My biggest concern is the lack of consistency between the public name and codebase: Duplicate a template vs. copy. I think that you should unify this, and just stick to duplicate. I know that these are synonyms, but it will be easier to work with code later.

@BrunoQuaresma BrunoQuaresma dismissed bpmct’s stale review March 30, 2023 11:36

I fixed the issues that you brought! Waiting for a new review.

@BrunoQuaresma BrunoQuaresma merged commit b26f306 into main Mar 30, 2023
@BrunoQuaresma BrunoQuaresma deleted the bq/copy-from-template branch March 30, 2023 14:42
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

template editor: duplicate an existing template
4 participants