Add name_only for data fetch in /newfeatures (#4374)
* Add name_only for newfeatures page * Make name_only a backend param only
This commit is contained in:
Родитель
d5f5788230
Коммит
25c62d981b
|
@ -44,6 +44,10 @@ export class ChromedashAllFeaturesPage extends LitElement {
|
|||
num = 100;
|
||||
@state()
|
||||
starredFeatures: Set<number> = new Set();
|
||||
@state()
|
||||
isNewfeaturesPage = false;
|
||||
@state()
|
||||
nameOnly = false;
|
||||
|
||||
@queryAll('chromedash-feature-table')
|
||||
chromedashFeatureTables;
|
||||
|
@ -83,6 +87,9 @@ export class ChromedashAllFeaturesPage extends LitElement {
|
|||
) {
|
||||
this.num = parseInt(this.rawQuery['num']);
|
||||
}
|
||||
if (this.isNewfeaturesPage) {
|
||||
this.nameOnly = true;
|
||||
}
|
||||
}
|
||||
|
||||
fetchData() {
|
||||
|
@ -131,6 +138,7 @@ export class ChromedashAllFeaturesPage extends LitElement {
|
|||
.sortSpec=${this.sortSpec}
|
||||
.start=${this.start}
|
||||
.num=${this.num}
|
||||
.nameOnly=${this.nameOnly}
|
||||
?showQuery=${this.showQuery}
|
||||
?signedIn=${Boolean(this.user)}
|
||||
?canEdit=${this.user && this.user.can_edit_all}
|
||||
|
|
|
@ -362,6 +362,7 @@ export class ChromedashApp extends LitElement {
|
|||
if (!this.setupNewPage(ctx, 'chromedash-all-features-page', true)) return;
|
||||
this.pageComponent.user = this.user;
|
||||
this.pageComponent.rawQuery = parseRawQuery(ctx.querystring);
|
||||
this.pageComponent.isNewfeaturesPage = true;
|
||||
this.pageComponent.addEventListener(
|
||||
'search',
|
||||
this.handleSearchQuery.bind(this)
|
||||
|
|
|
@ -46,6 +46,8 @@ export class ChromedashFeatureTable extends LitElement {
|
|||
columns!: 'normal' | 'approvals';
|
||||
@property({type: Boolean})
|
||||
signedIn!: boolean;
|
||||
@property({type: Boolean})
|
||||
nameOnly = false;
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
|
@ -61,7 +63,8 @@ export class ChromedashFeatureTable extends LitElement {
|
|||
this.showEnterprise,
|
||||
this.sortSpec,
|
||||
this.start,
|
||||
this.num
|
||||
this.num,
|
||||
this.nameOnly
|
||||
)
|
||||
.then(resp => {
|
||||
this.features = resp.features;
|
||||
|
|
|
@ -576,7 +576,14 @@ export class ChromeStatusClient {
|
|||
return this.doGet(`/features?releaseNotesMilestone=${milestone}`);
|
||||
}
|
||||
|
||||
async searchFeatures(userQuery, showEnterprise, sortSpec, start, num) {
|
||||
async searchFeatures(
|
||||
userQuery,
|
||||
showEnterprise,
|
||||
sortSpec,
|
||||
start,
|
||||
num,
|
||||
nameOnly
|
||||
) {
|
||||
const query = new URLSearchParams();
|
||||
query.set('q', userQuery);
|
||||
if (showEnterprise) {
|
||||
|
@ -591,6 +598,9 @@ export class ChromeStatusClient {
|
|||
if (num) {
|
||||
query.set('num', num);
|
||||
}
|
||||
if (nameOnly) {
|
||||
query.set('name_only', nameOnly);
|
||||
}
|
||||
return this.doGet(`/features?${query.toString()}`);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче