mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Polish Record Cards
Summary: Improvements - Widget and column descriptions are now copied when duplicating a table. - A Grist Plugin API command to open a Record Card is now available. - New Card widgets set initial settings based on those used by their table's Record Card. Fixes - Opening a reference in a Record Card from a Raw Data popup now opens the correct reference. Test Plan: Browser and python tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4164
This commit is contained in:
@@ -515,8 +515,8 @@ describe('RawData', function () {
|
||||
await gu.checkTextEditor("abc");
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
// Click on another cell, check page hasn't changed (there was a bug about that)
|
||||
await gu.getCell({rowNum: 10, col: 1}).click();
|
||||
assert.deepEqual(await gu.getCursorPosition(), {rowNum: 10, col: 1});
|
||||
await gu.getCell({rowNum: 21, col: 1}).click();
|
||||
assert.deepEqual(await gu.getCursorPosition(), {rowNum: 21, col: 1});
|
||||
assert.equal(await gu.getCurrentPageName(), 'City');
|
||||
|
||||
// Close by hitting escape.
|
||||
|
||||
@@ -23,7 +23,10 @@ describe('RecordCards', function() {
|
||||
it('opens popup when keyboard shortcut is pressed', async function() {
|
||||
await gu.sendKeys(Key.SPACE);
|
||||
assert.isTrue(await driver.findWait('.test-record-card-popup-overlay', 100).isDisplayed());
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRY Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRY Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Code').getText(), 'ALB');
|
||||
assert.isFalse(await driver.find('.grist-single-record__menu').isPresent());
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
@@ -32,7 +35,10 @@ describe('RecordCards', function() {
|
||||
it('opens popup when menu item is clicked', async function() {
|
||||
await (await gu.openRowMenu(2)).findContent('li', /View as card/).click();
|
||||
assert.isTrue(await driver.findWait('.test-record-card-popup-overlay', 100).isDisplayed());
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRY Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRY Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Code').getText(), 'AND');
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
});
|
||||
@@ -76,7 +82,10 @@ describe('RecordCards', function() {
|
||||
it('opens popup when reference icon is clicked', async function() {
|
||||
await gu.getCell(0, 4).find('.test-ref-link-icon').click();
|
||||
assert.isTrue(await driver.findWait('.test-record-card-popup-overlay', 100).isDisplayed());
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRY Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRY Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Code').getText(), 'AFG');
|
||||
assert.isFalse(await driver.find('.grist-single-record__menu').isPresent());
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
@@ -86,10 +95,16 @@ describe('RecordCards', function() {
|
||||
await gu.getCell(0, 4).find('.test-ref-text').click();
|
||||
await gu.sendKeys(Key.SPACE);
|
||||
assert.isTrue(await driver.findWait('.test-record-card-popup-overlay', 100).isDisplayed());
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRYLANGUAGE Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRYLANGUAGE Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Country').getText(), 'AFG');
|
||||
await gu.getCardCell('Country').find('.test-ref-link-icon').click();
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRY Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRY Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Code').getText(), 'AFG');
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
});
|
||||
@@ -119,7 +134,10 @@ describe('RecordCards', function() {
|
||||
it('opens popup when reference icon is clicked', async function() {
|
||||
await gu.getCell(0, 4).find('.test-ref-list-link-icon').click();
|
||||
assert.isTrue(await driver.findWait('.test-record-card-popup-overlay', 100).isDisplayed());
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRY Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRY Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Code').getText(), 'AFG');
|
||||
assert.isFalse(await driver.find('.grist-single-record__menu').isPresent());
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
@@ -129,12 +147,37 @@ describe('RecordCards', function() {
|
||||
await gu.getCell(0, 4).click();
|
||||
await gu.sendKeys(Key.SPACE);
|
||||
assert.isTrue(await driver.findWait('.test-record-card-popup-overlay', 100).isDisplayed());
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRYLANGUAGE Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRYLANGUAGE Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Country').getText(), 'AFG');
|
||||
await gu.getCardCell('Country').find('.test-ref-list-link-icon').click();
|
||||
assert.equal(await driver.find('.test-widget-title-text').getText(), 'COUNTRY Card');
|
||||
assert.equal(
|
||||
await driver.find('.test-record-card-popup-wrapper .test-widget-title-text').getText(),
|
||||
'COUNTRY Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Code').getText(), 'AFG');
|
||||
await gu.sendKeys(Key.ESCAPE);
|
||||
});
|
||||
});
|
||||
|
||||
describe('RawData', function() {
|
||||
before(async function() {
|
||||
await driver.find('.test-tools-raw').click();
|
||||
await driver.findWait('.test-raw-data-list', 2000);
|
||||
await gu.waitForServer();
|
||||
});
|
||||
|
||||
it('opens popup when reference icon is clicked', async function() {
|
||||
await driver.findContent('.test-raw-data-table-title', 'City').click();
|
||||
await gu.waitForServer();
|
||||
await gu.getCell(1, 5).find('.test-ref-link-icon').click();
|
||||
assert.equal(
|
||||
await driver.find('.test-raw-data-overlay .test-widget-title-text').getText(),
|
||||
'COUNTRY Card'
|
||||
);
|
||||
assert.equal(await gu.getCardCell('Code').getText(), 'NLD');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user