Skip to content

Commit

Permalink
BASIRA #254 - Updating documents "text_columns" to default to "0" and…
Browse files Browse the repository at this point in the history
… non-nullable; Updating react-components packages to latest versions
  • Loading branch information
dleadbetter committed Nov 27, 2024
1 parent fe8814c commit e7f85aa
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 934 deletions.
6 changes: 4 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dependencies": {
"@babel/eslint-parser": "^7.21.3",
"@babel/runtime": "^7.22.3",
"@performant-software/semantic-components": "^1.0.25",
"@performant-software/shared-components": "^1.0.25",
"@performant-software/semantic-components": "^2.2.17-beta.0",
"@performant-software/shared-components": "^2.2.17-beta.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
Expand All @@ -17,6 +17,8 @@
"instantsearch.js": "^4.56.1",
"rc-slider": "^10.2.0",
"react": "^18.2.0",
"react-dnd": "^11.1.3",
"react-dnd-html5-backend": "^11.1.3",
"react-dom": "^18.2.0",
"react-i18next": "^11.8.13",
"react-instantsearch-hooks-web": "^6.47.3",
Expand Down
4 changes: 2 additions & 2 deletions client/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"simulatedScript": "Simulated Script",
"size": "Size",
"spineFeatures": "Spine Features",
"textColumns": "Text Columns",
"textColumns": "Number of Text Columns Visible",
"textTechnology": "Text Technology",
"transcriptionDiplomatic": "Transcription: Diplomatic",
"transcriptionExpanded": "Transcription: Expanded",
Expand Down Expand Up @@ -513,7 +513,7 @@
"simulatedScript": "Simulated Script",
"size": "Size",
"spineFeatures": "Spine Features",
"textColumns": "Text Columns",
"textColumns": "Number of Text Columns Visible",
"textTechnology": "Text Technology",
"uncutForeEdges": "Uncut Fore-Edges",
"visualContext": {
Expand Down
4 changes: 2 additions & 2 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import App from './App';
import './config/Api';
import './i18n/i18n';

import '@performant-software/semantic-components/build/semantic-ui.css';
import '@performant-software/semantic-components/build/main.css';
import '@performant-software/semantic-components/style.css';
import '@performant-software/shared-components/style.css';
import 'rc-slider/assets/index.css';
import './index.css';

Expand Down
3 changes: 2 additions & 1 deletion client/src/pages/admin/Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,11 @@ const Document = (props: Props) => {
required={props.isRequired('text_columns')}
>
<Dropdown
defaultValue={0}
onChange={props.onTextInputChange.bind(this, 'text_columns')}
options={zeroToTenRangeOptionsList}
selection
value={props.item.text_columns || ''}
value={props.item.text_columns}
/>
</Form.Input>
<ValueListDropdown
Expand Down
948 changes: 25 additions & 923 deletions client/yarn.lock

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions db/data/20241127010852_reset_document_text_columns.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

class ResetDocumentTextColumns < ActiveRecord::Migration[7.0]
def up
execute <<-SQL.squish
UPDATE documents
SET text_columns = 0
WHERE text_columns IS NULL
OR text_columns = 1;
SQL
end

def down
raise ActiveRecord::IrreversibleMigration
end
end
3 changes: 1 addition & 2 deletions db/data_schema.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# encoding: UTF-8
DataMigrate::Data.define(version: 20230404203137)
DataMigrate::Data.define(version: 20241127010852)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChangeDocumentsTextColumnsDefaultValue < ActiveRecord::Migration[7.0]
def change
change_column :documents, :text_columns, :integer, null: false, default: 0
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_06_26_153029) do
ActiveRecord::Schema[7.0].define(version: 2024_11_27_011227) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "plpgsql"
Expand Down Expand Up @@ -121,7 +121,7 @@
t.boolean "uncut_fore_edges", default: false, null: false
t.text "fore_edge_text"
t.integer "bookmarks_registers", default: 0
t.integer "text_columns", default: 1
t.integer "text_columns", default: 0, null: false
t.boolean "ruling", default: false, null: false
t.boolean "rubrication", default: false, null: false
t.text "identity"
Expand Down

0 comments on commit e7f85aa

Please sign in to comment.