Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #24

Merged
merged 51 commits into from
Nov 29, 2024
Merged

Dev #24

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
07fd581
HF 29 - Add delegate_vs, and sponsor counters to messenger
1aerostorm Aug 20, 2023
a0bb7ac
Add notificounters for NFT
1aerostorm Oct 22, 2023
6a7b4b5
Referral notifications
1aerostorm Nov 20, 2023
4e90fb0
Fix Formik
1aerostorm Feb 8, 2024
7615ffe
Private groups
1aerostorm Apr 28, 2024
2a1fd8b
HF 30 - Add NFT notifications
1aerostorm Jun 1, 2024
d23818e
HF 30 - Private message groups
1aerostorm Jun 5, 2024
6d9fada
HF 30 - Private message groups
1aerostorm Jun 12, 2024
c01be70
HF 30 - Private message groups
1aerostorm Jun 19, 2024
946b851
HF 30 - Private message groups
1aerostorm Jun 22, 2024
50cbc0b
HF 30 - Private message groups
1aerostorm Jun 22, 2024
58e7238
HF 30 - Private message groups
1aerostorm Jun 23, 2024
8dfa1f4
HF 30 - Private message groups - members, etc.
1aerostorm Jun 27, 2024
5d150a8
HF 30 - Private group, some fixes
1aerostorm Jul 6, 2024
e3ac7e6
HF 30 - Private group, finish members
1aerostorm Jul 8, 2024
44992e0
HF 30 - Private groups - ability to view group, refactor code
1aerostorm Jul 17, 2024
3a704e9
HF 30 - Private groups - managing groups
1aerostorm Jul 22, 2024
9fdf149
Test deps
1aerostorm Jul 23, 2024
edc6620
HF 30 - Private groups dropdown + Update react-foundation-components
1aerostorm Jul 23, 2024
89f5baa
git-install
1aerostorm Jul 24, 2024
e1b850c
HF 30 - Private groups dropdown
1aerostorm Jul 24, 2024
d7f1d58
HF 30 - Private groups
1aerostorm Aug 2, 2024
18e641d
HF 30 - Private groups - Small fixes in stubs
1aerostorm Aug 6, 2024
36853f2
HF 30 - Private groups
1aerostorm Aug 17, 2024
55eb524
HF 30 - Private messages - Block/Unblock
1aerostorm Aug 23, 2024
dd4cad4
HF 30 - Private messages - fix sendMessage
1aerostorm Aug 23, 2024
46c24eb
HF 30 - Private groups - TOP
1aerostorm Aug 23, 2024
0a1e39d
HF 30 - Private messages
1aerostorm Aug 30, 2024
be4e832
HF 30 - Private groups
1aerostorm Sep 2, 2024
e47e553
HF 30 - Profiling
1aerostorm Sep 4, 2024
67201a4
HF 30 - Improve private groups performance
1aerostorm Sep 5, 2024
51a90de
HF 30 - Private groups - Avatars
1aerostorm Sep 5, 2024
c5d6283
HF 30 - getThrentacts
1aerostorm Sep 5, 2024
145c472
HF 30 - Acc cache
1aerostorm Sep 6, 2024
67d4438
HF 30 - lib
1aerostorm Sep 6, 2024
bd590fe
HF 30 - Fix quoting, moderation editing
1aerostorm Sep 6, 2024
515b8a0
HF 30 - Avatars in private groups
1aerostorm Sep 10, 2024
1e2ae41
HF 30 - Lettered avatars
1aerostorm Sep 10, 2024
75f41ca
HF 30 - Private groups notifications
1aerostorm Sep 10, 2024
abd8681
HF 30 - Private groups - Account avatars, mini-accounts
1aerostorm Sep 13, 2024
8e98fff
HF 30 - Private groups - WebSocket, memo key not required, fixes
1aerostorm Sep 22, 2024
04c4041
HF 30 - Private groups - Do not decrypt own messages
1aerostorm Oct 2, 2024
ca9e4ac
HF 30 - Private groups - Load avatars of new messages
1aerostorm Oct 8, 2024
78d0b01
HF 30 - Private groups - Clear/remove chat notification
1aerostorm Oct 8, 2024
63cf192
HF 30 - Private groups - Lettered Avatar Color
1aerostorm Oct 10, 2024
168ee08
HF 30 - Private groups - Fix donates
1aerostorm Oct 10, 2024
2682be6
HF 30 - Private groups - Mentions, replies, fix mark messages
1aerostorm Oct 17, 2024
eda61e6
HF 30 - Fix apps (desktop, Android)
1aerostorm Oct 21, 2024
f375ebd
Mobile app - Fix updates
1aerostorm Nov 16, 2024
37cbeeb
Mobile app - New icons
1aerostorm Nov 25, 2024
5e2b5fc
Merge branch 'master' into dev
Lex-Ai Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*

git-deps
git-install-lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WORKDIR /var/app
COPY . /var/app
RUN yarn install
RUN yarn build
RUN node git-install.js -c

FROM node:16.1-alpine

Expand Down
1 change: 1 addition & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = function override(config, env) {
'process.env.IS_APP': JSON.stringify(!!process.env.IS_APP),
'process.env.DESKTOP_APP': JSON.stringify(!!process.env.DESKTOP_APP),
'process.env.MOBILE_APP': JSON.stringify(!!process.env.MOBILE_APP),
//'process.env.NO_NOTIFY': JSON.stringify(true),
}),
)

Expand Down
3 changes: 2 additions & 1 deletion config/mobile.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"custom_client": "blogs"
},
"notify_service": {
"host": "https://notify.golos.app"
"host": "https://notify.golos.app",
"host_ws": "wss://notify.golos.app/ws"
},
"blogs_service": {
"host": "https://golos.id"
Expand Down
Empty file added git-deps/.gitkeep
Empty file.
125 changes: 125 additions & 0 deletions git-install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
const fs = require('fs')
const util = require('util')
const exec = util.promisify(require('child_process').exec)

const package = require('./package.json')

const { dependencies, gitDependencies } = package

const dir = 'git-deps'

let clc = {}
for (const [key, code] of Object.entries({
cyanBright: '\x1b[36m',
yellowBright: '\x1b[33m',
greenBright: '\x1b[32m',
})) {
clc[key] = (...args) => {
return code + [...args].join(' ') + '\x1b[0m'
}
}

const logDep = (color, ...args) => {
let msg = [' -', ...args]
if (color) {
msg = [clc[color](...msg)]
}
console.log(...msg)
}

async function main() {
const { argv } = process
if (argv[2] === '-c' || argv[2] === '--cleanup') {
const files = await fs.promises.readdir(dir)
for (const f of files) {
if (f !== '.gitignore') {
fs.rmSync(dir + '/' + f, { recursive: true, force: true })
}
}
return
}

if (!gitDependencies) {
console.log('No gitDependencies in package.json, so nothing to preinstall.')
return
}

const lockFile = 'git-install-lock'
if (fs.existsSync(lockFile)) {
console.error(lockFile, 'exists, so cannot run. It is for recursion protection.')
return
}
fs.writeFileSync(lockFile, '1')

console.log(clc.cyanBright('preinstalling deps...'))

if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
process.chdir(dir)

const gitDeps = Object.entries(gitDependencies)
const deps = {}
for (const [ key, dep ] of gitDeps) {
const url = new URL(dep)

const { pathname } = url
const [ repo, branchFolder ] = pathname.split('/tree/')
let branch = '', folder = ''
if (branchFolder) {
const parts = branchFolder.split('/')
branch = ' -b ' + parts[0]
if (parts[1]) {
parts.shift()
folder = parts.join('/')
}
}

const commit = url.hash.replace('#', '')
const repoName = repo.split('/')[2]

deps[key] = { dep, repo, branch, folder, repoName, commit }

if (fs.existsSync(repoName)) {
logDep('yellowBright', repoName, 'already cloned, using as cache.')
continue
}

deps[key].cloned = true

const clone = 'git clone ' + url.origin + repo + branch
logDep('greenBright', clone)
await exec(clone)

if (commit) {
process.chdir(repoName)
const resetTo = 'git reset --hard ' + commit
logDep(null, '-', resetTo)
await exec(resetTo)
process.chdir('..')
}
}

console.log(' ')
console.log(clc.cyanBright('yarn-adding cloned deps (if not added)...'))

for (const [ key, dep ] of Object.entries(deps)) {
let path = './' + dir + '/' + dep.repoName
if (dep.folder) {
path += '/' + dep.folder
}

if (argv[2] === '-f' || dependencies[key] !== path) {
const add = 'yarn add ' + path
logDep('greenBright', add)
await exec(add)
}
}

console.log(clc.greenBright('ok'))
console.log('')

fs.unlinkSync('../' + lockFile)
}

main()
19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"connected-react-router": "^6.9.2",
"counterpart": "^0.18.6",
"emoji-picker-element": "^1.10.1",
"formik": "https://gitpkg.now.sh/golos-blockchain/formik/packages/formik?b697b6ef3f13c795bb862b35589fffde442ab465",
"formik": "./git-deps/formik/packages/formik",
"git-rev-sync": "^3.0.2",
"golos-lib-js": "^0.9.34",
"golos-lib-js": "^0.9.76",
"history": "4.10.1",
"immutable": "^4.0.0",
"koa": "^2.13.4",
Expand All @@ -32,18 +32,20 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dom-confetti": "^0.2.0",
"react-dropzone": "^12.0.4",
"react-foundation-components": "git+https://github.com/golos-blockchain/react-foundation-components.git#6606fd5529f1ccbc77cd8d33a8ce139fdf8f9a11",
"react-dropzone": "^14.2.3",
"react-foundation-components": "./git-deps/react-foundation-components",
"react-intl": "^5.24.6",
"react-notification": "^6.8.5",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"react-select": "^5.8.0",
"react-textarea-autosize": "^8.3.3",
"redux": "^4.1.2",
"redux-logger": "^3.0.6",
"redux-modules": "0.0.5",
"redux-saga": "^1.1.3",
"sass": "^1.49.7"
"sass": "^1.49.7",
"speakingurl": "^14.0.1"
},
"devDependencies": {
"@red-mobile/cordova-plugin-shortcuts-android": "^1.0.1",
Expand All @@ -64,9 +66,14 @@
"react-app-rewired": "^2.1.11",
"react-scripts": "^5.0.0"
},
"gitDependencies": {
"formik": "https://github.com/golos-blockchain/formik/tree/master/packages/formik#3b21166c33ade760d562091e1fa0b71d172a7aaf",
"react-foundation-components": "https://github.com/golos-blockchain/react-foundation-components#45bcb22dd3e078a515a9f7dfb33f834b31f83a43"
},
"scripts": {
"preinstall": "node git-install.js",
"cordova": "cordova",
"dev": "react-app-rewired start",
"dev": "cross-env react-app-rewired start",
"dev:server": "nodemon server",
"build": "react-app-rewired build",
"prod": "NODE_ENV=production node server/index.js",
Expand Down
Binary file modified res/icon-hdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/icon-ldpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/icon-mdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/icon-xhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/icon-xxhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/icon-xxxhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const cors = require('@koa/cors')
const coBody = require('co-body')
const config = require('config')
const git = require('git-rev-sync')
const fs = require('fs')
const path = require('path')
const { convertEntriesToArrays, } = require('./utils/misc')

Expand Down Expand Up @@ -70,14 +71,22 @@ if (env === 'production') {
}

if (env === 'production') {
const buildPath = path.join(__dirname, '../build')
app.use(async (ctx, next) => {
if (ctx.path.startsWith('/@')) {
ctx.url = '/'
const parts = ctx.path.split('/')
// /
// /@user
// /group
if (parts.length === 2 && parts[1] !== 'api') {
const filePath = path.join(buildPath, parts[1])
if (!fs.existsSync(filePath)) {
ctx.url = '/'
}
}
await next()
})
const cacheOpts = { maxage: 0, gzip: true }
app.use(static(path.join(__dirname, '../build'), cacheOpts))
app.use(static(buildPath, cacheOpts))
}

app.use(router.routes())
Expand Down
2 changes: 2 additions & 0 deletions src/_themes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ $themes: (
navBackgroundColor: $color-white,
highlightBackgroundColor: #f3faf0,
tableRowEvenBackgroundColor: #f4f4f4,
borderColor: $light-gray,
border: 1px solid $light-gray,
borderLight: 1px solid $color-border-light-lightest,
borderDark: 1px solid $color-text-gray,
Expand Down Expand Up @@ -98,6 +99,7 @@ $themes: (
zebra: $black-gray,
highlighted: $black-gray,
tableRowEvenBackgroundColor: #212C33,
borderColor: $color-border-dark,
border: 1px solid $color-border-dark,
borderLight: 1px solid $color-border-dark-lightest,
textColorPrimaryborderDark: 1px solid $color-text-gray-light,
Expand Down
5 changes: 5 additions & 0 deletions src/assets/icons/chevron-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icons/clock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icons/golos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icons/info_o.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icons/ionicons/ban-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icons/ionicons/ban.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/ionicons/checkmark-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/ionicons/checkmark-sharp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/ionicons/gift.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/ionicons/happy-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/ionicons/image-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/ionicons/language-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/ionicons/lock-closed-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/assets/icons/ionicons/lock-open-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading