forked from abner/for-legacy-web
Compare commits
No commits in common. "handmade" and "master" have entirely different histories.
|
|
@ -3,38 +3,36 @@ name: Docker
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- "handmade"
|
||||
- "master"
|
||||
tags:
|
||||
- "*"
|
||||
# TODO: Bring back once gitea is updated past 1.21
|
||||
# paths-ignore:
|
||||
# - ".github/**"
|
||||
# - "!.github/workflows/docker.yml"
|
||||
# - ".vscode/**"
|
||||
# - ".gitignore"
|
||||
# - ".gitlab-ci.yml"
|
||||
# - "LICENSE"
|
||||
# - "README"
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "!.github/workflows/docker.yml"
|
||||
- "!.github/workflows/preview_*.yml"
|
||||
- ".vscode/**"
|
||||
- ".gitignore"
|
||||
- ".gitlab-ci.yml"
|
||||
- "LICENSE"
|
||||
- "README"
|
||||
pull_request:
|
||||
branches:
|
||||
- "handmade"
|
||||
# TODO: Bring back once gitea is updated past 1.21
|
||||
# paths-ignore:
|
||||
# - ".github/**"
|
||||
# - "!.github/workflows/docker.yml"
|
||||
# - "!.github/workflows/preview_*.yml"
|
||||
# - ".vscode/**"
|
||||
# - ".gitignore"
|
||||
# - ".gitlab-ci.yml"
|
||||
# - "LICENSE"
|
||||
# - "README"
|
||||
- "master"
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "!.github/workflows/docker.yml"
|
||||
- "!.github/workflows/preview_*.yml"
|
||||
- ".vscode/**"
|
||||
- ".gitignore"
|
||||
- ".gitlab-ci.yml"
|
||||
- "LICENSE"
|
||||
- "README"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
# NOTE: Running on pull requests for now, but without pushing.
|
||||
# if: github.event_name != 'pull_request'
|
||||
if: github.event_name != 'pull_request'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -48,7 +46,7 @@ jobs:
|
|||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: handmadecities/handmade-revolt-web-client
|
||||
images: revoltchat/client, ghcr.io/revoltchat/client
|
||||
env:
|
||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||
- name: Login to DockerHub
|
||||
|
|
@ -57,6 +55,13 @@ jobs:
|
|||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Login to Github Container Registry
|
||||
uses: docker/login-action@v3
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and publish
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
name: Add Issue to Board
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
track_issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
query {
|
||||
organization(login: "revoltchat"){
|
||||
projectV2(number: 3) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
... on ProjectV2SingleSelectField {
|
||||
id
|
||||
name
|
||||
options {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add issue to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $issue:ID!) {
|
||||
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
name: Add PR to Board
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, ready_for_review, review_requested]
|
||||
|
||||
jobs:
|
||||
track_pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
query {
|
||||
organization(login: "revoltchat"){
|
||||
projectV2(number: 5) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
... on ProjectV2SingleSelectField {
|
||||
id
|
||||
name
|
||||
options {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'INCOMING_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add PR to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
PR_ID: ${{ github.event.pull_request.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $pr:ID!) {
|
||||
addProjectV2ItemById(input: {projectId: $project, contentId: $pr}) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.item.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
|
||||
- name: Set fields
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
mutation (
|
||||
$project: ID!
|
||||
$item: ID!
|
||||
$status_field: ID!
|
||||
$status_value: String!
|
||||
) {
|
||||
set_status: updateProjectV2ItemFieldValue(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $status_field
|
||||
value: {
|
||||
singleSelectOptionId: $status_value
|
||||
}
|
||||
}) {
|
||||
projectV2Item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.INCOMING_OPTION_ID }} --silent
|
||||
|
|
@ -15,5 +15,3 @@ public/assets_*
|
|||
!public/assets_default
|
||||
|
||||
.vscode/chrome_data
|
||||
|
||||
.direnv
|
||||
|
|
|
|||
64
flake.lock
64
flake.lock
|
|
@ -1,64 +0,0 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": [
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1770169770,
|
||||
"narHash": "sha256-awR8qIwJxJJiOmcEGgP2KUqYmHG4v/z8XpL9z8FnT1A=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "aa290c9891fa4ebe88f8889e59633d20cc06a5f2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
28
flake.nix
28
flake.nix
|
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
description = "Node+yarn dev shell flake";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
systems.url = "github:nix-systems/default";
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.systems.follows = "systems";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, flake-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
nodejs_24
|
||||
yarn
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -28,7 +28,6 @@ type Transition =
|
|||
| "SUCCESS"
|
||||
| "DISCONNECT"
|
||||
| "RETRY"
|
||||
| "RETRY_FAILED"
|
||||
| "LOGOUT"
|
||||
| "ONLINE"
|
||||
| "OFFLINE";
|
||||
|
|
@ -41,7 +40,6 @@ export default class Session {
|
|||
state: State = window.navigator.onLine ? "Ready" : "Offline";
|
||||
user_id: string | null = null;
|
||||
client: Client | null = null;
|
||||
retryAttempts: number = 0;
|
||||
|
||||
/**
|
||||
* Create a new Session
|
||||
|
|
@ -91,11 +89,9 @@ export default class Session {
|
|||
* Called when the client signals it has disconnected
|
||||
*/
|
||||
private onDropped() {
|
||||
if (this.state === "Connecting") {
|
||||
this.emit({ action: "RETRY_FAILED" });
|
||||
} else {
|
||||
this.emit({ action: "DISCONNECT" });
|
||||
}
|
||||
this.emit({
|
||||
action: "DISCONNECT",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -215,7 +211,6 @@ export default class Session {
|
|||
// Ready successfully received
|
||||
case "SUCCESS": {
|
||||
this.assert("Connecting");
|
||||
this.retryAttempts = 0;
|
||||
this.state = "Online";
|
||||
break;
|
||||
}
|
||||
|
|
@ -244,18 +239,6 @@ export default class Session {
|
|||
this.state = "Connecting";
|
||||
break;
|
||||
}
|
||||
// Reconnect attempt failed, schedule another with backoff
|
||||
case "RETRY_FAILED": {
|
||||
this.assert("Connecting");
|
||||
this.retryAttempts++;
|
||||
const delay = Math.min(500 * Math.pow(2, this.retryAttempts), 16000);
|
||||
setTimeout(() => {
|
||||
if (this.state === "Connecting") {
|
||||
this.client!.websocket.connect();
|
||||
}
|
||||
}, delay);
|
||||
break;
|
||||
}
|
||||
// User instructed logout
|
||||
case "LOGOUT": {
|
||||
this.assert("Connecting", "Online", "Disconnected");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import CreateRole from "./components/CreateRole";
|
|||
import CreateServer from "./components/CreateServer";
|
||||
import CustomStatus from "./components/CustomStatus";
|
||||
import DeleteMessage from "./components/DeleteMessage";
|
||||
import ReactMessage from "./components/ReactMessage";
|
||||
import Error from "./components/Error";
|
||||
import ImageViewer from "./components/ImageViewer";
|
||||
import KickMember from "./components/KickMember";
|
||||
|
|
@ -276,7 +275,6 @@ export const modalController = new ModalControllerExtended({
|
|||
create_bot: CreateBot,
|
||||
custom_status: CustomStatus,
|
||||
delete_message: DeleteMessage,
|
||||
react_message: ReactMessage,
|
||||
error: Error,
|
||||
image_viewer: ImageViewer,
|
||||
kick_member: KickMember,
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
import styled from "styled-components";
|
||||
|
||||
import { Modal } from "@revoltchat/ui";
|
||||
import { ModalProps } from "../types"
|
||||
|
||||
import { Message } from "revolt.js";
|
||||
import { emojiDictionary } from "../../../assets/emojis"
|
||||
import { HackAlertThisFileWillBeReplaced } from "../../../components/common/messaging/MessageBox"
|
||||
|
||||
const PickerContainer = styled.div`
|
||||
max-height: 420px;
|
||||
max-width: 370px;
|
||||
overflow: hidden;
|
||||
|
||||
> div {
|
||||
position: unset;
|
||||
}
|
||||
`
|
||||
|
||||
export default function ReactMessage({
|
||||
target: message,
|
||||
onClose,
|
||||
...props
|
||||
}: ModalProps<"react_message">) {
|
||||
return (
|
||||
<Modal
|
||||
{...props}
|
||||
padding={false}
|
||||
maxWidth="370px"
|
||||
>
|
||||
<PickerContainer>
|
||||
<HackAlertThisFileWillBeReplaced
|
||||
onSelect={(emoji) =>{
|
||||
message.react(
|
||||
emojiDictionary[
|
||||
emoji as keyof typeof emojiDictionary
|
||||
] ?? emoji,
|
||||
);
|
||||
onClose();
|
||||
}}
|
||||
onClose={onClose}
|
||||
/>
|
||||
</PickerContainer>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
|
@ -153,10 +153,6 @@ export type Modal = {
|
|||
type: "delete_message";
|
||||
target: Message;
|
||||
}
|
||||
| {
|
||||
type: "react_message",
|
||||
target: Message;
|
||||
}
|
||||
| {
|
||||
type: "kick_member";
|
||||
member: Member;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ type Action =
|
|||
| { action: "quote_message"; content: string }
|
||||
| { action: "edit_message"; id: string }
|
||||
| { action: "delete_message"; target: Message }
|
||||
| { action: "react_message"; target: Message }
|
||||
| { action: "open_file"; attachment: API.File }
|
||||
| { action: "save_file"; attachment: API.File }
|
||||
| { action: "copy_file_link"; attachment: API.File }
|
||||
|
|
@ -403,13 +402,6 @@ export default function ContextMenus() {
|
|||
});
|
||||
break;
|
||||
|
||||
case "react_message":
|
||||
modalController.push({
|
||||
type: "react_message",
|
||||
target: data.target,
|
||||
});
|
||||
break;
|
||||
|
||||
case "leave_group":
|
||||
case "close_dm":
|
||||
case "delete_channel":
|
||||
|
|
@ -516,8 +508,6 @@ export default function ContextMenus() {
|
|||
"Open in Admin Panel"
|
||||
) : locale === "admin_system" ? (
|
||||
"Open User in Admin Panel"
|
||||
) : locale === "react_message" ? (
|
||||
"React"
|
||||
) : (
|
||||
<Text
|
||||
id={`app.context_menu.${
|
||||
|
|
@ -843,16 +833,6 @@ export default function ContextMenus() {
|
|||
});
|
||||
}
|
||||
|
||||
if (message.channel?.havePermission("React")) {
|
||||
generateAction(
|
||||
{
|
||||
action: "react_message",
|
||||
target: message,
|
||||
},
|
||||
"react_message",
|
||||
);
|
||||
}
|
||||
|
||||
if (message.author_id !== userId) {
|
||||
generateAction(
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue