Convert gr-change-view to typescript
The change converts the following files to typescript: * elements/change/gr-change-view/gr-change-view.ts Change-Id: I32a2ca2683757c8922e298b3c2d4336d3eb40dcf
This commit is contained in:
@@ -190,6 +190,17 @@ export enum SubmitType {
|
|||||||
INHERIT = 'INHERIT',
|
INHERIT = 'INHERIT',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#mergeable-info
|
||||||
|
*/
|
||||||
|
export enum MergeStrategy {
|
||||||
|
RECURSIVE = 'recursive',
|
||||||
|
RESOLVE = 'resolve',
|
||||||
|
SIMPLE_TWO_WAY_IN_CORE = 'simple-two-way-in-core',
|
||||||
|
OURS = 'ours',
|
||||||
|
THEIRS = 'theirs',
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enum for possible configured value in InheritedBooleanInfo.
|
* Enum for possible configured value in InheritedBooleanInfo.
|
||||||
* https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#inherited-boolean-info
|
* https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#inherited-boolean-info
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -300,6 +300,7 @@ suite('gr-change-view tests', () => {
|
|||||||
_fetchSharedCacheURL() { return Promise.resolve({}); },
|
_fetchSharedCacheURL() { return Promise.resolve({}); },
|
||||||
});
|
});
|
||||||
element = fixture.instantiate();
|
element = fixture.instantiate();
|
||||||
|
element._changeNum = '1';
|
||||||
sinon.stub(element.$.actions, 'reload').returns(Promise.resolve());
|
sinon.stub(element.$.actions, 'reload').returns(Promise.resolve());
|
||||||
getPluginLoader().loadPlugins([]);
|
getPluginLoader().loadPlugins([]);
|
||||||
pluginApi.install(
|
pluginApi.install(
|
||||||
@@ -333,6 +334,11 @@ suite('gr-change-view tests', () => {
|
|||||||
basePatchNum: 'PARENT',
|
basePatchNum: 'PARENT',
|
||||||
patchNum: 1,
|
patchNum: 1,
|
||||||
};
|
};
|
||||||
|
element._change = {
|
||||||
|
_number: '1',
|
||||||
|
project: '',
|
||||||
|
change_id: '1',
|
||||||
|
};
|
||||||
const getUrlStub = sinon.stub(GerritNav, 'getUrlForChange');
|
const getUrlStub = sinon.stub(GerritNav, 'getUrlForChange');
|
||||||
const replaceStateStub = sinon.stub(history, 'replaceState');
|
const replaceStateStub = sinon.stub(history, 'replaceState');
|
||||||
element._handleMessageAnchorTap({detail: {id: 'a12345'}});
|
element._handleMessageAnchorTap({detail: {id: 'a12345'}});
|
||||||
@@ -414,6 +420,7 @@ suite('gr-change-view tests', () => {
|
|||||||
|
|
||||||
suite('plugins adding to file tab', () => {
|
suite('plugins adding to file tab', () => {
|
||||||
setup(done => {
|
setup(done => {
|
||||||
|
element._changeNum = '1';
|
||||||
// Resolving it here instead of during setup() as other tests depend
|
// Resolving it here instead of during setup() as other tests depend
|
||||||
// on flush() not being called during setup.
|
// on flush() not being called during setup.
|
||||||
flush(() => done());
|
flush(() => done());
|
||||||
@@ -459,6 +466,7 @@ suite('gr-change-view tests', () => {
|
|||||||
queryMap.set('tab', PrimaryTab.FINDINGS);
|
queryMap.set('tab', PrimaryTab.FINDINGS);
|
||||||
// view is required
|
// view is required
|
||||||
element.params = {
|
element.params = {
|
||||||
|
changeNum: '1',
|
||||||
view: GerritNav.View.CHANGE,
|
view: GerritNav.View.CHANGE,
|
||||||
...element.params, queryMap};
|
...element.params, queryMap};
|
||||||
flush(() => {
|
flush(() => {
|
||||||
@@ -473,6 +481,7 @@ suite('gr-change-view tests', () => {
|
|||||||
queryMap.set('tab', 'random');
|
queryMap.set('tab', 'random');
|
||||||
// view is required
|
// view is required
|
||||||
element.params = {
|
element.params = {
|
||||||
|
changeNum: '1',
|
||||||
view: GerritNav.View.CHANGE,
|
view: GerritNav.View.CHANGE,
|
||||||
...element.params, queryMap};
|
...element.params, queryMap};
|
||||||
flush(() => {
|
flush(() => {
|
||||||
@@ -783,6 +792,7 @@ suite('gr-change-view tests', () => {
|
|||||||
getAllThreadsForChange: () => ([]),
|
getAllThreadsForChange: () => ([]),
|
||||||
computeDraftCount: () => 1,
|
computeDraftCount: () => 1,
|
||||||
}));
|
}));
|
||||||
|
element._changeNum = '1';
|
||||||
});
|
});
|
||||||
|
|
||||||
test('drafts are reloaded when reload-drafts fired', done => {
|
test('drafts are reloaded when reload-drafts fired', done => {
|
||||||
@@ -1415,6 +1425,7 @@ suite('gr-change-view tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('_handleCommitMessageSave trims trailing whitespace', () => {
|
test('_handleCommitMessageSave trims trailing whitespace', () => {
|
||||||
|
element._change = {};
|
||||||
const putStub = sinon.stub(element.$.restAPI, 'putChangeCommitMessage')
|
const putStub = sinon.stub(element.$.restAPI, 'putChangeCommitMessage')
|
||||||
.returns(Promise.resolve({}));
|
.returns(Promise.resolve({}));
|
||||||
|
|
||||||
@@ -1609,14 +1620,16 @@ suite('gr-change-view tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('_openReplyDialog called with `ANY` when coming from tap event',
|
test('_openReplyDialog called with `ANY` when coming from tap event',
|
||||||
() => {
|
done => {
|
||||||
|
flush(() => {
|
||||||
const openStub = sinon.stub(element, '_openReplyDialog');
|
const openStub = sinon.stub(element, '_openReplyDialog');
|
||||||
element._serverConfig = {};
|
|
||||||
MockInteractions.tap(element.$.replyBtn);
|
MockInteractions.tap(element.$.replyBtn);
|
||||||
assert(openStub.lastCall.calledWithExactly(
|
assert(openStub.lastCall.calledWithExactly(
|
||||||
element.$.replyDialog.FocusTarget.ANY),
|
element.$.replyDialog.FocusTarget.ANY),
|
||||||
'_openReplyDialog should have been passed ANY');
|
'_openReplyDialog should have been passed ANY');
|
||||||
assert.equal(openStub.callCount, 1);
|
assert.equal(openStub.callCount, 1);
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('_openReplyDialog called with `BODY` when coming from message reply' +
|
test('_openReplyDialog called with `BODY` when coming from message reply' +
|
||||||
@@ -1806,10 +1819,13 @@ suite('gr-change-view tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('reply button is disabled until server config is loaded', () => {
|
test('reply button is disabled until server config is loaded', done => {
|
||||||
assert.isTrue(element._replyDisabled);
|
assert.isTrue(element._replyDisabled);
|
||||||
element._serverConfig = {};
|
// fetches the server config on attached
|
||||||
|
flush(() => {
|
||||||
assert.isFalse(element._replyDisabled);
|
assert.isFalse(element._replyDisabled);
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
suite('commit message expand/collapse', () => {
|
suite('commit message expand/collapse', () => {
|
||||||
@@ -2189,6 +2205,11 @@ suite('gr-change-view tests', () => {
|
|||||||
basePatchNum: 'PARENT',
|
basePatchNum: 'PARENT',
|
||||||
patchNum: 1,
|
patchNum: 1,
|
||||||
};
|
};
|
||||||
|
element._change = {
|
||||||
|
_number: '1',
|
||||||
|
project: '',
|
||||||
|
change_id: '1',
|
||||||
|
};
|
||||||
const fileList = element.$.fileList;
|
const fileList = element.$.fileList;
|
||||||
const Actions = GrEditConstants.Actions;
|
const Actions = GrEditConstants.Actions;
|
||||||
element.$.fileListHeader.editMode = true;
|
element.$.fileListHeader.editMode = true;
|
||||||
@@ -2371,6 +2392,11 @@ suite('gr-change-view tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('_handleStopEditTap', done => {
|
test('_handleStopEditTap', done => {
|
||||||
|
element._change = {
|
||||||
|
_number: '1',
|
||||||
|
project: '',
|
||||||
|
change_id: '1',
|
||||||
|
};
|
||||||
sinon.stub(element.$.metadata, '_computeLabelNames');
|
sinon.stub(element.$.metadata, '_computeLabelNames');
|
||||||
navigateToChangeStub.restore();
|
navigateToChangeStub.restore();
|
||||||
sinon.stub(GerritNav, 'navigateToChange').callsFake((...args) => {
|
sinon.stub(GerritNav, 'navigateToChange').callsFake((...args) => {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export class GrIncludedInDialog extends GestureEventListeners(
|
|||||||
|
|
||||||
loadData() {
|
loadData() {
|
||||||
if (!this.changeNum) {
|
if (!this.changeNum) {
|
||||||
return;
|
return Promise.reject(new Error('missing required property changeNum'));
|
||||||
}
|
}
|
||||||
this._filterText = '';
|
this._filterText = '';
|
||||||
return this.$.restAPI.getChangeIncludedIn(this.changeNum).then(configs => {
|
return this.$.restAPI.getChangeIncludedIn(this.changeNum).then(configs => {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ import {isUnresolved} from '../../../utils/comment-util';
|
|||||||
|
|
||||||
const STORAGE_DEBOUNCE_INTERVAL_MS = 400;
|
const STORAGE_DEBOUNCE_INTERVAL_MS = 400;
|
||||||
|
|
||||||
enum FocusTarget {
|
export enum FocusTarget {
|
||||||
ANY = 'any',
|
ANY = 'any',
|
||||||
BODY = 'body',
|
BODY = 'body',
|
||||||
CCS = 'cc',
|
CCS = 'cc',
|
||||||
|
|||||||
@@ -105,6 +105,15 @@ export interface AppElementDiffViewParam {
|
|||||||
leftSide?: boolean;
|
leftSide?: boolean;
|
||||||
commentLink?: boolean;
|
commentLink?: boolean;
|
||||||
}
|
}
|
||||||
|
export interface AppElementChangeViewParams {
|
||||||
|
view: GerritView.CHANGE;
|
||||||
|
changeNum: NumericChangeId;
|
||||||
|
project: RepoName;
|
||||||
|
edit?: boolean;
|
||||||
|
patchNum?: PatchSetNum;
|
||||||
|
basePatchNum?: PatchSetNum;
|
||||||
|
queryMap?: Map<string, string> | URLSearchParams;
|
||||||
|
}
|
||||||
|
|
||||||
export interface AppElementJustRegisteredParams {
|
export interface AppElementJustRegisteredParams {
|
||||||
// We use params.view === ... as a type guard.
|
// We use params.view === ... as a type guard.
|
||||||
@@ -120,6 +129,7 @@ export type AppElementParams =
|
|||||||
| AppElementDashboardParams
|
| AppElementDashboardParams
|
||||||
| AppElementGroupParams
|
| AppElementGroupParams
|
||||||
| AppElementAdminParams
|
| AppElementAdminParams
|
||||||
|
| AppElementChangeViewParams
|
||||||
| AppElementRepoParams
|
| AppElementRepoParams
|
||||||
| AppElementDocSearchParams
|
| AppElementDocSearchParams
|
||||||
| AppElementPluginScreenParams
|
| AppElementPluginScreenParams
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import {
|
|||||||
} from './gr-js-api-types';
|
} from './gr-js-api-types';
|
||||||
import {EventType, TargetElement} from '../../plugins/gr-plugin-types';
|
import {EventType, TargetElement} from '../../plugins/gr-plugin-types';
|
||||||
import {DiffLayer, HighlightJS} from '../../../types/types';
|
import {DiffLayer, HighlightJS} from '../../../types/types';
|
||||||
|
import {ParsedChangeInfo} from '../gr-rest-api-interface/gr-reviewer-updates-parser';
|
||||||
|
|
||||||
const elements: {[key: string]: HTMLElement} = {};
|
const elements: {[key: string]: HTMLElement} = {};
|
||||||
const eventCallbacks: {[key: string]: EventCallback[]} = {};
|
const eventCallbacks: {[key: string]: EventCallback[]} = {};
|
||||||
@@ -177,7 +178,7 @@ export class GrJsApiInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCommitMessage(change: ChangeInfo, msg: string) {
|
handleCommitMessage(change: ChangeInfo | ParsedChangeInfo, msg: string) {
|
||||||
for (const cb of this._getEventCallbacks(EventType.COMMIT_MSG_EDIT)) {
|
for (const cb of this._getEventCallbacks(EventType.COMMIT_MSG_EDIT)) {
|
||||||
try {
|
try {
|
||||||
cb(change, msg);
|
cb(change, msg);
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ import {
|
|||||||
GroupName,
|
GroupName,
|
||||||
Hashtag,
|
Hashtag,
|
||||||
TopMenuEntryInfo,
|
TopMenuEntryInfo,
|
||||||
|
MergeableInfo,
|
||||||
} from '../../../types/common';
|
} from '../../../types/common';
|
||||||
import {
|
import {
|
||||||
CancelConditionCallback,
|
CancelConditionCallback,
|
||||||
@@ -1551,7 +1552,7 @@ export class GrRestApiInterface
|
|||||||
endpoint: '/commit?links',
|
endpoint: '/commit?links',
|
||||||
patchNum,
|
patchNum,
|
||||||
reportEndpointAsIs: true,
|
reportEndpointAsIs: true,
|
||||||
});
|
}) as Promise<CommitInfo | undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
getChangeFiles(
|
getChangeFiles(
|
||||||
@@ -3582,7 +3583,7 @@ export class GrRestApiInterface
|
|||||||
changeNum,
|
changeNum,
|
||||||
endpoint: '/revisions/current/mergeable',
|
endpoint: '/revisions/current/mergeable',
|
||||||
reportEndpointAsIs: true,
|
reportEndpointAsIs: true,
|
||||||
});
|
}) as Promise<MergeableInfo | undefined>;
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteDraftComments(query: string): Promise<Response> {
|
deleteDraftComments(query: string): Promise<Response> {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
import {patchNumEquals} from '../../../utils/patch-set-util';
|
import {patchNumEquals} from '../../../utils/patch-set-util';
|
||||||
import {ChangeInfo, PatchSetNum} from '../../../types/common';
|
import {ChangeInfo, PatchSetNum} from '../../../types/common';
|
||||||
|
import {ParsedChangeInfo} from '../gr-rest-api-interface/gr-reviewer-updates-parser';
|
||||||
|
|
||||||
type RevNumberToParentCountMap = {[revNumber: number]: number};
|
type RevNumberToParentCountMap = {[revNumber: number]: number};
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ export class RevisionInfo {
|
|||||||
* @param change A change object resulting from a change detail
|
* @param change A change object resulting from a change detail
|
||||||
* call that includes revision information.
|
* call that includes revision information.
|
||||||
*/
|
*/
|
||||||
constructor(private change: ChangeInfo) {}
|
constructor(private change: ChangeInfo | ParsedChangeInfo) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the largest number of parents of the commit in any revision. For
|
* Get the largest number of parents of the commit in any revision. For
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ import {
|
|||||||
Hashtag,
|
Hashtag,
|
||||||
FileNameToFileInfoMap,
|
FileNameToFileInfoMap,
|
||||||
TopMenuEntryInfo,
|
TopMenuEntryInfo,
|
||||||
|
MergeableInfo,
|
||||||
|
CommitInfo,
|
||||||
} from '../../../types/common';
|
} from '../../../types/common';
|
||||||
import {ParsedChangeInfo} from '../../../elements/shared/gr-rest-api-interface/gr-reviewer-updates-parser';
|
import {ParsedChangeInfo} from '../../../elements/shared/gr-rest-api-interface/gr-reviewer-updates-parser';
|
||||||
import {HttpMethod, IgnoreWhitespaceType} from '../../../constants/constants';
|
import {HttpMethod, IgnoreWhitespaceType} from '../../../constants/constants';
|
||||||
@@ -216,7 +218,7 @@ export interface RestApiService {
|
|||||||
|
|
||||||
getChangeDetail(
|
getChangeDetail(
|
||||||
changeNum: number | string,
|
changeNum: number | string,
|
||||||
opt_errFn?: Function,
|
opt_errFn?: ErrorCallback,
|
||||||
opt_cancelCondition?: Function
|
opt_cancelCondition?: Function
|
||||||
): Promise<ParsedChangeInfo | null | undefined>;
|
): Promise<ParsedChangeInfo | null | undefined>;
|
||||||
|
|
||||||
@@ -851,4 +853,15 @@ export interface RestApiService {
|
|||||||
getTopMenus(errFn?: ErrorCallback): Promise<TopMenuEntryInfo[] | undefined>;
|
getTopMenus(errFn?: ErrorCallback): Promise<TopMenuEntryInfo[] | undefined>;
|
||||||
|
|
||||||
setInProjectLookup(changeNum: NumericChangeId, project: RepoName): void;
|
setInProjectLookup(changeNum: NumericChangeId, project: RepoName): void;
|
||||||
|
getMergeable(changeNum: NumericChangeId): Promise<MergeableInfo | undefined>;
|
||||||
|
|
||||||
|
putChangeCommitMessage(
|
||||||
|
changeNum: NumericChangeId,
|
||||||
|
message: string
|
||||||
|
): Promise<Response>;
|
||||||
|
|
||||||
|
getChangeCommitInfo(
|
||||||
|
changeNum: NumericChangeId,
|
||||||
|
patchNum: PatchSetNum
|
||||||
|
): Promise<CommitInfo | undefined>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import {
|
|||||||
NotifyType,
|
NotifyType,
|
||||||
EmailFormat,
|
EmailFormat,
|
||||||
AuthType,
|
AuthType,
|
||||||
|
MergeStrategy,
|
||||||
} from '../constants/constants';
|
} from '../constants/constants';
|
||||||
import {PolymerDeepPropertyChange} from '@polymer/polymer/interfaces';
|
import {PolymerDeepPropertyChange} from '@polymer/polymer/interfaces';
|
||||||
|
|
||||||
@@ -804,7 +805,7 @@ export interface ChangeConfigInfo {
|
|||||||
large_change: string;
|
large_change: string;
|
||||||
reply_label: string;
|
reply_label: string;
|
||||||
reply_tooltip: string;
|
reply_tooltip: string;
|
||||||
update_delay: string;
|
update_delay: number;
|
||||||
submit_whole_topic: boolean;
|
submit_whole_topic: boolean;
|
||||||
disable_private_changes: boolean;
|
disable_private_changes: boolean;
|
||||||
mergeability_computation_behavior: string;
|
mergeability_computation_behavior: string;
|
||||||
@@ -2235,3 +2236,16 @@ export interface CherryPickInput {
|
|||||||
topic?: TopicName;
|
topic?: TopicName;
|
||||||
allow_empty?: boolean;
|
allow_empty?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#mergeable-info
|
||||||
|
*/
|
||||||
|
export interface MergeableInfo {
|
||||||
|
submit_type: SubmitType;
|
||||||
|
strategy?: MergeStrategy;
|
||||||
|
mergeable: boolean;
|
||||||
|
commit_merged?: boolean;
|
||||||
|
content_merged?: boolean;
|
||||||
|
conflicts?: string[];
|
||||||
|
mergeable_into?: string[];
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {GrDiffLine} from '../elements/diff/gr-diff/gr-diff-line';
|
|||||||
import {FlattenedNodesObserver} from '@polymer/polymer/lib/utils/flattened-nodes-observer';
|
import {FlattenedNodesObserver} from '@polymer/polymer/lib/utils/flattened-nodes-observer';
|
||||||
import {PaperInputElement} from '@polymer/paper-input/paper-input';
|
import {PaperInputElement} from '@polymer/paper-input/paper-input';
|
||||||
import {CommitId, NumericChangeId, PatchRange, PatchSetNum} from './common';
|
import {CommitId, NumericChangeId, PatchRange, PatchSetNum} from './common';
|
||||||
|
import {PolymerSpliceChange} from '@polymer/polymer/interfaces';
|
||||||
|
|
||||||
export function notUndefined<T>(x: T | undefined): x is T {
|
export function notUndefined<T>(x: T | undefined): x is T {
|
||||||
return x !== undefined;
|
return x !== undefined;
|
||||||
@@ -213,3 +214,10 @@ export interface FileRange {
|
|||||||
basePath?: string;
|
basePath?: string;
|
||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isPolymerSpliceChange<
|
||||||
|
T,
|
||||||
|
U extends Array<{} | null | undefined>
|
||||||
|
>(x: T | PolymerSpliceChange<U>): x is PolymerSpliceChange<U> {
|
||||||
|
return (x as PolymerSpliceChange<U>).indexSplices !== undefined;
|
||||||
|
}
|
||||||
|
|||||||
@@ -57,10 +57,6 @@ interface PatchRange {
|
|||||||
basePatchNum?: PatchSetNum;
|
basePatchNum?: PatchSetNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PatchRangeRecord {
|
|
||||||
base: PatchRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* As patchNum can be either a string (e.g. 'edit', 'PARENT') OR a number,
|
* As patchNum can be either a string (e.g. 'edit', 'PARENT') OR a number,
|
||||||
* this function checks for patchNum equality.
|
* this function checks for patchNum equality.
|
||||||
@@ -246,7 +242,9 @@ function _computeWipForPatchSets(
|
|||||||
|
|
||||||
export const _testOnly_computeWipForPatchSets = _computeWipForPatchSets;
|
export const _testOnly_computeWipForPatchSets = _computeWipForPatchSets;
|
||||||
|
|
||||||
export function computeLatestPatchNum(allPatchSets?: PatchSet[]) {
|
export function computeLatestPatchNum(
|
||||||
|
allPatchSets?: PatchSet[]
|
||||||
|
): PatchSetNum | undefined {
|
||||||
if (!allPatchSets || !allPatchSets.length) {
|
if (!allPatchSets || !allPatchSets.length) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -263,11 +261,7 @@ export function hasEditBasedOnCurrentPatchSet(allPatchSets: PatchSet[]) {
|
|||||||
return allPatchSets[0].num === EditPatchSetNum;
|
return allPatchSets[0].num === EditPatchSetNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hasEditPatchsetLoaded(patchRangeRecord: PatchRangeRecord) {
|
export function hasEditPatchsetLoaded(patchRange: PatchRange) {
|
||||||
const patchRange = patchRangeRecord.base;
|
|
||||||
if (!patchRange) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
patchRange.patchNum === EditPatchSetNum ||
|
patchRange.patchNum === EditPatchSetNum ||
|
||||||
patchRange.basePatchNum === EditPatchSetNum
|
patchRange.basePatchNum === EditPatchSetNum
|
||||||
@@ -283,7 +277,7 @@ export function hasEditPatchsetLoaded(patchRangeRecord: PatchRangeRecord) {
|
|||||||
* meantime. The promise is rejected on network error.
|
* meantime. The promise is rejected on network error.
|
||||||
*/
|
*/
|
||||||
export function fetchChangeUpdates(
|
export function fetchChangeUpdates(
|
||||||
change: ChangeInfo,
|
change: ChangeInfo | ParsedChangeInfo,
|
||||||
restAPI: RestApiService
|
restAPI: RestApiService
|
||||||
) {
|
) {
|
||||||
const knownLatest = computeLatestPatchNum(computeAllPatchSets(change));
|
const knownLatest = computeLatestPatchNum(computeAllPatchSets(change));
|
||||||
|
|||||||
Reference in New Issue
Block a user