summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaladox none <thomasmulhall410@yahoo.com>2021-07-07 02:34:53 +0000
committerPaladox none <thomasmulhall410@yahoo.com>2021-07-07 19:11:36 +0000
commite2a2f471633d56cd36560fdf12e37677df878dec (patch)
tree2c87ca4f6e8023498cb7bda0e21bc97644f0f0cd
parentec82525fc508f62d23fdf957bea7f404d1de57f6 (diff)
Fix edit url when saving
It set /edit rather than ,edit. Change-Id: I4e8112e91b565875359f53bf9c8eb06b2670d14d (cherry picked from commit 622903a3f4955229cc27993b6d0353c40c8fe3a7)
-rw-r--r--polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.ts12
-rw-r--r--polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view_test.js11
2 files changed, 5 insertions, 18 deletions
diff --git a/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.ts b/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.ts
index a36e63d309..047a8180cd 100644
--- a/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.ts
+++ b/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.ts
@@ -238,16 +238,8 @@ export class GrEditorView extends KeyboardShortcutMixin(
}
_viewEditInChangeView() {
- const patch = this._successfulSave
- ? (SPECIAL_PATCH_SET_NUM.EDIT as PatchSetNum)
- : this._patchNum;
- if (this._change && patch)
- GerritNav.navigateToChange(
- this._change,
- patch,
- undefined,
- patch !== SPECIAL_PATCH_SET_NUM.EDIT
- );
+ if (this._change)
+ GerritNav.navigateToChange(this._change, undefined, undefined, true);
}
_getFileData(
diff --git a/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view_test.js b/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view_test.js
index b04277e2c4..c0f615d77d 100644
--- a/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view_test.js
+++ b/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view_test.js
@@ -320,19 +320,14 @@ suite('gr-editor-view tests', () => {
element._showAlert('test message');
});
- test('_viewEditInChangeView respects _patchNum', () => {
+ test('_viewEditInChangeView', () => {
element._change = {};
navigateStub.restore();
const navStub = sinon.stub(GerritNav, 'navigateToChange');
element._patchNum = SPECIAL_PATCH_SET_NUM.EDIT;
element._viewEditInChangeView();
- assert.equal(navStub.lastCall.args[1], SPECIAL_PATCH_SET_NUM.EDIT);
- element._patchNum = '1';
- element._viewEditInChangeView();
- assert.equal(navStub.lastCall.args[1], '1');
- element._successfulSave = true;
- element._viewEditInChangeView();
- assert.equal(navStub.lastCall.args[1], SPECIAL_PATCH_SET_NUM.EDIT);
+ assert.equal(navStub.lastCall.args[1], undefined);
+ assert.equal(navStub.lastCall.args[3], true);
});
suite('keyboard shortcuts', () => {