Compare commits
No commits in common. "03c2fe0cc78633e684d5e63c81ee87ba7cd560cd" and "577f6bb0bd3bc002de2e5fa1dc8c102618f202f3" have entirely different histories.
03c2fe0cc7
...
577f6bb0bd
@ -396,8 +396,7 @@
|
|||||||
return {
|
return {
|
||||||
authors: options.records.map((record) => ({
|
authors: options.records.map((record) => ({
|
||||||
authorId: record.authorId,
|
authorId: record.authorId,
|
||||||
authorName: record.authorName,
|
authorName: record.authorName
|
||||||
...record.coreUserId ? { authorUid: record.coreUserId } : {}
|
|
||||||
})),
|
})),
|
||||||
batchName,
|
batchName,
|
||||||
createdAt: options.createdAt,
|
createdAt: options.createdAt,
|
||||||
@ -443,7 +442,6 @@
|
|||||||
return {
|
return {
|
||||||
authorId: readString(readMarketFieldValue(row, attributeDatas, "star_id")) ?? readString(readMarketFieldValue(row, attributeDatas, "id")) ?? "",
|
authorId: readString(readMarketFieldValue(row, attributeDatas, "star_id")) ?? readString(readMarketFieldValue(row, attributeDatas, "id")) ?? "",
|
||||||
authorName: readString(readMarketFieldValue(row, attributeDatas, "nickname")) ?? readString(readMarketFieldValue(row, attributeDatas, "nick_name")) ?? "",
|
authorName: readString(readMarketFieldValue(row, attributeDatas, "nickname")) ?? readString(readMarketFieldValue(row, attributeDatas, "nick_name")) ?? "",
|
||||||
coreUserId: readString(readMarketFieldValue(row, attributeDatas, "core_user_id")) ?? void 0,
|
|
||||||
exportFields: buildMarketExportFieldFallbacks(row, attributeDatas),
|
exportFields: buildMarketExportFieldFallbacks(row, attributeDatas),
|
||||||
hasDirectRatesSource: true,
|
hasDirectRatesSource: true,
|
||||||
location: readMarketLocation(row, attributeDatas),
|
location: readMarketLocation(row, attributeDatas),
|
||||||
@ -1739,7 +1737,6 @@
|
|||||||
return {
|
return {
|
||||||
authorId: readString2(record.authorId) ?? "",
|
authorId: readString2(record.authorId) ?? "",
|
||||||
authorName: readString2(record.authorName) ?? "",
|
authorName: readString2(record.authorName) ?? "",
|
||||||
coreUserId: readString2(record.coreUserId) ?? void 0,
|
|
||||||
exportFields: readSerializedExportFields(record),
|
exportFields: readSerializedExportFields(record),
|
||||||
hasDirectRatesSource: Boolean(singleVideoAfterSearchRate),
|
hasDirectRatesSource: Boolean(singleVideoAfterSearchRate),
|
||||||
location: readString2(record.location) ?? void 0,
|
location: readString2(record.location) ?? void 0,
|
||||||
@ -1962,7 +1959,6 @@
|
|||||||
return {
|
return {
|
||||||
authorId: preferredRow.authorId || baseRow.authorId,
|
authorId: preferredRow.authorId || baseRow.authorId,
|
||||||
authorName: preferredRow.authorName || baseRow.authorName,
|
authorName: preferredRow.authorName || baseRow.authorName,
|
||||||
coreUserId: mergeNonEmptyString(baseRow.coreUserId, preferredRow.coreUserId),
|
|
||||||
exportFields: mergeExportFieldMaps(baseRow.exportFields, preferredRow.exportFields),
|
exportFields: mergeExportFieldMaps(baseRow.exportFields, preferredRow.exportFields),
|
||||||
hasDirectRatesSource: preferredRow.hasDirectRatesSource || baseRow.hasDirectRatesSource,
|
hasDirectRatesSource: preferredRow.hasDirectRatesSource || baseRow.hasDirectRatesSource,
|
||||||
location: mergeNonEmptyString(baseRow.location, preferredRow.location),
|
location: mergeNonEmptyString(baseRow.location, preferredRow.location),
|
||||||
@ -2435,7 +2431,6 @@
|
|||||||
...existingRecord,
|
...existingRecord,
|
||||||
...incomingRecord,
|
...incomingRecord,
|
||||||
authorName: mergeStringValue(existingRecord.authorName, incomingRecord.authorName) ?? "",
|
authorName: mergeStringValue(existingRecord.authorName, incomingRecord.authorName) ?? "",
|
||||||
coreUserId: mergeStringValue(existingRecord.coreUserId, incomingRecord.coreUserId),
|
|
||||||
exportFields: mergeFieldMap(
|
exportFields: mergeFieldMap(
|
||||||
existingRecord.exportFields,
|
existingRecord.exportFields,
|
||||||
incomingRecord.exportFields
|
incomingRecord.exportFields
|
||||||
@ -3223,7 +3218,6 @@
|
|||||||
...existingRecord,
|
...existingRecord,
|
||||||
...incomingRecord,
|
...incomingRecord,
|
||||||
authorName: mergeStringValue2(existingRecord.authorName, incomingRecord.authorName) ?? "",
|
authorName: mergeStringValue2(existingRecord.authorName, incomingRecord.authorName) ?? "",
|
||||||
coreUserId: mergeStringValue2(existingRecord.coreUserId, incomingRecord.coreUserId),
|
|
||||||
exportFields: mergeFieldMap2(
|
exportFields: mergeFieldMap2(
|
||||||
existingRecord.exportFields,
|
existingRecord.exportFields,
|
||||||
incomingRecord.exportFields
|
incomingRecord.exportFields
|
||||||
@ -3314,10 +3308,6 @@
|
|||||||
const existingRecord = records.get(row.authorId);
|
const existingRecord = records.get(row.authorId);
|
||||||
if (existingRecord) {
|
if (existingRecord) {
|
||||||
existingRecord.authorName = mergeStringValue3(existingRecord.authorName, row.authorName) ?? existingRecord.authorName;
|
existingRecord.authorName = mergeStringValue3(existingRecord.authorName, row.authorName) ?? existingRecord.authorName;
|
||||||
existingRecord.coreUserId = mergeStringValue3(
|
|
||||||
existingRecord.coreUserId,
|
|
||||||
row.coreUserId
|
|
||||||
);
|
|
||||||
existingRecord.location = mergeStringValue3(
|
existingRecord.location = mergeStringValue3(
|
||||||
existingRecord.location,
|
existingRecord.location,
|
||||||
row.location
|
row.location
|
||||||
@ -3935,10 +3925,6 @@
|
|||||||
function toMarketRecord(rowSnapshot) {
|
function toMarketRecord(rowSnapshot) {
|
||||||
const existingRecord = resultStore.getRecord(rowSnapshot.authorId);
|
const existingRecord = resultStore.getRecord(rowSnapshot.authorId);
|
||||||
const authorName = mergeStringValue4(existingRecord?.authorName, rowSnapshot.authorName) ?? "";
|
const authorName = mergeStringValue4(existingRecord?.authorName, rowSnapshot.authorName) ?? "";
|
||||||
const coreUserId = mergeStringValue4(
|
|
||||||
existingRecord?.coreUserId,
|
|
||||||
rowSnapshot.coreUserId
|
|
||||||
);
|
|
||||||
const location2 = mergeStringValue4(existingRecord?.location, rowSnapshot.location);
|
const location2 = mergeStringValue4(existingRecord?.location, rowSnapshot.location);
|
||||||
const price21To60s = mergeStringValue4(
|
const price21To60s = mergeStringValue4(
|
||||||
existingRecord?.price21To60s,
|
existingRecord?.price21To60s,
|
||||||
@ -3953,7 +3939,6 @@
|
|||||||
rowSnapshot.backendMetrics
|
rowSnapshot.backendMetrics
|
||||||
),
|
),
|
||||||
backendMetricsStatus: existingRecord?.backendMetricsStatus ?? "idle",
|
backendMetricsStatus: existingRecord?.backendMetricsStatus ?? "idle",
|
||||||
coreUserId,
|
|
||||||
exportFields: withExportFieldFallbacks(
|
exportFields: withExportFieldFallbacks(
|
||||||
mergeFieldMap4(existingRecord?.exportFields, rowSnapshot.exportFields),
|
mergeFieldMap4(existingRecord?.exportFields, rowSnapshot.exportFields),
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,7 +58,6 @@
|
|||||||
return {
|
return {
|
||||||
authorId: readString(readMarketFieldValue(row, attributeDatas, "star_id")) ?? readString(readMarketFieldValue(row, attributeDatas, "id")) ?? "",
|
authorId: readString(readMarketFieldValue(row, attributeDatas, "star_id")) ?? readString(readMarketFieldValue(row, attributeDatas, "id")) ?? "",
|
||||||
authorName: readString(readMarketFieldValue(row, attributeDatas, "nickname")) ?? readString(readMarketFieldValue(row, attributeDatas, "nick_name")) ?? "",
|
authorName: readString(readMarketFieldValue(row, attributeDatas, "nickname")) ?? readString(readMarketFieldValue(row, attributeDatas, "nick_name")) ?? "",
|
||||||
coreUserId: readString(readMarketFieldValue(row, attributeDatas, "core_user_id")) ?? void 0,
|
|
||||||
exportFields: buildMarketExportFieldFallbacks(row, attributeDatas),
|
exportFields: buildMarketExportFieldFallbacks(row, attributeDatas),
|
||||||
hasDirectRatesSource: true,
|
hasDirectRatesSource: true,
|
||||||
location: readMarketLocation(row, attributeDatas),
|
location: readMarketLocation(row, attributeDatas),
|
||||||
@ -505,7 +504,6 @@
|
|||||||
return {
|
return {
|
||||||
authorId: readString2(row.star_id) ?? readString2(attributeDatas.id) ?? "",
|
authorId: readString2(row.star_id) ?? readString2(attributeDatas.id) ?? "",
|
||||||
authorName: readString2(attributeDatas.nickname) ?? readString2(row.nick_name) ?? "",
|
authorName: readString2(attributeDatas.nickname) ?? readString2(row.nick_name) ?? "",
|
||||||
coreUserId: readString2(attributeDatas.core_user_id) ?? void 0,
|
|
||||||
singleVideoAfterSearchRate
|
singleVideoAfterSearchRate
|
||||||
};
|
};
|
||||||
}).filter((row) => Boolean(row.authorId || row.authorName));
|
}).filter((row) => Boolean(row.authorId || row.authorName));
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
export const DEFAULT_BATCH_SUBMIT_BASE_URL = "http://192.168.31.21:8083";
|
export const DEFAULT_BATCH_SUBMIT_BASE_URL = "http://localhost:8083";
|
||||||
|
|||||||
@ -126,42 +126,4 @@ describe("market-page-bridge", () => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("serializes core user ids from the live market list", async () => {
|
|
||||||
const marketRoot = document.querySelector(".base-author-list") as HTMLElement & {
|
|
||||||
__vue__?: {
|
|
||||||
_setupState?: Record<string, unknown>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
marketRoot.__vue__ = {
|
|
||||||
_setupState: {
|
|
||||||
marketState: {
|
|
||||||
marketList: [
|
|
||||||
{
|
|
||||||
attribute_datas: {
|
|
||||||
avg_search_after_view_rate_30d: "0.1234",
|
|
||||||
core_user_id: "core-111",
|
|
||||||
nickname: "搜索达人"
|
|
||||||
},
|
|
||||||
star_id: "search-1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
await import("../src/content/market/page-bridge");
|
|
||||||
|
|
||||||
expect(
|
|
||||||
JSON.parse(
|
|
||||||
document.documentElement.getAttribute("data-sces-market-rows") ?? "[]"
|
|
||||||
)
|
|
||||||
).toEqual([
|
|
||||||
expect.objectContaining({
|
|
||||||
authorId: "search-1",
|
|
||||||
authorName: "搜索达人",
|
|
||||||
coreUserId: "core-111"
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user