Adrià Vilanova MartÃnez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 4 | |
| 5 | /** |
| 6 | * @fileoverview Functions that support project name checks when |
| 7 | * creating a new project. |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Function that communicates with the server. |
| 12 | * @param {string} projectName The proposed project name. |
| 13 | */ |
| 14 | async function checkProjectName(projectName) { |
| 15 | const message = { |
| 16 | project_name: projectName |
| 17 | }; |
| 18 | const response = await window.prpcClient.call( |
| 19 | 'monorail.Projects', 'CheckProjectName', message); |
| 20 | if (response.error) { |
| 21 | $('projectnamefeedback').textContent = response.error; |
| 22 | $('submit_btn').disabled = 'disabled'; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // Make this function globally available |
| 27 | _CP_checkProjectName = checkProjectName; |