mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-12 04:29:51 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee61b94782 | ||
|
|
213b672e92 |
@@ -0,0 +1,55 @@
|
|||||||
|
# Issues labelled "wait for confrim" are waiting for the reporter. After 15
|
||||||
|
# days without activity the issue gets a reminder and the "no response"
|
||||||
|
# label; after 15 more days it is closed. A reply from the reporter removes
|
||||||
|
# both labels, so the issue shows up as needing the maintainer again.
|
||||||
|
name: Wait for confirmation
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "17 3 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
remind-and-close:
|
||||||
|
if: github.event_name != 'issue_comment'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v9
|
||||||
|
with:
|
||||||
|
only-issue-labels: "wait for confrim"
|
||||||
|
days-before-issue-stale: 15
|
||||||
|
days-before-issue-close: 15
|
||||||
|
days-before-pr-stale: -1
|
||||||
|
days-before-pr-close: -1
|
||||||
|
stale-issue-label: "no response"
|
||||||
|
stale-issue-message: >-
|
||||||
|
Still there? We asked for more information 15 days ago. A reply
|
||||||
|
would help; if we hear nothing in another 15 days this issue will
|
||||||
|
be closed. It can be reopened any time.
|
||||||
|
close-issue-message: >-
|
||||||
|
No reply in 30 days, so this issue is closed for now. If the
|
||||||
|
problem is still there, reply or reopen it.
|
||||||
|
close-issue-reason: not_planned
|
||||||
|
remove-stale-when-updated: true
|
||||||
|
|
||||||
|
reporter-replied:
|
||||||
|
if: >-
|
||||||
|
github.event_name == 'issue_comment' &&
|
||||||
|
contains(github.event.issue.labels.*.name, 'wait for confrim') &&
|
||||||
|
github.event.comment.user.type != 'Bot' &&
|
||||||
|
!contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: The reporter answered, so the issue is the maintainer's again
|
||||||
|
run: >-
|
||||||
|
gh issue edit "$NUMBER" --repo "$REPO"
|
||||||
|
--remove-label "wait for confrim" --remove-label "no response"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
NUMBER: ${{ github.event.issue.number }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
@@ -108,6 +108,25 @@ async function boxOf(locator: Locator) {
|
|||||||
return box
|
return box
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Click the canvas where no shape is, to deselect: the corner of the
|
||||||
|
* container farthest from the shape. A fixed spot near the top-left corner
|
||||||
|
* is not safe, as a click on a shape may scroll it into that corner.
|
||||||
|
*/
|
||||||
|
async function clickEmptyCanvas(page: Page, shape: Locator) {
|
||||||
|
const container = getIframeContent(page).locator(".geDiagramContainer")
|
||||||
|
const box = await boxOf(container)
|
||||||
|
const shapeBox = await boxOf(shape)
|
||||||
|
const shapeX = shapeBox.x + shapeBox.width / 2
|
||||||
|
const shapeY = shapeBox.y + shapeBox.height / 2
|
||||||
|
await container.click({
|
||||||
|
position: {
|
||||||
|
x: shapeX < box.x + box.width / 2 ? box.width - 20 : 20,
|
||||||
|
y: shapeY < box.y + box.height / 2 ? box.height - 20 : 20,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/** draw.io's own Undo button: draw.io sets "disabled" with nothing to undo */
|
/** draw.io's own Undo button: draw.io sets "disabled" with nothing to undo */
|
||||||
function drawioUndo(page: Page) {
|
function drawioUndo(page: Page) {
|
||||||
return getIframeContent(page).locator('.geSimpleMainMenu a[title="Undo"]')
|
return getIframeContent(page).locator('.geSimpleMainMenu a[title="Undo"]')
|
||||||
@@ -4512,9 +4531,7 @@ test.describe("Edge cases", () => {
|
|||||||
})
|
})
|
||||||
await sendMessage(page, "Make this red")
|
await sendMessage(page, "Make this red")
|
||||||
// Deselected while the diagram exports
|
// Deselected while the diagram exports
|
||||||
await canvas
|
await clickEmptyCanvas(page, shape)
|
||||||
.locator(".geDiagramContainer")
|
|
||||||
.click({ position: { x: 10, y: 10 } })
|
|
||||||
await expect(chip).toHaveCount(0)
|
await expect(chip).toHaveCount(0)
|
||||||
await page.evaluate(() => (window as any).__releaseExports())
|
await page.evaluate(() => (window as any).__releaseExports())
|
||||||
await waitForCompleteCount(page, 2)
|
await waitForCompleteCount(page, 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user