-
Notifications
You must be signed in to change notification settings - Fork 14
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
Reprise d'API avec ScribouilliGitRepo à la place de (login, repoName) #134
Conversation
return { | ||
buildStatus: state.buildStatus, | ||
theme: state.theme, | ||
deleteRepositoryUrl: `https://github.com/${state.currentRepository.owner}/${state.currentRepository.name}/settings#danger-zone`, | ||
deleteRepositoryUrl: `${currentRepository.publicRepositoryURL}/settings#danger-zone`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peut-être que l'URL de suppression d'un repo, on peut aussi la mettre dans le ScribouilliGitRepo
. Je me dis qu'elle sera probablement différente pour GitLab. T'en penses quoi ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Après réflexion, on peut peut-être le faire dans ma PR où j'ajoute les calls à GitLab, histoire de pas charger cette PR de refacto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui, bien vu, ça devrait sortir pour être paramétrisé
Et effectivement, ça peut avoir lieu dans la PR gitlab
J'ai implémenté le parcours de login avec github+gitlab comme discuté (mais pas avec les bons textes) J'ai réussi à me login avec gitlab Je n'ai pas encore touché l'API gitlab |
Je nous mets ici le screenshot de ce qu'on a fait avec @maiwann hier : J'ai testé cette PR en local. Idem que toi, ça marche pour la connexion GitLab. Et ça marche aussi nickel quand je retourne pour me connecter avec GitHub 👍 |
</ul> | ||
|
||
<ul class="buttons"> | ||
<li><a href="./account?provider=gitlab.com" class="btn">gitlab.com</a></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
return this.callAPI( | ||
`${gitHubApiBaseUrl}/repos/${account}/${repositoryName}`, | ||
) | ||
getRepository({ owner, repoName }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'aime beaucoup ça, j'ai l'intuition que ça va nous aider si les arguments passés aux calls à l'API GitLab diffère de ceux à GitHub (par ex, l'origin de l'instance GitLab)
* @param {string} dir | ||
* @returns | ||
*/ | ||
async getPagesList(login, repoName, dir = '') { | ||
async getPagesList(scribouilliGitRepo, dir = '') { | ||
const allFiles = await this.fs.promises.readdir( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En testant la PR, j'arrive sur un cas, après avoir supprimé une page où allFiles
renvoie la page supprimée. Ce qui ensuite retourne un content
à undefined
sur cette ligne.
J'ai pas encore cherché où on peut régler ça. Je nous note ce bug ici en attendant.
Pfou, c'est du boulot et ça tire loin cette refonte d'API
J'ai commencé, mais c'est pas fini
J'arrête parce qu'il est tard, pas parce que c'est vain