tablelandnetwork / studio

Discover, design, deploy, and manage data driven web3 apps on Tableland.
https://studio.tableland.xyz
4 stars 1 forks source link

Project settings #263

Closed asutula closed 5 months ago

asutula commented 5 months ago

Adds support for editing project information and deleting a project. Should look familiar to the PR for team settings.

Closes ENG-547, ENG-548, ENG-549, ENG-550

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
studio ❌ Failed (Inspect) Apr 27, 2024 2:43pm
asutula commented 5 months ago

While running this locally, I noticed two things that seem a little off.

  1. If I create a project called Foo, then edit it to have the name foo (all lower case). It says the name is unavailable. This means that whatever casing I choose is locked in unless I change the name to something different and then change it back to what it was with a different casing.
  2. If I update the description text everything saves as expected, but after the save completes the submit and reset buttons stay active. I can save over and over even though the description isn't changing. If I click the reset button the description goes back to what it was when the page loaded, not what it's current value is in the database.

Cool, thanks for checking it out.

  1. We're checking that the slug-ified version of the name is available. The slugs for Foo and foo are both foo. Does that explain what you're seeing? I'm trying to think of the logic we could use to allow changing the casing of a team name... Sounds possible.
  2. I'll look into that for sure. Sounds buggy.
joewagner commented 5 months ago
  1. We're checking that the slug-ified version of the name is available. The slugs for Foo and foo are both foo. Does that explain what you're seeing? I'm trying to think of the logic we could use to allow changing the casing of a team name... Sounds possible.

Yep that explains it. It looks like the logic we want might be "does the slugified name already exists, and is it not this record"

The sql query might be:

select * from projects_421614_6 as projects
    inner join team_projects_421614_10 as team_projects on projects.id = team_projects.project_id
    where team_projects.team_id = <teamId> and projects.slug = <nameSlug> and projects.id != <thisProjectsId>;

The addition being the last bit and projects.id != <thisProjectsId>

asutula commented 5 months ago

Nice @joewagner that makes sense. I'll try out that logic.

You did actually uncover a bug in checking for project name availability... I wasn't passing the team id to the query, so it was using the default team (personal team, whatever you want to call it). This was resulting in some strange behavior. Just pushed that fix.

linear[bot] commented 5 months ago

ENG-547 Delete project

ENG-549 Delete project API

ENG-548 Edit project

ENG-550 Edit project API