Skip to content

Commit 89f8bbe

Browse files
authored
chore: replace flutter repo address (#425)
1 parent 09273ce commit 89f8bbe

File tree

2 files changed

+27
-39
lines changed

2 files changed

+27
-39
lines changed

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
"editor.formatOnSave": true,
2222
"editor.defaultFormatter": "esbenp.prettier-vscode"
2323
},
24-
"cSpell.words": ["tdesign"],
24+
"cSpell.words": ["tdesign","miniprogram"],
2525
"cSpell.ignorePaths": ["pnpm-lock.yaml", "node_modules", ".git", ".vscode"]
2626
}

packages/components/src/components/td-doc-header/td-doc-issue/index.js

+26-38
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
import { html, define } from "hybrids";
2-
import style from "./style.less";
3-
import infoIcon from "@images/info.svg?raw";
4-
import checkIcon from "@images/check.svg?raw";
5-
import addIcon from "@images/add.svg?raw";
6-
import { isIntranet } from "@utils/index";
1+
import { html, define } from 'hybrids';
2+
import style from './style.less';
3+
import infoIcon from '@images/info.svg?raw';
4+
import checkIcon from '@images/check.svg?raw';
5+
import addIcon from '@images/add.svg?raw';
6+
import { isIntranet } from '@utils/index';
77

8-
const getIssueHelper = (framework) =>
9-
`https://github.com/Tencent/tdesign-${framework}/issues/new/choose`;
8+
const getIssueHelper = (framework) => `https://github.com/Tencent/tdesign-${framework}/issues/new/choose`;
109

1110
// 已开源的不区分内外网 统一去外网 GitHub
1211
const issueUrlMap = {
1312
vue: `https://github.com/Tencent/tdesign-vue/issues`,
1413
react: `https://github.com/Tencent/tdesign-react/issues`,
15-
"vue-next": `https://github.com/Tencent/tdesign-vue-next/issues`,
16-
"mobile-vue": `https://github.com/Tencent/tdesign-mobile-vue/issues`,
17-
"mobile-react": `https://github.com/Tencent/tdesign-mobile-react/issues`,
14+
'vue-next': `https://github.com/Tencent/tdesign-vue-next/issues`,
15+
'mobile-vue': `https://github.com/Tencent/tdesign-mobile-vue/issues`,
16+
'mobile-react': `https://github.com/Tencent/tdesign-mobile-react/issues`,
1817
miniprogram: `https://github.com/Tencent/tdesign-miniprogram/issues`,
19-
flutter: `https://github.com/TDesignOteam/tdesign-flutter/issues`,
18+
flutter: `https://github.com/Tencent/tdesing-flutter/issues`,
2019
};
2120

2221
function parseUrl() {
2322
let urlPath = location.pathname;
2423
// 预览站点为hash模式
25-
if (location.pathname === "/" && location.hash) {
24+
if (location.pathname === '/' && location.hash) {
2625
urlPath = location.hash.slice(1);
2726
}
2827
const matches = urlPath.match(/([\w-]+)\/components\/([\w-]+)/) || [];
@@ -34,9 +33,7 @@ function getCurrentIssueUrl() {
3433
const [, framework, componentName] = parseUrl();
3534

3635
return {
37-
newUrl: isIntranet()
38-
? `${issueUrlMap[framework]}/new`
39-
: getIssueHelper(framework),
36+
newUrl: isIntranet() ? `${issueUrlMap[framework]}/new` : getIssueHelper(framework),
4037
openUrl: isIntranet()
4138
? `${issueUrlMap[framework]}?issue_search=${componentName}`
4239
: `${issueUrlMap[framework]}?q=is:issue+is:open+${componentName}`,
@@ -49,7 +46,7 @@ function getCurrentIssueUrl() {
4946
function handleIssueClick(e, issueInfo, type) {
5047
e.preventDefault();
5148
const url = issueInfo[`${type}Url`];
52-
window.open(url, "_blank");
49+
window.open(url, '_blank');
5350
}
5451

5552
function renderIssue(host) {
@@ -67,35 +64,26 @@ function renderIssue(host) {
6764

6865
return html`
6966
<section id="issue" class="TDesign-component-issue">
70-
<a
71-
onclick="${(host, e) => handleIssueClick(e, issueInfo, "new")}"
72-
class="item"
73-
>
67+
<a onclick="${(host, e) => handleIssueClick(e, issueInfo, 'new')}" class="item">
7468
<i innerHTML=${addIcon}></i>
7569
<span>Issue</span>
7670
</a>
77-
<a
78-
onclick="${(host, e) => handleIssueClick(e, issueInfo, "open")}"
79-
class="item"
80-
>
71+
<a onclick="${(host, e) => handleIssueClick(e, issueInfo, 'open')}" class="item">
8172
<i innerHTML=${infoIcon}></i>
82-
<span>${issueInfo?.openNum || ""} Open</span>
73+
<span>${issueInfo?.openNum || ''} Open</span>
8374
</a>
84-
<a
85-
onclick="${(host, e) => handleIssueClick(e, issueInfo, "closed")}"
86-
class="item"
87-
>
75+
<a onclick="${(host, e) => handleIssueClick(e, issueInfo, 'closed')}" class="item">
8876
<i innerHTML=${checkIcon}></i>
89-
<span>${issueInfo?.closedNum || ""} Closed</span>
77+
<span>${issueInfo?.closedNum || ''} Closed</span>
9078
</a>
9179
</section>
9280
`;
9381
}
9482

9583
// 获取 github issue 数量
96-
const getGithubIssueUrl = (name, state = "open", repo) =>
84+
const getGithubIssueUrl = (name, state = 'open', repo) =>
9785
`https://api.github.com/search/issues?q=is:issue+is:${state}+${name}+repo:Tencent/${repo}`;
98-
function fetchGithubIssueNum(host, name, state = "open", framework) {
86+
function fetchGithubIssueNum(host, name, state = 'open', framework) {
9987
const issueUrl = getGithubIssueUrl(name, state, `tdesign-${framework}`);
10088
const cacheKey = `__tdesign_${framework}_${name}_${state}__`;
10189
const cache = sessionStorage.getItem(cacheKey);
@@ -117,23 +105,23 @@ function fetchGithubIssueNum(host, name, state = "open", framework) {
117105
}
118106

119107
export default define({
120-
tag: "td-doc-issue",
108+
tag: 'td-doc-issue',
121109
openNum: {
122-
get: (_host, lastValue) => lastValue || "",
110+
get: (_host, lastValue) => lastValue || '',
123111
set: (_host, value) => value,
124112
connect: (host) => {
125113
const [, framework, componentName] = parseUrl();
126114
if (!componentName) return;
127-
fetchGithubIssueNum(host, componentName, "open", framework);
115+
fetchGithubIssueNum(host, componentName, 'open', framework);
128116
},
129117
},
130118
closedNum: {
131-
get: (_host, lastValue) => lastValue || "",
119+
get: (_host, lastValue) => lastValue || '',
132120
set: (_host, value) => value,
133121
connect: (host) => {
134122
const [, framework, componentName] = parseUrl();
135123
if (!componentName) return;
136-
fetchGithubIssueNum(host, componentName, "closed", framework);
124+
fetchGithubIssueNum(host, componentName, 'closed', framework);
137125
},
138126
},
139127
render: (host) => html`${renderIssue(host)}`.css`${style}`,

0 commit comments

Comments
 (0)