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

Staging #14

Open
wants to merge 290 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
290 commits
Select commit Hold shift + click to select a range
62ec56b
Add back test e2e
MrBlenny Jul 5, 2018
ad65529
Add stemn_env
MrBlenny Jul 5, 2018
7729137
Add sudo run script
MrBlenny Jul 5, 2018
527b282
fix
MrBlenny Jul 5, 2018
9b4fc39
OK
MrBlenny Jul 5, 2018
973423c
gooba
MrBlenny Jul 5, 2018
f0f9507
Save npm and cache to workspace
MrBlenny Jul 5, 2018
5fc9146
install cypress
MrBlenny Jul 5, 2018
fdbc6f4
misc
MrBlenny Jul 5, 2018
3955f62
change
MrBlenny Jul 5, 2018
7e4e382
misc
MrBlenny Jul 5, 2018
f5ca610
website
MrBlenny Jul 5, 2018
ceb1aa2
update command
MrBlenny Jul 5, 2018
e4f8745
[ci skip]
MrBlenny Jul 5, 2018
bb97bdf
Fix indenting
MrBlenny Jul 5, 2018
3d0da36
update docs [ci skip]
MrBlenny Jul 5, 2018
a7db615
Add toc
MrBlenny Jul 5, 2018
f92a143
updated tag in deploy script
tomnlittle Jul 5, 2018
4b9bb53
updated deploy script
tomnlittle Jul 5, 2018
ee91308
dun
nfour Jul 7, 2018
7a91146
Add storm diagrams
MrBlenny Jul 7, 2018
9c8b79b
ts changes
MrBlenny Jul 7, 2018
4657d70
move module
MrBlenny Jul 8, 2018
55fadbe
pushing for david
tomnlittle Jul 8, 2018
a609868
json schema
tomnlittle Jul 8, 2018
1261a9a
Add custom node
MrBlenny Jul 9, 2018
fd81887
Add pipeline types
MrBlenny Jul 9, 2018
ae36538
Add css
MrBlenny Jul 9, 2018
cf1515d
misc
MrBlenny Jul 9, 2018
a4948b3
removed story book
tomnlittle Jul 9, 2018
65aac9f
trailing comma
tomnlittle Jul 9, 2018
7fefd44
base template layout figured
tomnlittle Jul 10, 2018
058d6fb
Misc
MrBlenny Jul 10, 2018
8ea776b
attach launch configuration for vs code
tomnlittle Jul 10, 2018
146aaf6
Merge branch 'vscode-debugger' of github.com:stemn/stemn-frontend int…
tomnlittle Jul 10, 2018
4337965
working
MrBlenny Jul 10, 2018
f0220f5
Working!
MrBlenny Jul 11, 2018
d46f328
add tests
MrBlenny Jul 11, 2018
2792140
test passing
MrBlenny Jul 11, 2018
81eb8c2
Working Model with email, text, password widgets implemented
tomnlittle Jul 11, 2018
b5e3098
fix ts error
MrBlenny Jul 11, 2018
4f31c40
Added date picker and fixed onChange events
tomnlittle Jul 11, 2018
3f60059
fixed padding around block titles
tomnlittle Jul 11, 2018
5395406
TextArea, Upload and Date Widgets for JsonSchema
tomnlittle Jul 11, 2018
ccac983
Update scherma
MrBlenny Jul 11, 2018
03ba0a7
working
MrBlenny Jul 11, 2018
ae1ede4
working
MrBlenny Jul 11, 2018
e9fbde8
some theming
MrBlenny Jul 11, 2018
e28a27a
morning cleanup
tomnlittle Jul 11, 2018
006e15a
cleaned up the example schema
tomnlittle Jul 11, 2018
2b8e16e
cleaned up jsonschema form
tomnlittle Jul 11, 2018
25523d4
misc
MrBlenny Jul 11, 2018
b57a15c
fix
MrBlenny Jul 11, 2018
799abbf
yaml loading
MrBlenny Jul 11, 2018
13731bd
Add node tables
MrBlenny Jul 11, 2018
731260f
Add sidebar widgets
MrBlenny Jul 11, 2018
704c696
onChange event working on text input
tomnlittle Jul 12, 2018
4feca8e
misc
MrBlenny Jul 12, 2018
3ee2b92
Unfinished Date code
tomnlittle Jul 12, 2018
7a6e6cd
disabled broken widgets for now
tomnlittle Jul 12, 2018
3d7f54f
fixed up the example schema for textarea
tomnlittle Jul 12, 2018
8049608
fixed textarea formatting
tomnlittle Jul 12, 2018
69b887d
misc
MrBlenny Jul 12, 2018
54e6cd2
Select Widget
tomnlittle Jul 12, 2018
12d1f5b
Fixed submit being called on any button press
tomnlittle Jul 12, 2018
d601751
removed duplicate description
tomnlittle Jul 12, 2018
b4bd6ac
dropdown of type button
tomnlittle Jul 12, 2018
7b8622c
fixed onChange handler in Textarea
tomnlittle Jul 12, 2018
2198b37
Fixed required fields
tomnlittle Jul 12, 2018
58361bf
misc
MrBlenny Jul 12, 2018
4a2cff5
msic
MrBlenny Jul 12, 2018
129b715
update deps
MrBlenny Jul 13, 2018
3cf6c20
fix lint issues
MrBlenny Jul 13, 2018
781b99f
fixed the format fields in the uischema so they no longer break the f…
tomnlittle Jul 13, 2018
51a0b8b
misc
MrBlenny Jul 13, 2018
790cc48
Moved the format transformation function out into their own utils file
tomnlittle Jul 13, 2018
495fbb3
code cleanup for linter
tomnlittle Jul 13, 2018
0dcef10
misc
MrBlenny Jul 13, 2018
ec8fc84
Added custom error messages
tomnlittle Jul 13, 2018
3b9758c
Some of the requested changes and removed unused files
tomnlittle Jul 13, 2018
33885a3
Removed date
tomnlittle Jul 13, 2018
87ab9d5
misc
MrBlenny Jul 13, 2018
e2634d2
Added error animations
tomnlittle Jul 15, 2018
bff7db1
Checkbox styling and on errors the text boxes now appear red
tomnlittle Jul 15, 2018
1d92ed1
misc
MrBlenny Jul 15, 2018
3358931
Cleaned up the layout and aggregated some of the visual elements
tomnlittle Jul 15, 2018
eec2178
Ok ...
tomnlittle Jul 15, 2018
455b335
misc
MrBlenny Jul 16, 2018
bfba482
Add schema form
MrBlenny Jul 16, 2018
dd14b22
misc
MrBlenny Jul 18, 2018
f248cb0
add schema
MrBlenny Jul 19, 2018
de3f3fa
misc
MrBlenny Aug 1, 2018
f2b76a9
misc
MrBlenny Aug 1, 2018
4abe2c9
Delete TransformUiSchema.ts
MrBlenny Aug 1, 2018
5fe2853
Delete TransformErrors.ts
MrBlenny Aug 1, 2018
a3d9452
misc
MrBlenny Aug 1, 2018
0234b24
Add cypress record
MrBlenny Aug 1, 2018
e800df1
misc
MrBlenny Aug 1, 2018
a871870
misc
MrBlenny Aug 1, 2018
4bf899f
Merge branch 'feature/pipline-ui-canvas' of github.com:MrBlenny/stemn…
MrBlenny Aug 1, 2018
4f35248
add any type hack
MrBlenny Aug 2, 2018
be9ae4d
Added tslint
MrBlenny Aug 2, 2018
b82d53d
Add back lint
MrBlenny Aug 2, 2018
1d2c4b7
misc
MrBlenny Aug 2, 2018
082b8fb
Make pure
MrBlenny Aug 2, 2018
10626e1
misc
MrBlenny Aug 2, 2018
a13af8e
Add cast
MrBlenny Aug 2, 2018
dc7f3f4
Add Cast
MrBlenny Aug 2, 2018
c45ec43
Merge pull request #21 from MrBlenny/feature/pipline-ui-canvas
MrBlenny Aug 2, 2018
806a3e6
Add namespace to kubectl image set
MrBlenny Aug 2, 2018
3ada62e
Don't minify
MrBlenny Aug 2, 2018
df67bec
misc
MrBlenny Aug 2, 2018
6b56c1d
Change install
MrBlenny Aug 2, 2018
27c0125
misc
MrBlenny Aug 2, 2018
f749621
misc
MrBlenny Aug 2, 2018
c006446
misc
MrBlenny Aug 2, 2018
7c7f88c
misc
MrBlenny Aug 2, 2018
fb971fe
potential-fix for linux build
tomnlittle Aug 10, 2018
bfd1146
update the ci node version to 8.11
tomnlittle Aug 10, 2018
89c9362
removed cypress as a dependency
tomnlittle Aug 10, 2018
2872f83
updated cache dependency keys
tomnlittle Aug 10, 2018
0df2e7e
fixing desktop and adding analytics
MrBlenny Aug 10, 2018
477eda6
Desktop is working
MrBlenny Aug 12, 2018
a22ca7a
update packages
MrBlenny Aug 12, 2018
159ce51
update node version
MrBlenny Aug 12, 2018
6192157
changes
MrBlenny Aug 12, 2018
ef1c529
fix lock files
MrBlenny Aug 12, 2018
27797fa
updated build script
MrBlenny Aug 12, 2018
5c3f756
Add webpack cli
MrBlenny Aug 12, 2018
08bb74c
sudo install
MrBlenny Aug 12, 2018
f76fb8e
remove sudo
MrBlenny Aug 12, 2018
94643fc
Minify prod
MrBlenny Aug 12, 2018
0728f0b
release
MrBlenny Aug 12, 2018
1c6ba1e
release
MrBlenny Aug 12, 2018
4072cab
remove old build script
MrBlenny Aug 12, 2018
4b5bbf3
rename install
MrBlenny Aug 12, 2018
8927aa1
release
MrBlenny Aug 12, 2018
79d9fc0
Add deploy prompt
MrBlenny Aug 12, 2018
4fa92d5
release
MrBlenny Aug 12, 2018
aec5e14
Fix name
MrBlenny Aug 12, 2018
cf8e1fc
fix deploy desktop
MrBlenny Aug 12, 2018
736c70d
Update build scripts
MrBlenny Aug 12, 2018
1920f63
remove export
MrBlenny Aug 16, 2018
3164b33
deploy after tests
MrBlenny Aug 16, 2018
dd97692
Add analytics page tracks
MrBlenny Aug 16, 2018
3fb2493
Update readme
MrBlenny Aug 16, 2018
70e0400
Change auth config for staging
MrBlenny Aug 16, 2018
ea55dc4
Auth config
MrBlenny Aug 16, 2018
e0f2426
fix build
MrBlenny Aug 23, 2018
05cc099
Desktop settings fixed
MrBlenny Aug 23, 2018
bfd1df2
Fix preview markdown
MrBlenny Aug 23, 2018
dba5571
Fix desktop preview page loading
MrBlenny Aug 23, 2018
efe1f68
misc
MrBlenny Aug 24, 2018
686976e
Change includes
MrBlenny Aug 26, 2018
5d9b4ad
Update lock
MrBlenny Aug 26, 2018
ff80e06
Update ci config
MrBlenny Aug 26, 2018
37b093e
Remove yarn error
MrBlenny Aug 26, 2018
b38de1e
Remove yarn error
MrBlenny Aug 26, 2018
7f7b940
Misc desktop improvments
MrBlenny Aug 27, 2018
1998e24
Fix circleci approval
MrBlenny Aug 27, 2018
dc7e8fa
Update desktop deploy script
MrBlenny Aug 27, 2018
bd3a898
Convert project row and explore page to typescript
MrBlenny Aug 29, 2018
aadfdd1
Add featured tiles
MrBlenny Aug 30, 2018
3218825
Explore page working with contentful
MrBlenny Aug 30, 2018
7402b04
Updates project row view
MrBlenny Aug 30, 2018
1dcc76f
Add info icons to project rows
MrBlenny Aug 30, 2018
4416c15
Merge pull request #25 from MrBlenny/explore-page
MrBlenny Aug 30, 2018
8a8f8b9
Lint fix
MrBlenny Aug 30, 2018
8419040
Disablke no use before declare
MrBlenny Aug 30, 2018
1a431de
Add jsx tslint rules
MrBlenny Sep 6, 2018
27ff8cd
Convert file to ts
MrBlenny Sep 6, 2018
c3768f9
Fix file page
MrBlenny Sep 6, 2018
2c6342b
Add upload modal
MrBlenny Sep 7, 2018
d2b2f17
Add redux form
MrBlenny Sep 7, 2018
c896838
Add file upload
MrBlenny Sep 7, 2018
373ad07
File upload
MrBlenny Sep 8, 2018
e16afa9
merge
sabrehagen Sep 8, 2018
63eecba
script run
sabrehagen Sep 8, 2018
e743a9d
reverse dep fuckup
sabrehagen Sep 8, 2018
c78eb46
Fix upload endpoint
MrBlenny Sep 9, 2018
92aa00a
Add fileList types
MrBlenny Sep 12, 2018
2716b47
Fix promise middleware export
MrBlenny Sep 13, 2018
a93edb2
Remove default
MrBlenny Sep 13, 2018
2c97faa
Cypress tests in ts
MrBlenny Sep 13, 2018
6a6c9ac
Convert cypress to ts
MrBlenny Sep 13, 2018
64699e2
Fix conflicts
MrBlenny Sep 15, 2018
cf1170e
Add Edit Button
MrBlenny Sep 15, 2018
f84d6fe
Add ts to files and file compare menu
MrBlenny Sep 15, 2018
73d9b9d
Add mode type
MrBlenny Sep 16, 2018
888d23b
Change actions to ts
MrBlenny Sep 16, 2018
d8bdd41
Update actions
MrBlenny Sep 16, 2018
ffe0546
Convert PreviewFile to ts
MrBlenny Sep 16, 2018
07383d9
Conver compare to ts
MrBlenny Sep 16, 2018
480905e
Fix fetchTimeline changes
MrBlenny Sep 16, 2018
a0ac287
Lint fixes
MrBlenny Sep 16, 2018
01e33b5
Fix codemirror import
MrBlenny Sep 16, 2018
5a021d6
Remove scroll bars on file page
MrBlenny Sep 16, 2018
9a9dcad
Upade SimpleIconButton to ts
MrBlenny Sep 16, 2018
1296467
lockfile
sabrehagen Sep 18, 2018
1636a4e
missing deps
sabrehagen Sep 18, 2018
37127d2
more deps
sabrehagen Sep 18, 2018
bdf59c8
Add button types
MrBlenny Sep 18, 2018
c856a33
Merge branch 'feature/create-or-upload-file' of github.com:MrBlenny/s…
MrBlenny Sep 18, 2018
813135a
Revert "more deps"
sabrehagen Sep 18, 2018
b23103b
Revert "missing deps"
sabrehagen Sep 18, 2018
4e1e130
Merge branch 'feature/create-or-upload-file' of github.com:MrBlenny/s…
sabrehagen Sep 18, 2018
ae12c37
bump node-sass to 4.9.3
sabrehagen Oct 4, 2018
6832ea4
Revert "bump node-sass to 4.9.3"
sabrehagen Oct 4, 2018
3bff4ce
bump node-sass to 4.9.3
sabrehagen Oct 4, 2018
51ecdc1
new scripts
sabrehagen Oct 4, 2018
9d5d9fb
Desktop working
MrBlenny Oct 5, 2018
79d800c
Merge branch 'staging' of github.com:stemn/stemn-frontend into david/…
sabrehagen Oct 5, 2018
023456f
lockfile
sabrehagen Oct 5, 2018
29f9025
Revert "new scripts"
sabrehagen Oct 5, 2018
cd5987c
Merge branch 'staging' of github.com:stemn/stemn-frontend into david/…
sabrehagen Oct 5, 2018
3001f14
make scripts generic
sabrehagen Oct 6, 2018
aad1e4a
Merge branch 'staging' of github.com:stemn/stemn-frontend into david/…
sabrehagen Oct 6, 2018
ef7f696
swap id order
sabrehagen Oct 6, 2018
5b60bb4
use npm ci
sabrehagen Oct 7, 2018
0a92e2a
fix dep order
sabrehagen Oct 7, 2018
8824246
ci shared
sabrehagen Oct 7, 2018
61cf8e4
use node 10.11
sabrehagen Oct 7, 2018
3d66b54
fix bad package-lock.json
sabrehagen Oct 7, 2018
3022fda
fix bad package-lock.json
sabrehagen Oct 7, 2018
2a17ed5
top level redux
sabrehagen Oct 7, 2018
7db0786
building
sabrehagen Oct 7, 2018
e2e8461
lockfile
sabrehagen Oct 7, 2018
61e9eb7
Merge pull request #1 from sabrehagen/david/feature/create-or-upload-…
MrBlenny Oct 7, 2018
8f3e137
Fix editor and textarea focus
MrBlenny Oct 12, 2018
0b9edef
Default file list path to remote root
MrBlenny Oct 28, 2018
4fb7510
fix tokens and url
sabrehagen Nov 7, 2018
1b967a7
use fileId
sabrehagen Nov 8, 2018
8f1cca7
http method
sabrehagen Nov 8, 2018
2a139ec
dfaults
sabrehagen Nov 8, 2018
4b3be5e
various fixes
sabrehagen Nov 9, 2018
2fbcc6b
file id
sabrehagen Nov 9, 2018
8f25afb
fix timeline call
sabrehagen Nov 18, 2018
88ad948
primary email fix
sabrehagen Nov 19, 2018
e53325f
custom env
sabrehagen Dec 2, 2018
4bd5947
scripts
sabrehagen Dec 29, 2018
e56c9e4
fix
sabrehagen Jan 2, 2019
d870f36
fix
sabrehagen Jan 2, 2019
72854a0
upgrade-sass
sabrehagen Jan 6, 2019
12ecd2a
Merge branch 'david/feature/create-or-upload-file' of github.com:sabr…
sabrehagen Jan 6, 2019
e3f0fd1
no-and
sabrehagen Jan 31, 2019
203e0ac
Merge branch 'david/feature/create-or-upload-file' of github.com:sabr…
sabrehagen Jan 31, 2019
51418a3
no-integrity
sabrehagen Feb 12, 2019
fb494bc
add-concurrency
sabrehagen Feb 13, 2019
70d1407
env
sabrehagen Mar 18, 2019
b2c1427
crash
sabrehagen Mar 24, 2019
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
Prev Previous commit
Next Next commit
various fixes
  • Loading branch information
sabrehagen committed Nov 9, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 4b3be5e1040e5cc918061441fcb080825fec6899
35 changes: 18 additions & 17 deletions stemn-frontend-shared/src/misc/Files/PreviewFile/PreviewFile.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import * as React from 'react'
import laptopSpanner from 'stemn-shared/assets/images/pure-vectors/laptop-spanner.svg'
import { IFileData, IFileRender } from 'stemn-shared/misc/Files/Files.reducer'
import DownloadFile from '../DownloadFile/DownloadFile.jsx'
import ErrorMessages from './Messages/Messages.jsx'
import { isAssembly } from './PreviewCad/PreviewCad.utils.js'
import PreviewCadLoader from './PreviewCadLoader'
import PreviewCode from './PreviewCode'
import { dispatchToProps, IPreviewFileContainerProps } from './PreviewFile.container'
import * as classes from './PreviewFile.scss'
import { getViewerType } from './PreviewFile.utils'
import PreviewGdoc from './PreviewGdoc/PreviewGdoc'
import PreviewGoogle from './PreviewGoogle/PreviewGoogle'
import PreviewImage from './PreviewImage/PreviewImage'
import PreviewPcbLoader from './PreviewPcbLoader'
import PreviewPdfLoader from './PreviewPdfLoader'
import { PreviewPipeline } from './PreviewPipeline'
import * as React from 'react';
import laptopSpanner from 'stemn-shared/assets/images/pure-vectors/laptop-spanner.svg';
import { IFileData, IFileRender } from 'stemn-shared/misc/Files/Files.reducer';

import DownloadFile from '../DownloadFile/DownloadFile.jsx';
import ErrorMessages from './Messages/Messages.jsx';
import { isAssembly } from './PreviewCad/PreviewCad.utils.js';
import PreviewCadLoader from './PreviewCadLoader';
import PreviewCode from './PreviewCode';
import { dispatchToProps, IPreviewFileContainerProps } from './PreviewFile.container';
import * as classes from './PreviewFile.scss';
import { getViewerType } from './PreviewFile.utils';
import PreviewGdoc from './PreviewGdoc/PreviewGdoc';
import PreviewGoogle from './PreviewGoogle/PreviewGoogle';
import PreviewImage from './PreviewImage/PreviewImage';
import PreviewPcbLoader from './PreviewPcbLoader';
import PreviewPdfLoader from './PreviewPdfLoader';
import { PreviewPipeline } from './PreviewPipeline';

export interface IPreviewFileComponentProps extends IPreviewFileContainerProps {
getFile: typeof dispatchToProps['getFile'],
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import http from 'axios'
import http from 'axios';

export const getAssemblyParents = (
{ projectId, fileId, revisionId, provider }:
{ projectId, fileId, revisionId = '', provider }:
{ projectId: string, fileId: string, revisionId: string, provider: string },
) => {
const cacheKey = `${fileId}-${revisionId}`
return {
type: 'FILES/GET_ASSEMBLY_PARENTS',
payload: http({
url: projectId
? `/api/v1/sync/assemblyParents/${projectId}/${fileId}`
: `/api/v1/remote/assemblyParents/${provider}/${fileId}`,
params: { revisionId },
? `/api/v1/sync/assemblyParents/${projectId}/${fileId}/${revisionId}`
: `/api/v1/remote/assemblyParents/${provider}/${fileId}/${revisionId}`,
}),
meta: {
cacheKey,
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import http from 'axios'
import http from 'axios';

export const getAssemblyParts = ({ projectId, fileId, revisionId, provider }) => {
export const getAssemblyParts = ({ projectId, fileId, revisionId = '', provider }) => {
const cacheKey = `${fileId}-${revisionId}`
return {
type: 'FILES/GET_ASSEMBLY_PARTS',
payload: http({
url: projectId
? `/api/v1/sync/assemblyParts/${projectId}/${fileId}`
: `/api/v1/remote/assemblyParts/${provider}/${fileId}`,
params: { revisionId },
? `/api/v1/sync/assemblyParts/${projectId}/${fileId}/${revisionId}`
: `/api/v1/remote/assemblyParts/${provider}/${fileId}/${revisionId}`,
}),
meta: {
cacheKey,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const getFile = ({ projectId, fileId, revisionId, provider, responseType }) => {
export const getFile = ({ projectId, fileId, revisionId = '', provider, responseType }) => {
const cacheKey = `${fileId}-${revisionId}`
return {
type: 'FILES/GET_FILE',
@@ -8,9 +8,8 @@ export const getFile = ({ projectId, fileId, revisionId, provider, responseType
functionInputs: {
key: cacheKey,
url: projectId
? `/api/v1/sync/download/${projectId}/${fileId}`
: `/api/v1/remote/download/${provider}/${fileId}`,
params: { revisionId },
? `/api/v1/sync/download/${projectId}/${fileId}/${revisionId}`
: `/api/v1/remote/download/${provider}/${fileId}/${revisionId}`,
name: cacheKey,
responseType: responseType || 'json',
},
9 changes: 4 additions & 5 deletions stemn-frontend-shared/src/misc/Files/actions/getFile.web.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import http from 'axios'
import http from 'axios';

export const getFile = ({ projectId, fileId, revisionId, provider, responseType }) => {
export const getFile = ({ projectId, fileId, revisionId = '', provider, responseType }) => {
const cacheKey = `${fileId}-${revisionId}`

// If the response type is path, we change it to blob and create
@@ -9,9 +9,8 @@ export const getFile = ({ projectId, fileId, revisionId, provider, responseType
type: 'FILES/GET_FILE',
payload: http({
url: projectId
? `/api/v1/sync/download/${projectId}/${fileId}`
: `/api/v1/remote/download/${provider}/${fileId}`,
params: { revisionId },
? `/api/v1/sync/download/${projectId}/${fileId}/${revisionId}`
: `/api/v1/remote/download/${provider}/${fileId}/${revisionId}`,
responseType: responseType === 'path' ? 'blob' : responseType,
}).then((response) => {
if (responseType === 'path') {
9 changes: 3 additions & 6 deletions stemn-frontend-shared/src/misc/Files/actions/getMeta.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
export const getMeta = ({ projectId, fileId, revisionId, provider, cacheKey }) => ({
export const getMeta = ({ projectId, fileId, revisionId = '', provider, cacheKey }) => ({
type: 'FILES/GET_META',
http: true,
payload: {
method: 'GET',
url: projectId
? `/api/v1/sync/files/${projectId}/${fileId}`
: `/api/v1/remote/files/${provider}/${fileId}`,
params: {
revisionId,
},
? `/api/v1/sync/files/${projectId}/${fileId}/${revisionId}`
: `/api/v1/remote/files/${provider}/${fileId}/${revisionId}`,
},
meta: {
cacheKey: cacheKey || `${fileId}-${revisionId}`,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { joinRoom } from 'stemn-shared/misc/Websocket/Websocket.actions'
import { joinRoom } from 'stemn-shared/misc/Websocket/Websocket.actions';

export const renderFile = ({ projectId, fileId, revisionId, provider, timestamp }) => (dispatch) => {
// The cache key is used as the renderId/roomId
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { joinRoom } from 'stemn-shared/misc/Websocket/Websocket.actions'
import { joinRoom } from 'stemn-shared/misc/Websocket/Websocket.actions';

export const renderFile = ({ projectId, fileId, revisionId, provider, timestamp }) => (dispatch) => {
// The cache key is used as the renderId/roomId
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const renderFileDownload = ({ projectId, fileId, revisionId, provider, timestamp }) => {
export const renderFileDownload = ({ projectId, fileId, revisionId = '', provider, timestamp }) => {
const cacheKey = timestamp ? `${fileId}-${revisionId}-${timestamp}` : `${fileId}-${revisionId}`
return {
type: 'FILES/RENDER_FILE_DOWNLOAD',
@@ -8,9 +8,9 @@ export const renderFileDownload = ({ projectId, fileId, revisionId, provider, ti
functionInputs: {
key: cacheKey,
url: projectId
? `/api/v1/sync/downloadRender/${projectId}/${fileId}`
: `/api/v1/remote/downloadRender/${provider}/${fileId}`,
params: { revisionId, timestamp },
? `/api/v1/sync/downloadRender/${projectId}/${fileId}/${revisionId}`
: `/api/v1/remote/downloadRender/${provider}/${fileId}/${revisionId}`,
params: { timestamp },
name: cacheKey,
responseType: 'path',
extract: true,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const renderFileDownload = ({ projectId, fileId, revisionId, provider, timestamp }) => {
export const renderFileDownload = ({ projectId, fileId, revisionId = '', timestamp }) => {
// When we are on web (and we know the render is complete)
// we set the render path to the store instead of downloading it.
const cacheKey = timestamp ? `${fileId}-${revisionId}-${timestamp}` : `${fileId}-${revisionId}`
18 changes: 12 additions & 6 deletions stemn-frontend-shared/src/misc/Threads/Threads.actions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import http from 'axios';
import { storeChange } from 'stemn-shared/misc/Store/Store.actions';
import threadLabelsEditModalName from 'stemn-shared/misc/Threads/ThreadLabelsEditModal';
import { pickId } from 'stemn-shared/utils/pickId.js';

import { showConfirm, showModal } from '../Modal/Modal.actions.js';
import { show as showToast } from '../Toasts/Toasts.actions.js';
@@ -130,7 +131,12 @@ export const updateThread = ({ thread }) => (dispatch, getState) => dispatch({
payload: {
method: 'PUT',
url: `/api/v1/threads/${thread._id}`,
data: thread,
data: {
...thread,
owner: pickId(thread.owner),
project: pickId(thread.project),
users: thread.users.map(pickId),
},
},
meta: {
cacheKey: thread._id,
@@ -194,12 +200,12 @@ export function moveThread({ boardId, thread, destinationThread, destinationGrou
type: 'THREADS/MOVE_TASK',
payload: http({
method: 'POST',
url: '/api/v1/threads/move',
url: `/api/v1/threads/${thread}/move`,
data: {
board: boardId,
thread,
destinationGroup,
destinationThread,
boardId,
threadId: thread,
destinationGroupId: destinationGroup,
destinationThreadId: destinationThread,
after,
},
}),
1 change: 1 addition & 0 deletions stemn-frontend-shared/src/utils/isObjectId.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isObjectId = (objectId) => /^[a-f0-9]{24}$/.test(objectId);
20 changes: 20 additions & 0 deletions stemn-frontend-shared/src/utils/pickId.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { isObjectId } from 'stemn-shared/utils/isObjectId.js';

export const pickId = (obj) => {

// mongoose models don't work with Object.keys, so strip the model if it exists
const object = obj && obj.toObject
? obj.toObject()
: obj;

// mentions are a special case that use mentionId, not _id
if (object && Object.keys(object).includes('mentionId')) {
return object.mentionId;
} else if (object && Object.keys(object).includes('_id')) {
return pickId(object._id);
} else if (isObjectId(object)) {
return object.toString();
} else {
return object;
}
};