fix(ui): hide git note add button for commit if commit already has a note (#6613)
Regression from f5c0570533
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6613
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
	
	
This commit is contained in:
		
					parent
					
						
							
								e35afe475a
							
						
					
				
			
			
				commit
				
					
						d68e0d3e39
					
				
			
		
					 2 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -128,9 +128,11 @@
 | 
			
		|||
											</form>
 | 
			
		||||
										</div>
 | 
			
		||||
									</div>
 | 
			
		||||
									<div id="commit-notes-add-button" class="item">
 | 
			
		||||
										{{ctx.Locale.Tr "repo.diff.git-notes.add"}}
 | 
			
		||||
									</div>
 | 
			
		||||
									{{if not .NoteRendered}}
 | 
			
		||||
										<div id="commit-notes-add-button" class="item">
 | 
			
		||||
											{{ctx.Locale.Tr "repo.diff.git-notes.add"}}
 | 
			
		||||
										</div>
 | 
			
		||||
									{{end}}
 | 
			
		||||
								</div>
 | 
			
		||||
							</div>
 | 
			
		||||
						{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,6 +8,9 @@ test('Change git note', async ({page}) => {
 | 
			
		|||
  let response = await page.goto('/user2/repo1/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d');
 | 
			
		||||
  expect(response?.status()).toBe(200);
 | 
			
		||||
 | 
			
		||||
  // An add button should not be present, because the commit already has a commit note
 | 
			
		||||
  await expect(page.locator('#commit-notes-add-button')).toHaveCount(0);
 | 
			
		||||
 | 
			
		||||
  await page.locator('#commit-notes-edit-button').click();
 | 
			
		||||
 | 
			
		||||
  let textarea = page.locator('textarea[name="notes"]');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue