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

Add geo trees to tree creation tool #5372

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
203 changes: 203 additions & 0 deletions specifyweb/frontend/js_src/lib/components/TreeView/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,168 @@ const subforma: Partial<SerializedResource<TaxonTreeDefItem>> = {
rankId: 270,
};

const rank1: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Rank1',
title: 'Rank 1',
isEnforced: true,
isInFullName: false,
rankId: 0,
};

const rank2: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Rank2',
title: 'Rank 2',
isEnforced: true,
isInFullName: false,
rankId: 10,
};

const rank3: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Rank3',
title: 'Rank 3',
isEnforced: true,
isInFullName: false,
rankId: 20,
};

const rank4: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Rank4',
title: 'Rank 4',
isEnforced: true,
isInFullName: false,
rankId: 30,
};

const rank5: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Rank5',
title: 'Rank 5',
isEnforced: true,
isInFullName: false,
rankId: 40,
};

const rank6: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Rank6',
title: 'Rank 6',
isEnforced: true,
isInFullName: false,
rankId: 50,
};

const level1: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level1',
title: 'Level 1',
isEnforced: true,
isInFullName: false,
rankId: 0,
};

const level2: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level2',
title: 'Level 2',
isEnforced: true,
isInFullName: false,
rankId: 10,
};

const level3: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level3',
title: 'Level 3',
isEnforced: true,
isInFullName: false,
rankId: 20,
};

const level4: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level4',
title: 'Level 4',
isEnforced: true,
isInFullName: false,
rankId: 30,
};

const level5: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level5',
title: 'Level 5',
isEnforced: true,
isInFullName: false,
rankId: 40,
};

const level6: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level6',
title: 'Level 6',
isEnforced: true,
isInFullName: false,
rankId: 50,
};

const level7: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level7',
title: 'Level 7',
isEnforced: true,
isInFullName: false,
rankId: 60,
};

const level8: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level8',
title: 'Level 8',
isEnforced: true,
isInFullName: false,
rankId: 70,
};

const level9: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level9',
title: 'Level 9',
isEnforced: true,
isInFullName: false,
rankId: 80,
};

const level10: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level10',
title: 'Level 10',
isEnforced: true,
isInFullName: false,
rankId: 90,
};

const level11: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level11',
title: 'Level 11',
isEnforced: true,
isInFullName: false,
rankId: 100,
};

const level12: Partial<SerializedResource<TaxonTreeDefItem>> = {
_tableName: 'TaxonTreeDefItem',
name: 'Level12',
title: 'Level 12',
isEnforced: true,
isInFullName: false,
rankId: 110,
};

export const botanyTreeDef: DeepPartial<SerializedResource<TaxonTreeDef>> = {
_tableName: 'TaxonTreeDef',
name: treeText.botany(),
Expand Down Expand Up @@ -495,6 +657,44 @@ export const vertpaleoTreeDef: DeepPartial<SerializedResource<TaxonTreeDef>> = {
],
};

export const mineralsTreeDef: DeepPartial<SerializedResource<TaxonTreeDef>> = {
_tableName: 'TaxonTreeDef',
name: treeText.minerals(),
remarks: treeText.defaultRemarks(),
fullNameDirection: 1,
treeDefItems: [rank1, rank2],
};

export const meteoritesTreeDef: DeepPartial<SerializedResource<TaxonTreeDef>> =
{
_tableName: 'TaxonTreeDef',
name: treeText.meteorites(),
remarks: treeText.defaultRemarks(),
fullNameDirection: 1,
treeDefItems: [rank1, rank2, rank3, rank4, rank5, rank6],
};

export const rocksTreeDef: DeepPartial<SerializedResource<TaxonTreeDef>> = {
_tableName: 'TaxonTreeDef',
name: treeText.rocks(),
remarks: treeText.defaultRemarks(),
fullNameDirection: 1,
treeDefItems: [
level1,
level2,
level3,
level4,
level5,
level6,
level7,
level8,
level9,
level10,
level11,
level12,
],
};

export const emptyTreeDef: DeepPartial<SerializedResource<TaxonTreeDef>> = {
_tableName: 'TaxonTreeDef',
name: treeText.emptyTree(),
Expand All @@ -517,5 +717,8 @@ export const defaultTreeDefs: RA<
paleobotTreeDef,
vascplantTreeDef,
vertpaleoTreeDef,
mineralsTreeDef,
rocksTreeDef,
meteoritesTreeDef,
emptyTreeDef,
];
9 changes: 9 additions & 0 deletions specifyweb/frontend/js_src/lib/localization/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,4 +582,13 @@ export const treeText = createDictionary({
emptyTree: {
'en-us': 'Empty Tree',
},
minerals: {
'en-us': 'Minerals',
},
rocks: {
'en-us': 'Rocks',
},
meteorites: {
'en-us': 'Meteorites',
},
} as const);
Loading