Compare commits

..
Author SHA1 Message Date
Ajay Bura 8a38ec8fc3 Add reusable dialog
Signed-off-by: Ajay Bura <ajbura@gmail.com>
2022-03-31 19:32:05 +05:30
23 changed files with 966 additions and 691 deletions

No files matched your search

+2 -1
View File
@@ -1,5 +1,6 @@
name: 🐞 Bug Report
description: Report a bug
labels: 'type: bug'
body:
- type: markdown
@@ -49,7 +50,7 @@ body:
render: shell
validations:
required: true
- type: textarea
id: context
attributes:
+2 -1
View File
@@ -1,5 +1,6 @@
name: 💡 Feature Request
description: Suggest an idea
labels: 'type: feature'
body:
- type: textarea
@@ -25,7 +26,7 @@ body:
attributes:
label: Alternatives considered
description: "Any alternative solutions you've considered"
- type: textarea
id: context
attributes:
+11 -13
View File
@@ -1,30 +1,28 @@
# Docs: <https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/customizing-dependency-updates>
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: "tuesday"
time: "01:00"
timezone: "Asia/Kolkata"
open-pull-requests-limit: 15
updates:
- package-ecosystem: github-actions
directory: /
schedule:
schedule:
interval: weekly
day: "tuesday"
time: "01:00"
timezone: "Asia/Kolkata"
open-pull-requests-limit: 5
- package-ecosystem: docker
directory: /
schedule:
schedule:
interval: weekly
day: "tuesday"
time: "01:00"
timezone: "Asia/Kolkata"
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: "tuesday"
time: "01:00"
timezone: "Asia/Kolkata"
open-pull-requests-limit: 5
+5
View File
@@ -32,3 +32,8 @@ jobs:
name: pr.json
path: pr.json
retention-days: 1
- name: Build Docker image
uses: docker/build-push-action@v2.10.0
with:
context: .
push: false
-20
View File
@@ -1,20 +0,0 @@
name: 'Docker check'
on:
pull_request:
paths:
- 'Dockerfile'
jobs:
docker-build:
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{github.event.number}}
steps:
- name: Checkout repository
uses: actions/checkout@v3.0.0
- name: Build Docker image
uses: docker/build-push-action@v2.10.0
with:
context: .
push: false
@@ -10,7 +10,7 @@ jobs:
name: 'Deploy'
runs-on: ubuntu-latest
steps:
steps:
- name: Checkout repository
uses: actions/checkout@v3.0.0
- name: Build and deploy to Netlify
@@ -44,7 +44,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3.7.0
uses: docker/metadata-action@v3.6.2
with:
images: ajbura/cinny
- name: Build and push Docker image
+1 -1
View File
@@ -1,5 +1,5 @@
## Builder
FROM node:17.8.0-alpine3.15 as builder
FROM node:17.7.2-alpine3.15 as builder
WORKDIR /src
+912 -621
View File
File diff suppressed because it is too large. Load diff
+13 -13
View File
@@ -15,8 +15,8 @@
"author": "Ajay Bura",
"license": "MIT",
"dependencies": {
"@fontsource/inter": "^4.5.7",
"@fontsource/roboto": "^4.5.5",
"@fontsource/inter": "^4.5.5",
"@fontsource/roboto": "^4.5.3",
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.8.tgz",
"@tippyjs/react": "^4.2.6",
"babel-polyfill": "^6.26.0",
@@ -28,7 +28,7 @@
"formik": "^2.2.9",
"html-react-parser": "^1.4.9",
"linkifyjs": "^2.1.9",
"matrix-js-sdk": "^17.0.0",
"matrix-js-sdk": "^15.6.0",
"micromark": "^3.0.10",
"micromark-extension-gfm": "^2.0.1",
"micromark-util-chunked": "^1.0.0",
@@ -37,21 +37,21 @@
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-autosize-textarea": "^7.1.0",
"react-dnd": "^15.1.2",
"react-dnd-html5-backend": "^15.1.3",
"react-dnd": "^15.1.1",
"react-dnd-html5-backend": "^15.1.2",
"react-dom": "^17.0.2",
"react-google-recaptcha": "^2.1.0",
"react-modal": "^3.14.4",
"sanitize-html": "^2.7.0",
"tippy.js": "^6.3.7",
"twemoji": "^14.0.2"
"twemoji": "^14.0.1"
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"assert": "^2.0.0",
"babel-loader": "^8.2.4",
"babel-loader": "^8.2.2",
"browserify-fs": "^1.0.0",
"buffer": "^6.0.3",
"clean-webpack-plugin": "^4.0.0",
@@ -59,9 +59,9 @@
"crypto-browserify": "^3.12.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^3.4.1",
"eslint": "^8.13.0",
"eslint": "^8.11.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.2.0",
@@ -71,15 +71,15 @@
"html-webpack-plugin": "^5.3.1",
"mini-css-extract-plugin": "^2.6.0",
"path-browserify": "^1.0.1",
"sass": "^1.50.0",
"sass": "^1.49.9",
"sass-loader": "^12.6.0",
"stream-browserify": "^3.0.0",
"style-loader": "^3.3.1",
"url": "^0.11.0",
"util": "^0.12.4",
"webpack": "^5.72.0",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack-dev-server": "^4.7.4",
"webpack-merge": "^5.7.3"
}
}
+1 -1
View File
@@ -547,7 +547,7 @@ const MessageOptions = React.memo(({
variant="danger"
iconSrc={BinIC}
onClick={() => {
if (window.confirm('Are you sure that you want to delete this event?')) {
if (window.confirm('Are you sure you want to delete this event')) {
redactEvent(roomId, mEvent.getId());
}
}}
@@ -17,19 +17,19 @@ const visibility = {
const items = [{
iconSrc: null,
text: 'Anyone (including guests)',
text: 'World readable (anyone can read)',
type: visibility.WORLD_READABLE,
}, {
iconSrc: null,
text: 'Members (all messages)',
text: 'Member shared (since the point in time of selecting this option)',
type: visibility.SHARED,
}, {
iconSrc: null,
text: 'Members (messages after invite)',
text: 'Member invited (since they were invited)',
type: visibility.INVITED,
}, {
iconSrc: null,
text: 'Members (messages after join)',
text: 'Member joined (since they joined)',
type: visibility.JOINED,
}];
@@ -87,7 +87,7 @@ function RoomHistoryVisibility({ roomId }) {
</MenuItem>
))
}
<Text variant="b3">Changes to history visibility will only apply to future messages. The visibility of existing history will have no effect.</Text>
<Text variant="b3">Changes to who can read history will only apply to future messages in this room. The visibility of existing history will be unchanged.</Text>
</div>
);
}
@@ -30,7 +30,7 @@ function RoomOptions({ roomId, afterOptionSelect }) {
afterOptionSelect();
};
const handleLeaveClick = () => {
if (confirm('Are you sure that you want to leave this room?')) {
if (confirm('Are you really want to leave this room?')) {
roomActions.leave(roomId);
afterOptionSelect();
}
@@ -179,7 +179,6 @@ function RoomPermissions({ roomId }) {
const pLEvent = room.currentState.getStateEvents('m.room.power_levels')[0];
const permissions = pLEvent.getContent();
const canChangePermission = room.currentState.maySendStateEvent('m.room.power_levels', mx.getUserId());
const myPowerLevel = room.getMember(mx.getUserId())?.powerLevel ?? 100;
const handlePowerSelector = (e, permKey, parentKey, powerLevel) => {
const handlePowerLevelChange = (newPowerLevel) => {
@@ -209,7 +208,7 @@ function RoomPermissions({ roomId }) {
(closeMenu) => (
<PowerLevelSelector
value={powerLevel}
max={myPowerLevel}
max={100}
onSelect={(pl) => {
closeMenu();
handlePowerLevelChange(pl);
@@ -117,7 +117,7 @@ function RoomProfile({ roomId }) {
const handleAvatarUpload = async (url) => {
if (url === null) {
if (confirm('Are you sure that you want to remove room avatar?')) {
if (confirm('Are you sure you want to remove avatar?')) {
await mx.sendStateEvent(roomId, 'm.room.avatar', { url }, '');
}
} else await mx.sendStateEvent(roomId, 'm.room.avatar', { url }, '');
@@ -55,7 +55,7 @@ function SpaceOptions({ roomId, afterOptionSelect }) {
};
const handleLeaveClick = () => {
if (confirm('Are you sure that you want to leave this space?')) {
if (confirm('Are you really want to leave this space?')) {
leave(roomId);
afterOptionSelect();
}
+1 -1
View File
@@ -210,7 +210,7 @@ function CreateRoomContent({ isSpace, parentId, onRequestClose }) {
/>
)}
content={(
<Text variant="b3">Selecting Admin sets 100 power level whereas Founder sets 101.</Text>
<Text variant="b3">Founder (101) override the default Admin (100) power level.</Text>
)}
/>
<Input name="topic" minHeight={174} resizable label="Topic (optional)" />
@@ -40,7 +40,7 @@ function ProfileEditor({ userId }) {
const handleAvatarUpload = (url) => {
if (url === null) {
if (confirm('Are you sure that you want to remove avatar?')) {
if (confirm('Are you sure you want to remove avatar?')) {
mx.setAvatarUrl('');
setAvatarSrc(null);
}
+2 -2
View File
@@ -86,7 +86,7 @@ function GeneralSettings({ roomId }) {
<MenuItem
variant="danger"
onClick={() => {
if (confirm('Are you sure that you want to leave this room?')) {
if (confirm('Are you really want to leave this room?')) {
roomActions.leave(roomId);
}
}}
@@ -123,7 +123,7 @@ function SecuritySettings({ roomId }) {
<RoomEncryption roomId={roomId} />
</div>
<div className="room-settings__card">
<MenuHeader>Message history visibility</MenuHeader>
<MenuHeader>Message history visibility (Who can read history)</MenuHeader>
<RoomHistoryVisibility roomId={roomId} />
</div>
</>
+1 -1
View File
@@ -63,7 +63,7 @@ function genRoomIntro(mEvent, roomTimeline) {
avatarSrc={avatarSrc}
name={roomTimeline.room.name}
heading={`Welcome to ${roomTimeline.room.name}`}
desc={`This is the beginning of the ${roomTimeline.room.name} room.${typeof roomTopic !== 'undefined' ? (` Topic: ${roomTopic}`) : ''}`}
desc={`This is the beginning of ${roomTimeline.room.name} room.${typeof roomTopic !== 'undefined' ? (` Topic: ${roomTopic}`) : ''}`}
time={mEvent ? `Created at ${dateFormat(mEvent.getDate(), 'dd mmmm yyyy, hh:MM TT')}` : null}
/>
);
+1 -1
View File
@@ -107,7 +107,7 @@ function DeviceManage() {
const handleRemove = async (device, auth = undefined) => {
if (auth === undefined
? window.confirm(`You are about to logout "${device.display_name}" session.`)
? window.confirm(`You are about to logout "${device.display_name}" session?`)
: true
) {
addToProcessing(device);
@@ -90,7 +90,7 @@ function GeneralSettings({ roomId }) {
<MenuItem
variant="danger"
onClick={() => {
if (confirm('Are you sure that you want to leave this space?')) {
if (confirm('Are you really want to leave this space?')) {
leave(roomId);
}
}}
+1 -1
View File
@@ -206,7 +206,7 @@ class RoomList extends EventEmitter {
this.matrixClient.getRooms().forEach((room) => {
const { roomId } = room;
const tombstone = room.currentState.events.get('m.room.tombstone');
if (tombstone?.get('') !== undefined) {
if (typeof tombstone !== 'undefined') {
const repRoomId = tombstone.get('').getContent().replacement_room;
const repRoomMembership = this.matrixClient.getRoom(repRoomId)?.getMyMembership();
if (repRoomMembership === 'join') return;