Skip to content

Commit

Permalink
Merge branch 'develop' into architectural_overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
mathemancer committed May 10, 2024
2 parents ddab8b9 + 3e27342 commit 08e5352
Show file tree
Hide file tree
Showing 574 changed files with 3,734 additions and 2,493 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/reset-demo.yml
@@ -0,0 +1,51 @@
name: Reset demo

on:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: '1,9,17,30,45 6,7,8 * * *'


env:
PROJECT_ID: ${{ secrets.GKE_PROJECT_ID }}
GKE_CLUSTER: mathesar-demo
GKE_ZONE: us-central1


jobs:
reset:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: GCP login
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GKE_DEMO_RESET_SA_KEY }}'

- name: Set up GKE credentials
uses: 'google-github-actions/get-gke-credentials@v0'
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}

- name: Delete existing demo deployment
run: kubectl delete deployments.apps demo-serve

- name: Wait until all pods are removed
run: >-
attempts=10
until [ $attempts -le 0 ] || [ -z "$(kubectl get pods)" ]; do
sleep 5
attempts=$((attempts - 1))
done
if [ $attempts -le 0 ]; then
return 1
fi
- name: Deploy demo
run: kubectl apply -f ./kubernetes_manifests/mathesar-demo.yml
21 changes: 20 additions & 1 deletion DEVELOPER_GUIDE.md
Expand Up @@ -49,7 +49,26 @@ Before getting started with your code changes, read our [Contributor guide](./CO

## Loading sample data

For sample table data, you can create a new table in the UI using the `patents.csv` file found in `/mathesar/tests/data`.
- Using a CSV File (limited visibility of features):

For sample table data, you can create a new table in the UI using the `patents.csv` file found in `/mathesar/tests/data`.

- Using Mathesar Data Playground (recommended):

1. Clone the `mathesar-data-playground` repo:
```
git clone https://github.com/mathesar-foundation/mathesar-data-playground.git
```

2. Load the data from sql by running:
```
sudo docker exec -i mathesar_dev_db bash -c 'psql -U mathesar' < /path/to/your/cloned/repo/mathesar-data-playground/realistic_library_simulation/simulation_runs/simulation_run_20230106_00.sql
```
```
sudo docker exec -i mathesar_dev_db bash -c 'psql -U mathesar' < /path/to/your/cloned/repo/mathesar-data-playground/realistic_library_simulation/simulation_runs/simulation_run_20230106_00_checkouts.sql
```
3. [Sync]( https://docs.mathesar.org/user-guide/syncing-db/) these changes from the UI.


<!-- TODO add more content about sample data -->

Expand Down
5 changes: 3 additions & 2 deletions db/records/operations/relevance.py
@@ -1,5 +1,6 @@
from sqlalchemy import case, select, desc
from db.types import categories
from db.types.base import MathesarCustomType
from db.types.operations.convert import get_db_type_enum_from_class

WEIGHT_4 = 4
Expand Down Expand Up @@ -37,8 +38,8 @@ def _get_scored_selectable(relation, parameters_dict):

def _get_col_score_expr(col, param_val):
col_type = get_db_type_enum_from_class(col.type.__class__)

if col_type in categories.STRING_LIKE_TYPES:
searchable_string_types = categories.STRING_LIKE_TYPES | frozenset([MathesarCustomType.URI, MathesarCustomType.EMAIL])
if col_type in searchable_string_types:
score_expr = case(
(col.ilike(param_val), WEIGHT_4),
(col.ilike(param_val + '%'), WEIGHT_3),
Expand Down
2 changes: 0 additions & 2 deletions db/types/categories.py
Expand Up @@ -10,8 +10,6 @@
*STRING_TYPES,
PostgresType.CHAR,
PostgresType.NAME,
MathesarCustomType.URI,
MathesarCustomType.EMAIL,
})

INTEGER_TYPES = frozenset({
Expand Down
6 changes: 0 additions & 6 deletions db/types/operations/cast.py
Expand Up @@ -44,7 +44,6 @@ def get_column_cast_expression(column, target_type, engine, type_options=None):

def install_all_casts(engine):
create_boolean_casts(engine)
create_date_casts(engine)
create_decimal_number_casts(engine)
create_email_casts(engine)
create_integer_casts(engine)
Expand All @@ -64,11 +63,6 @@ def create_boolean_casts(engine):
create_cast_functions(PostgresType.BOOLEAN, type_body_map, engine)


def create_date_casts(engine):
type_body_map = _get_date_type_body_map()
create_cast_functions(PostgresType.DATE, type_body_map, engine)


def create_json_casts(engine):
json_types = categories.JSON_TYPES
for db_type in json_types:
Expand Down
48 changes: 48 additions & 0 deletions docs/docs/releases/0.1.7.md
@@ -0,0 +1,48 @@
# Mathesar 0.1.7

## Summary

Mathesar 0.1.7 introduces linked table navigation from the data cell context menu. This release also fixes the regeneration of exploration share URLs and removes the 'group' suffix in the Data Explorer column names.

_This page provides a comprehensive list of all changes in the release._

## Upgrading to 0.1.7

See our guide on [upgrading Mathesar to 0.1.7](../administration/upgrade/0.1.7.md).

## Improvements

### Linked Table Navigation from Cell Context Menu

Users can now navigate to linked tables from the cell context menu, providing a more seamless experience when working with linked data.

![image](https://github.com/mathesar-foundation/mathesar/assets/845767/3015b1e8-7038-41b3-a9ec-59a4d55780d0)

_[#3526](https://github.com/mathesar-foundation/mathesar/pull/3526 " Navigate to linked table via cell context menu ")_

## Bug fixes

### Fixed Regeneration of Exploration Share URL

Fixed an issue where clicking "Regenerate Link" for a shared exploration failed to create a new URL and resulted in a 404 API request. Now, users will see a successful API call with a new, regenerated share URL.

_[#3521](https://github.com/mathesar-foundation/mathesar/pull/3521 "Fix regeneration of exploration share URL")_

### Remove 'group' Suffix in Data Explorer

Resolved an issue in the Data Explorer where the grouping column name was incorrectly suffixed with 'group'. Now, the original column names are preserved when summarizing data.

_[#3357](https://github.com/mathesar-foundation/mathesar/pull/3357 "Removed the 'group' suffix in Data Explorer")_

## Documentation

- Upgrade Instructions for 0.1.7 _[#3534](https://github.com/mathesar-foundation/mathesar/pull/3534 "Upgrade instructions for 0.1.7")_

## Maintenance

- Bump Django from 4.2.10 to 4.2.11 _[#3496](https://github.com/mathesar-foundation/mathesar/pull/3496 "Bump django from 4.2.10 to 4.2.11")_
- Made Release Notes Script Portable _[#3529](https://github.com/mathesar-foundation/mathesar/pull/3529 "Made release notes script portable.")_
- Removed Stray Changes Post Script Update _[#3530](https://github.com/mathesar-foundation/mathesar/pull/3530 "Removed stray change left over from #3529")_
- Integrated Changes from Previous Release Preparation _[#3517](https://github.com/mathesar-foundation/mathesar/pull/3517 "Merge pull request #3494 from mathesar-foundation/0.1.6")_
- Added Demo Target in Dockerfile for Future Deployments _[#3523](https://github.com/mathesar-foundation/mathesar/pull/3523 "Add demo target to Dockerfile")_
- New RPC Endpoint Implementation for Superuser Functions _[#3524](https://github.com/mathesar-foundation/mathesar/pull/3524 "Modern rpc prototype")_
2 changes: 2 additions & 0 deletions docs/docs/releases/README.md
Expand Up @@ -23,5 +23,7 @@ This is developer documentation to help with release notes. It is not published

1. Open the release notes file and find a new section at the end titled **(TO CATEGORIZE)**. Incorporate PRs listed within this section into the release notes as you see fit. Rewrite the title text that appears directly in the markdown. Leave the titles as-written within the quotes (these will appear within hover text). Save the release notes and commit them.

1. Edit `mkdocs.yml`, adding the newly-generated release notes file to the nav menu.

1. Re-run the script as needed.

3 changes: 2 additions & 1 deletion docs/mkdocs.yml
Expand Up @@ -31,6 +31,7 @@ nav:
- REST: api/rest.md
- RPC: api/rpc.md
- Releases:
- '0.1.7': releases/0.1.7.md
- '0.1.6': releases/0.1.6.md
- '0.1.5': releases/0.1.5.md
- '0.1.4': releases/0.1.4.md
Expand Down Expand Up @@ -116,4 +117,4 @@ markdown_extensions:
permalink: true

extra:
mathesar_version: 0.1.6
mathesar_version: 0.1.7
2 changes: 1 addition & 1 deletion mathesar/__init__.py
@@ -1,3 +1,3 @@
default_app_config = 'mathesar.apps.MathesarConfig'

__version__ = "0.1.6"
__version__ = "0.1.7"
30 changes: 30 additions & 0 deletions mathesar_ui/.eslintrc.cjs
Expand Up @@ -6,6 +6,7 @@ module.exports = {
'dist',
'index.html',
'src/**/*.stories.svelte',
'*.cjs',
],
parserOptions: {
tsconfigRootDir: __dirname,
Expand All @@ -22,6 +23,9 @@ module.exports = {
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:svelte/recommended',
'plugin:svelte/prettier',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
rules: {
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
Expand All @@ -44,6 +48,32 @@ module.exports = {
'no-restricted-syntax': 0,
'@typescript-eslint/require-await': 'off',
'class-methods-use-this': 'off',
'no-multiple-empty-lines': 1,
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
orderImportKind: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
},
],
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
},
overrides: [
{
Expand Down
10 changes: 10 additions & 0 deletions mathesar_ui/README.md
Expand Up @@ -95,6 +95,16 @@ We use [ESLint](https://eslint.org/) to help spot more complex issues within cod
docker exec -it -w /code/mathesar_ui mathesar_service_dev npx eslint src/App.svelte
```

### Auto-fixing linting errors

ESLint can fix some errors automatically. In particular, we rely on ESLint to auto-sort our JavaScript import statements, so if you don't auto-fix your linting errors before submitting a PR, you're likely to get some CI errors in your PR which complain about out-of-order import statements.

- Auto-fix all possible linting errors:

```
docker exec -it -w /code/mathesar_ui mathesar_service_dev npm run lint-fix
```

## Testing

### Integration tests
Expand Down

0 comments on commit 08e5352

Please sign in to comment.