Skip to content

Commit

Permalink
Add repositoryDisplayName to AbstractMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
maximmig committed Dec 31, 2024
1 parent 07158b5 commit f3918ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion providers/gitee/utils/observeIndexPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const observeIndexPage = (metadata, tools) => {
toolName.textContent = tool.name;
const projectName = document.createElement("span");
projectName.classList.add("tool-item-description");
projectName.textContent = `${metadata.repository}${metadata.branch}`;
projectName.textContent = metadata.repositoryDisplayName;
toolDataContainer.append(toolName, projectName);

toolItem.append(icon, toolDataContainer);
Expand Down
4 changes: 4 additions & 0 deletions src/models/AbstractMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ export default class AbstractMetadata {
get sshCloneUrl() {
throw new Error("Abstract property 'sshCloneUrl' must be implemented in derived class.");
}

get repositoryDisplayName() {
return `${this.repository}${this.branch}`;
}
}
2 changes: 1 addition & 1 deletion src/services/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const initAction = async (metadata, tools) => {

await chrome.runtime.sendMessage({
type: "enable-page-action",
project: metadata.repository,
project: metadata.repositoryDisplayName,
https: metadata.httpsCloneUrl,
ssh: metadata.sshCloneUrl,
});
Expand Down

0 comments on commit f3918ee

Please sign in to comment.