Commit graph

24 commits

Author SHA1 Message Date
Anantshree Chandola
03e3fd950b
New Improved App creation flow (#7209)
* App creation flow

* Add separate footer and divider

* added create app dto, updated tests

* update test

* Update server/src/dto/app-create.dto.ts

Co-authored-by: Midhun G S <gsmithun4@gmail.com>

* Update server/src/dto/app-create.dto.ts

Co-authored-by: Midhun G S <gsmithun4@gmail.com>

* updates

* Removed comments

* small updates

* rename app flow

* Import App, Create App From Template, Clone App (BE+FE)

* Edit app updates

* remove comments

* updates

* updates

* styling updates

* handle spaces in app name

* update

* styling updates

* Update permissions

* updates

* don't show toast failure message

* Update frontend/src/Editor/Header/EditAppName.jsx

Co-authored-by: Muhsin Shah C P  <muhsinshah21@gmail.com>

* styling updates

* Update server/src/controllers/app_import_export.controller.ts

Co-authored-by: Muhsin Shah C P  <muhsinshah21@gmail.com>

* remove comments

* remove comments and small corrections

* removed logs and deleted unwanted files

* correct lint error

* resolve failing tests + handled trimmed app names

* resolve failing tests + handle trimmed app names

* updates

* duplicate imports removed

* updates

* Rebase corrections and updates

* update

* resolve failing e2e test

* fix error

* fix

* length fix

* fix

---------

Co-authored-by: Midhun G S <gsmithun4@gmail.com>
Co-authored-by: Muhsin Shah C P <muhsinshah21@gmail.com>
2023-10-17 13:18:18 +05:30
Akshay
cb0aca6a8c
fix unit tests for import (#7477) 2023-09-21 16:44:27 +05:30
Akshay
c6fe0aa45e
Feature: Import export tjdb schema (#5752)
* add ability to import export app and tjdb schema

* init

* feat ::global settings popover new ui

* feat :: ui for version export modal

* fix :: import export modal

* cleanup

* ui updates

* header footer style fixes

* closing settings modal while showing export modal

* style fix header

* feat :: added button to download table schema

* fix :: styling for fx

* add ability to import and export apps with tjdb schema

* handle duplicate table in workspace

* fix table rename

* fix selected table on edit and delete

* fix invalid toast on table delete

* fix column default value

* handle exports to strip '::' and quotes

* make import/export backward compatible

* handle page redirects based on resource import

* handle import without tjdb schema

* fix column delete and addition

* make data migrations to be run per organizations

* wip

* update migration

* fix credentials to be included

* fix specific version export

* make use of apps ability for import export resource

* fix import navigation

* fix lint

* fix failing tests

* fix lint

* enable tjdb for public apps

* update export error message on tjdb table blank

* fix table not selected after creation

* fix :: styling for imp exp modal , and functionality bug fixes after dev merge

* fixes blank slate and columns selection

* fix table delete

* fix invalid toast on table edit

* fix column information missing tjdb query manager

* make ds imports to either reuse global or create

* export only unique table ids

* create default datasources if not present in export data

* reuse existing table on imports

* add timestamp to table name if name already exists

* add ability to clone with tjdb

* make imports work with marketplace plugin

* skip dataqueries for which plugins are not installed

* fix filter input width

* fix failing spec

* fix marketplace plugin installation in diff workspaces

* fix check for plugin installed in workspace

* fix export when table name is empty

---------

Co-authored-by: stepinfwd <stepinfwd@gmail.com>
2023-08-28 21:23:15 +05:30
Muhsin Shah C P
4331b40869
[Improvements] Environment changes (#6762)
* Added priority, enabled, current_environment_id columns
- added data-migrations to backfill the priority and current environment id for each version

* working on multi environments improvement
- added checks for promoted env
- promote env feature
- released app & production env check
- promoted version definition check

* added import support

* working on migration issues

* fixed failing migration

* fixed failing migration once again

* Fixed possible bugs
- seed
- test case helpers
- app version release

* fixed migration bug

* working on migration progress

* working on migration progress class

* added migration progress

* fixed unit tests

* fixed e2e cases

* added default priority

* added PR changes

* changed import logic

* added global datasource design and api changes

* changed default env if the id is null

* added unique constraint and a bug fix

* changed app versions api
- added current environment id to the where conditions

* fixed failing test cases

* added new test cases

* added new api changes

* added back the enabled check

* fixed test case

* change: added environment to create versions dto

* typo: environmentId

* added new api for fetching versions

* added appVersions count changes to CE

* Changed app versions by environmentid logic

* added PR changes for EE

* fixed wrong promoted env id issue

* fix: can't switch to staging

* added import export changes
- update delete modal text

* added EE import export code, modal updated text

* added common migration code for CE and EE

* fixes
- enable run button for released version
- disable change datasource for queries

* changed released version popup design to new EE design

* add: hide delete icons for released version
2023-07-11 10:10:03 +05:30
Muhsin Shah C P
a455a50e98
Sanitising workspace folder name while creating or editing a folder (#6396)
* added: frontend validation

* added attributes and constraints to folder name

* fixed migration

* replaced isAlphanumeric decorator with regex matches

* change: handle unwanted spaces

* handle error messages

* reverted css change

* folder name: adding error messages, refactoring code

* adding: PR changes

* fix: test cases

* fix: test cases

* changed max-length

* added PR changes and fixes

* added common error css change

* changed error message

* adding folder name to the prompt

* updated folder constraints

* updated maximum length

* fix: empty check

* added : folder dto name empty message

* fixed failing test cases

* added folder tooltip
2023-06-07 15:03:54 +05:30
Muhsin Shah C P
e7bb22e649
[enhancement] Sanitising app name while creating or editing an app (#6423)
* working on app name unique migrationworking on app name unique migration

* Added checks and conditions

* change: remove staring and ending spaces

* fix: error management

* fix: regex

* working on app name generation

* app name:fixing bugs

* app name: fixing and refactoring code

* app name: fixed test cases

* updated app name constraints and default name

* fix: apps.e2e tests case

* fix: added app name to the prompt

* added app input tooltip

* removed unwanted code

* added tooltip close code

* fixed auto generated name issue

* merging develop

* code refactoring

---------

Co-authored-by: gsmithun4 <gsmithun4@gmail.com>
2023-06-06 14:12:36 +05:30
Muhsin Shah C P
32740743e1
[Improvement] URLs scoped with workspace id (#5487)
* add: new URL prefix

* fix: working on home page

* add: profile path

* playing with rxjs

* removed context part

* working on path changes

* changing routes
- TODO: replace the workspaceId with actual id

* redo: public apps path

* initial commit

* added authorize API

* remove privileges from auth response

* fixed some api issue
- added subscriptions

* fix: redirect url workspace-id null issue

* fix: switch workspace

* fix: organization list mapping
- menu item paths

* fix: preview url
- editor, viewer permission mapping

* jwt fix

* fix: some url issue
- permission mappings
- workspace login

* fixed some issues
- user invite workspace-id
- org settings menu item default selected item issue

* app viewer fixes

* fixing workspace login issues

* fix

* fixing issues
- tooljet db
- path issues
- refatoring the code

* fix: workspace vars permissions

* fix: multi-page handle

* fix: create app from template

* fix: bulk user upload

* fix: import app
- clone app
- upload profile image

* fix: onboarding

* fix: log out

* fixed multi-workspace logout issue

* fix: launch btn

* fix: oauth2

* fixes

* fix: sso login

* fix: workspace sso login

* fixing sso issues

* fix: moved list of orgs to rxjs
- fixed switching issues

* reverting some changes

* fixed some minor bugs

* fixing sso redirect url issues

* fix: switching network timing issues

* fix: back to workspace-id

* fix: tj-database
- refactored the code - removed org id from some pages
- will get the org id from the service file only

* fix: multi-pages

* fix: infinite loop issue

* fixing workspace switching issue

* fixes
- comment link
- logout & private route redirect url

* fix: wrong uuid error

* fixing subpath
- fixed most of the places
- need to test & fix workspace login, sso, new account

* fix: subpath workspace login

* fix: rxjs handle bug

* Revert "fix: tj-database"

This reverts commit 9632ec2ff0.

* fix: reverted tj-db changes

* fix: subpath sso

* typo fix

* fix: existing session issues

* new: switch workspace page

* fix: modal dark-mode

* added default sso support

* fixes
- subpath workspace switching
- handle wrong routes

* fix: manager user button
- refactored the code

* removed SINGLE Workspace feature

* rebase

* add: change modal text

* fix: added validation

* fixed private app 401 issue

* initial commit

* fix: logged out session multi-tab issue

* refactoring the code

* fix: redirect url issue

* added auth-token in cookies

* Fix: failing e2e specs

* added session API

* fix: backend session guard

* fix: removing user details from local storage

* fix: null wid

* undo and redo

* fix: login page

* fix: viewer login redirection

* fix: login page redirection

* fix: public apps logout issue

* added session storage and scheduler

* added profile api

* fix: sso login
- switch workspace
- login page
- setup admin

* working on fixes

* fix: socket issue

* fix: setup admin api

* connected profile & logout apis

* fix: malfunctioned auth token case

* fix: realtime avatar

* fix: profile avatar

* fix: Realtime cursors avatar

* setting max age for auth token cookie

* add: Go to login page if logout api returns 401

* fix: subpath login

* fix

* fix: app logout [viewer]

* fix: authorize page

* remove expiry from jwt

* fix: integrations route
- session api

* small fix

* fix: updated profile

* fix: workspace login [logged user]

* fix: oauth and another workspace page issue

* fixed app preview logout issue

* subpath fix

* fix: subpath app id

* fix: selected state didnt change for apps page [subpath]

* fix

* add cookie parser to test app

* specs added

* increased user session expiry time

* test: session & new apis

* working on test cases

* fix: onboarding issue

* fixing specs

* fix: test cases

* fix: removing profile api calls

* some fixes

* fixing rebase issues

* fix: global ds issues

* fix: app is crashing

* fix: back to text

* fix: oauth test cases

* fix: test-helper

* fix: onboarding test cases

* fix: tests again

* refactoring the code

* latest develop merging precautions
- fixed a minor null issue

* fix: typo

* fix :menu issues due to the merging

* fix: - clicking on tooljet logo didnt redirect to login page for public apps
- private app preview doesnt load after login

* subpath fixes

* fixed back to issue

* PR changes

* fix: spec fixes for EE

* doc: URL scoped for workspace

---------

Co-authored-by: gsmithun4 <gsmithun4@gmail.com>
Co-authored-by: Shubhendra <withshubh@gmail.com>
2023-04-06 16:42:58 +05:30
vjaris42
bb9a211e55
[Feature] :: Global datasources (#5504)
* add: columns and migrations for data queries and sources

* add: migrations for app environments

* fix: datasources and queries api

* fix: import apis

* add: radixui colors

* create: global datasource page

* fix: version creation not including global datasources queries

* fix: version deletion failure

* fix: ui and other bugs

* add: check for abilities on global ds

* fix: bugs

* fix: existing test cases

* fix: migration and bugs

* fix: rest api oauthorize bugs

* hide: add button for local ds

* fix: query bugs

* fix: new organization environment creation

* fix: local ds label showing for new apps

* fix: on page load queries for preview app and published app

* fix: import bugs from v1

* fix: merge conflicts

* fix: import apis

* fix: apss with mulit envs

* fix: ui bugs

* fix: environments not being created on db:seed

* fix: ui bugs

* fix: route settings for global datasources

* fix: customer dashboard template

* fix: local ds queries not being saved

* fix: runpy issues

* changes: ui

* fix: migration issues

* fix: ui

* hide datasources when no local datasources

* fix: test cases

* fix: unit test cases and global queries on app import/export

* cleanup

* add: package-lock file

* undo: migration rename

* cleanup

* fix: ui bugs

* migration fixes

* fix: dark mode issues

* fix: change datasource failing on query create mode

* fix: workspace selector issues

* fix: clickoutside for change scope option

* migration changes

* fix: open api issue

* reverting configs changes

* [Fix] Global datasources & Environment Id issue (#5830)

* fix: oauth env id issue

* code changes

---------

Co-authored-by: gsmithun4 <gsmithun4@gmail.com>
Co-authored-by: Muhsin Shah <muhsinshah21@gmail.com>
2023-03-24 21:41:21 +05:30
Muhsin Shah C P
ff4822c397
Fix: v2-beta test cases (#5221)
* stashed from multi-env-cases

* fixed new issues

* skip: tooljet_db specs

* added comment

* typo

* fix: fixing errors after merging with v2-beta
2023-01-09 17:30:32 +05:30
Midhun G S
487252c5ea
Feature - Multi Environment support (#4833)
* initial commit

* multi env changes

* multi-env changes

* entity fixes

* data query changes

* fix

* trying to avoid conflict with EE

* moved version creation to app creation function

* fixing some issues

* execution of data query

* revert options changes

* changed migration

* fixed some migration issues: testing migration

* multi env support

* app import export fix

* fixes

* migration fixes

* removed plugins from data query

* fixing some migration issues

* fixes

* remove console log

* fix

* front end api changes

* backward compatibility for app import

* Fixed a bug

* correcting some mistakes

* Added constraints and fixed some issues

* changes

* fix for data source listing

* fixing version operation issues

* remove kind from data query

* removed kind from data query

* fixes

* fixes

* fix for version creation

* migration fixes

* Fixed preview and run query issues

* Fix: new version and event query id issue

* fixed rest api oauth issue
- next test refresh token

* import export changes

* fixes for app import

* import fix

* added await for for loops

* fix

* fix for migration

* Fixed backend oauth-envId issue

* import export changes

* migration fixes

* fix

* fix

* fix for app import from 0.9.0

* test case fixes

* test case fixes

* making app name mandatory for import

* adding type for options

* fix: imported apps query linking issues

* review changes

* lint issue fixes

* added on delete cascade

Co-authored-by: Muhsin Shah <muhsinshah21@gmail.com>
2022-12-09 20:23:42 +05:30
Akshay
cc516b9ddc
Feature: Versioned exports (#4140)
* add ability to export app versions

* remove console.log

* add spec

* [ Enhancement ]: Ability to export versioned apps ( frontend ) (#4271)

* added basic UI and functionality

* added functionality to export all versions or selected versions of app

* added UI

* refactored the code

* refactored code

* use custom hook for checking if component is mounted or not and accessing  darkMode from props

* showing current version first

* added spacing between container and input tag and input tag and text

* added cursor pointer on the version container

* removed use mount to avoid extra re-rendering component

* fixed typo request

* update permissions

* fix permissions

Co-authored-by: Manish Kushare <kushare.manish9@gmail.com>
2022-12-02 14:13:28 +05:30
John Bampton
ca5fe39751
all: fix spelling (#4326)
Fixes typos, fixes a file name.

Minor whitespace removal from link
2022-10-11 13:46:40 +05:30
Midhun G S
6fe5e874f8
Wrap DB queries inside manager to enable rollback (#3809)
* wrap DB queries inside manager

* test cases fix

* fixes

* tetscases fix
2022-08-18 13:22:03 +05:30
Muhsin Shah C P
dc8f69e4b2
[Feature] Organisation level environment variables 🚀 (#3068)
* Added new page for env vars

* Changed a field name

* Added some backend files
- Entity, Dto, services

* Started working with api endpoints
- implmented create
- added ability

* Added fields validation
- Added env variables into module

* Added update, delete, get apis
- Also implemented delete feature in frontend

* Implemented update operation on frontend
- Solved an api problem

* Added encryption

* Added encryption to update operation
- Exposed env vars to editor
- working on viewer

* Exposed env vars in viewer also
- Resolved a bug

* Updated edit & delete icon sizes

* Added specs
- Resolved issues that occurred while testing

* removed logout code

* Changed api endpoint

* splitted page into 3 different parts, Form & table

* Now, non-admin users can see all org env vars

* Resolved divider missing issue

* Added variable_type field

* Now secret server values will be shown as 'SecureValue'

* Now you can't update variable_type

* Now server will resolve the secret env values

* Resolved variable name issue

* Added unique constraints

* Resolved some frontend bugs

* Changed error text

* Fixed failing specs

* Added group permissions for org env vars

* Added permission checking in the backend

* Implemented permission checking in the frontend

* Edited spec for new changes

* Changed some specs and fixed failing specs

* Resolved failing case that showed up after merging with the latest develop

* Added default admin seed permissions

* Refactored some code

* Changed value to organization_id

* Fixed a bug

* Resolved a failing case

* Resolved PR changes
- Changed permission name
- Changed column type to enum
- Fixed some errors
- Refactored the code

* minor code change

* added scope

* Fixed: hide table when 0 no of vars available

* Fixed table dark theme issues

* Fixed encryption switch style

* Fixed failing cases and updated a spec

* Added %% for environment variables

* Added code to resolve single variable

* Fixed multi-variable usage

* resolved an issue

* removed extra divider

* Suggestions will also show up for %% too

* now, suggestions dropdown will only show env variables results

* env vars suggestions will not be included  in js search results

* You can't resolve env variables from js code
- Also, we can't resolve js code from env variable enclosures

* added an info text

* Resolved variables issue

* fixed Viewer issue

* Resolved a bug
- client variable was not working on query preview and run actions

* Update error message while using server variable on canvas

* Revert "Update error message while using server variable on canvas"

This reverts commit 081e1c9e29.

* Resolved all PR changes
- removed prefix 'environmentVariable'
- redefined variable evaluation
- removed environmentVariable object from inspector
- fixed a small bug

* Fixed a server side issue

Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
2022-07-01 16:20:37 +05:30
Midhun G S
0545528504
Support for multiple workspaces 🚀 (#2778)
* multi org changes

* Initial changes

* changes

* manage sso page

* Multi-organization changes

* Multi organization changes

* multi-org changes

* multi-org changes

* multi-org changes

* multi-org fixes

* env variables app.json changes

* multi-org-fix

* user invitation token fix

* multi-org group permission fix

* multi-org app privilege

* google oauth fix

* Remove enable signup for form login

* Multi organization fixes

* multi-org user invite flow changes

* multi-org sign up fix

* rebase and multi-org fixes

* revert testing logs

* test logs revert

* migration changes

* migration file fix

* error message changes

* git login for private email fix

* dropdown fix

* test cases

* e2e test cases added

* test cases fix

* documentation changes

* testcases fix

* testcases added

* replace findOne with findOneOrFail

* accept invite testcases

* login page fixes

* added encrypted tag

* review comments

* migration fixes

* improvements

* manage sso loading fix

* review comments

* migration file changes

* new organization creation bug fix

* added e2e testcases

* added testcases

* Update data_sources.controller.ts
2022-05-05 12:38:42 +05:30
Tanmoy Bhowmik
ad223e701f
Fix invalid error message for user group (#2964)
* fix(groupPermission): add check for uniqueness before creating the group

* fix(groupPermission): add test for the uniqueness of group permission group name
2022-05-04 16:28:02 +05:30
Maurits Lourens
93af7cedcb
Feature: Add remove from folder option to apps dashboard (#2333)
* Add remove from folder option to apps dashboard

* Add confirmation modal
2022-02-28 08:45:03 +05:30
Midhun G S
486b8625c3
[BUG-1941] typeorm findone fix (#1973)
* BUG-1941 typeorm fineOne fix

* e2e test case failure
2022-01-28 11:44:44 +05:30
Akshay
823833b12e
Feature: Versioning data sources & queries (#1620)
* add migrations for versioning datasources and dataqueries

* eslint migrations folder

* update ormconfig to use app context in migrations

* make app to make use versioned data sources and queries in editor

* app import should honor data source and query versioning

* register ts-node path on running migrations

* load data queries when finding versions

* update e2e tests

* handle for invalid oauth2 datasources

* update e2e tests

* introduce db migrations access lock to handle concurrent backfill

* scope migrations by missing version id

* fix import export without data source/query versions

* fix import

* fix spec

* handle invalid data on migration

* fix import

* remove console logs

* handle new app imports

* fix version check

* fix async creation

* explicitly add timestamps on version import
2022-01-04 13:34:12 +05:30
Akshay
533d518a72
fix specs (#1461) 2021-11-25 18:27:24 +05:30
Akshay
a7f36f77f6
Chore: Revise and add specs for folders (#1391)
* revise and add specs for folders

* Feature: Folder create permission (#1394)

* add migration for folder create permission

* add backfill migration for folder create permission on admin group

* adds permission for folder creation

* refactor function

* select distinct folders
2021-11-15 11:43:48 +05:30
Akshay
a958b37cef
Feature: Group level permissions and related fixes (#1204)
* add column app_create to group_permissions table

* add app create column to group permission entity

* backfill app_create permission as true for admin group

* add app delete permissions to group permissions

* update group permissions entity for app delete

* add ability to set group level permission for app creation

* refactor and fix app clone and imports

* fix created by user on homepage

* fix spinner on import

* update seeds service to set group level permission

* fix rollback query

* fix imported/cloned app timestamps

* honor logged in user permissions at UI

* remove console log

* fix data query id being replaced on import

* replace data query id within app versions on import
2021-10-25 14:05:32 +05:30
Akshay
b0208c553a
Feature: Add ability to import and export apps (#1138)
* add ability to import and export apps

* copy credentials on imports if it already exists

* authorize exports for public apps with only authenticated users

* remove app auth guard for export

* make import as a separate button

* update import button styling

* handle prexisting slug while import

* set file input as null when file has been read

* add fix for slug updation on import
2021-10-19 16:52:00 +05:30
Akshay
7023f72d1d
Feature: User access management 🔥 (#918)
* create migrations for group permissions setup

* define new entities and relationships

* revise migrations

* rename columns

* add migration to populate permission groups for existing users

* Feature: User access permission group usage (#883)

* create migrations for group permissions setup

* define new entities and relationships

* revise migrations

* rename columns

* add migration to populate permission groups for existing users

* revise migrations

* hide roles usage

* setup group permissions for apps and users

* fix defaultChecked

* fix update permission checkbox

* fix casl ability check to have params passed

* fix casl apps abilities to check with app specific permission

* add ability to delete groups

* conditionally render edit and delete options for all and admin users

* fix user role to group migration

* revise group management pages to disallow updating default group

* move manage users and groups to navbar dropdown

* show only addable apps and users on dropdowns

* rename header as profile settings

* scope addable apps and users by organization

* scope viewable apps on homepage

* hide manage groups link from non admins

* make permissions to be used with radio input

* add loading state for add apps/users buttons

* revise unit tests

* revise migrations

* fix e2e tests

* comment out dead code

* fix seeds script

* handle folder count

* captalize error toast

* hide manage users dropdown for non admins

* show fobidden error on blank homepage

* fix folder app count

* fix invalid state set

* make group name clickable for edit instead

* users with edit permission can deploy apps

* not show edit link on homepage if user dont have update permission

* remove unused entity from merge

* remove roles usage from manage org users page

* fix folder count and blank slate on homepage

* disable add buttons if there is no selections

* humanize default groups on view

* make app added onto groups have read permission by default

* not show app menu if user is not admin

* remove admin users from group user addition dropdown

* create default permissions for app cloned

* fix querying index page without page params

* fix admin scoped out from group add

* remove apps from header

* fix invitation url not shown

* scope admin deletion check by org

* scope public apps by organization

* add specs for group permissions e2e

* removed unused entity and add group permissions spec

* remove console logs

* remove unused permission

* scope public app count by org

* remove console log

* refactor manage group permission resources component

* update group permssion in org scope
2021-10-11 20:45:58 +05:30