mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
fix: following fflorent review
This commit is contained in:
parent
06e308e8ed
commit
aa9e42bd47
@ -149,7 +149,7 @@ export class DocPageModelImpl extends Disposable implements DocPageModel {
|
|||||||
public readonly isTemplate = Computed.create(this, this.currentDoc,
|
public readonly isTemplate = Computed.create(this, this.currentDoc,
|
||||||
(use, doc) => doc ? doc.isTemplate : false);
|
(use, doc) => doc ? doc.isTemplate : false);
|
||||||
public readonly type = Computed.create(this, this.currentDoc,
|
public readonly type = Computed.create(this, this.currentDoc,
|
||||||
(use, doc) => doc?.type?? null);
|
(use, doc) => doc?.type ?? null);
|
||||||
|
|
||||||
public readonly importSources: ImportSource[] = [];
|
public readonly importSources: ImportSource[] = [];
|
||||||
|
|
||||||
|
@ -310,9 +310,6 @@ export class DocSettingsPage extends Disposable {
|
|||||||
const currentDocType = docPageModel.type.get() as string;
|
const currentDocType = docPageModel.type.get() as string;
|
||||||
let currentDocTypeOption;
|
let currentDocTypeOption;
|
||||||
switch (currentDocType) {
|
switch (currentDocType) {
|
||||||
case "":
|
|
||||||
currentDocTypeOption = DocTypeOption.Regular;
|
|
||||||
break;
|
|
||||||
case "Template":
|
case "Template":
|
||||||
currentDocTypeOption = DocTypeOption.Template;
|
currentDocTypeOption = DocTypeOption.Template;
|
||||||
break;
|
break;
|
||||||
@ -335,11 +332,8 @@ export class DocSettingsPage extends Disposable {
|
|||||||
} else {
|
} else {
|
||||||
docType = "Tutorial";
|
docType = "Tutorial";
|
||||||
}
|
}
|
||||||
persistType(docType, docId)
|
await persistType(docType, docId);
|
||||||
.then(()=>window.location.reload())
|
window.location.reload();
|
||||||
.catch(err=>console.log(err));
|
|
||||||
|
|
||||||
ctl.close();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const documentTypeOptions = () => [
|
const documentTypeOptions = () => [
|
||||||
@ -415,7 +409,7 @@ function persistType(type: string|null, docId: string|undefined){
|
|||||||
headers: {"Content-Type": "application/json"},
|
headers: {"Content-Type": "application/json"},
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
body:JSON.stringify({type})
|
body:JSON.stringify({type})
|
||||||
}).catch((err)=>{ console.log(err); });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getApiConsoleLink(docPageModel: DocPageModel) {
|
function getApiConsoleLink(docPageModel: DocPageModel) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { UserAPI } from "app/common/UserAPI";
|
import { UserAPI } from "app/common/UserAPI";
|
||||||
|
//import { assert, By, driver, until } from "mocha-webdriver";
|
||||||
import { assert, driver } from "mocha-webdriver";
|
import { assert, driver } from "mocha-webdriver";
|
||||||
import * as gu from "test/nbrowser/gristUtils";
|
import * as gu from "test/nbrowser/gristUtils";
|
||||||
import { setupTestSuite } from "test/nbrowser/testUtils";
|
import { setupTestSuite } from "test/nbrowser/testUtils";
|
||||||
@ -57,8 +58,7 @@ describe("Document Type Conversion", function () {
|
|||||||
// Confirm the choice
|
// Confirm the choice
|
||||||
await modalConfirm.click();
|
await modalConfirm.click();
|
||||||
|
|
||||||
// await for the page reload
|
await driver.sleep(3000);
|
||||||
await driver.sleep(1000);
|
|
||||||
|
|
||||||
// check that the displayedLabel is now equal to convert destination
|
// check that the displayedLabel is now equal to convert destination
|
||||||
assert.equal(await displayedLabel.element().getText(), to);
|
assert.equal(await displayedLabel.element().getText(), to);
|
||||||
|
Loading…
Reference in New Issue
Block a user