12 Commits

Author SHA1 Message Date
release-bot
8922c047dc Commit from GitHub Actions (Publishes a new version of the application) 2024-01-22 21:52:12 +00:00
release-bot
1b31faa1f5 [RELEASE]prepare for next development iteration 2024-01-22 21:50:26 +00:00
release-bot
67ce24e7e3 [RELEASE]prepare release 0.0.5 2024-01-22 21:50:25 +00:00
Sheldan
914db3d871 fixing not updating slots to update when an item was removed
fixing bank display
2024-01-22 22:48:35 +01:00
release-bot
02278b9e55 Commit from GitHub Actions (Publishes a new version of the application) 2024-01-22 21:15:06 +00:00
release-bot
ebe2d3c986 [RELEASE]prepare for next development iteration 2024-01-22 21:13:18 +00:00
release-bot
aaf93297b7 [RELEASE]prepare release 0.0.4 2024-01-22 21:13:16 +00:00
Sheldan
627e52776b adding handling of exceptions when the request fails (not a nice solution atm, as we do not actively wait for the request failure, but follow up errors)
passing through http codes from backend to frontend
fixing path to environments repository in tiltfile
2024-01-22 22:11:13 +01:00
Sheldan
b42f3cca24 adapting gitignore 2024-01-22 02:30:31 +01:00
Sheldan
cc3f071373 deleting target folder (again) 2024-01-22 02:30:00 +01:00
release-bot
5157d0ea6e Commit from GitHub Actions (Publishes a new version of the application) 2024-01-22 01:26:24 +00:00
release-bot
2e5bd84c07 [RELEASE]prepare for next development iteration 2024-01-22 01:24:37 +00:00
21 changed files with 104 additions and 75 deletions

2
.env
View File

@@ -1,2 +1,2 @@
REGISTRY_PREFIX=harbor.sheldan.dev/gw2/
VERSION=0.0.2
VERSION=0.0.5

5
.gitignore vendored
View File

@@ -1,6 +1,8 @@
# Compiled class file
*.class
.idea/
target/
*.iml
# Log file
*.log
@@ -32,5 +34,4 @@ replay_pid*
/gw2-tools-frontend/resources/index.html
/gw2-tools-frontend/resources/logo192.png
/tilt/gw2-tools-dev/Chart.lock
*/target/*
*.tgz

View File

@@ -32,8 +32,8 @@ docker_build(registry + 'gw2-tools-database', 'gw2-tools-backend/database/src/ma
local('cd tilt/gw2-tools-dev && helm dep up')
k8s_yaml(helm('tilt/gw2-tools-dev', values=[
'./../drr-environments/argocd/apps/gw2-tools/values/local/values.yaml',
'./../drr-environments/argocd/apps/gw2-tools/values/local/values.secrets.yaml'
'./../gw2-tools-environments/argocd/apps/gw2-tools/values/local/values.yaml',
'secrets://./../gw2-tools-environments/argocd/apps/gw2-tools/values/local/values.secrets.yaml'
]))
k8s_resource('backend', port_forwards='5005:5005', labels=['applications'])

View File

@@ -2,4 +2,4 @@ apiVersion: v2
name: gw2-tools
description: A Helm chart for Kubernetes
type: application
version: 0.0.2
version: 0.0.5

View File

@@ -8,7 +8,7 @@ backend:
pullPolicy: Always
image: gw2-tools-backend
# Overrides the image tag whose default is the chart appVersion.
tag: 0.0.1
tag:
debug:
enabled: true
port: 5005
@@ -73,7 +73,7 @@ dbDeployment:
image:
repository: harbor.sheldan.dev/gw2
image: gw2-tools-database
tag: 0.0.1
tag:
pullPolicy: Always
cacheJob:
@@ -101,7 +101,7 @@ frontend:
pullPolicy: IfNotPresent
image: gw2-tools-frontend
# Overrides the image tag whose default is the chart appVersion.
tag: 0.0.1
tag:
port: 8080
service:
type: ClusterIP

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.gw2.tools</groupId>
<artifactId>gw2-tools</artifactId>
<version>0.0.3</version>
<version>0.0.6-SNAPSHOT</version>
</parent>
<artifactId>database</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.gw2.tools</groupId>
<artifactId>gw2-tools</artifactId>
<version>0.0.3</version>
<version>0.0.6-SNAPSHOT</version>
</parent>
<artifactId>executable</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.gw2.tools</groupId>
<artifactId>gw2-tools</artifactId>
<version>0.0.3</version>
<version>0.0.6-SNAPSHOT</version>
</parent>
<artifactId>gw2-api-client</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.gw2.tools</groupId>
<artifactId>gw2-tools</artifactId>
<version>0.0.3</version>
<version>0.0.6-SNAPSHOT</version>
</parent>
<artifactId>packaging</artifactId>

View File

@@ -9,7 +9,7 @@
</parent>
<groupId>dev.sheldan.gw2.tools</groupId>
<artifactId>gw2-tools</artifactId>
<version>0.0.3</version>
<version>0.0.6-SNAPSHOT</version>
<packaging>pom</packaging>
<name>gw2-tools</name>
<description>Tools for GW2</description>
@@ -25,7 +25,7 @@
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<url>https://github.com/Sheldan/gw2-tools.git</url>
<tag>0.0.3</tag>
<tag>HEAD</tag>
</scm>
<distributionManagement>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.gw2.tools</groupId>
<artifactId>gw2-tools</artifactId>
<version>0.0.3</version>
<version>0.0.6-SNAPSHOT</version>
</parent>
<artifactId>rest-api</artifactId>

View File

@@ -51,8 +51,8 @@ def get_account_characters():
api_key = request.headers.get(api_key_header_name)
headers = {'api-key': api_key}
logging.info("Loading characters")
inventory_response = requests.get(f'{characters_url}', headers=headers)
return inventory_response.text
characters_response = requests.get(f'{characters_url}', headers=headers)
return characters_response.text, characters_response.status_code
@app.route('/inventory/')
@@ -62,7 +62,7 @@ def get_account_inventory():
headers = {'api-key': api_key}
logging.info("Rendering inventory of full account")
inventory_response = requests.get(f'{inventory_url}', headers=headers)
text = inventory_response.text
text = inventory_response.text, inventory_response.status_code
return text
@@ -73,7 +73,7 @@ def get_account_wallet():
headers = {'api-key': api_key}
logging.info("Rendering wallet of account")
wallet_response = requests.get(f'{wallet_url}', headers=headers)
return wallet_response.text
return wallet_response.text, wallet_response.status_code
@app.route('/bank/')
@@ -83,7 +83,7 @@ def get_account_bank():
headers = {'api-key': api_key}
logging.info("Rendering bank of account")
bank_response = requests.get(f'{bank_url}', headers=headers)
return bank_response.text
return bank_response.text, bank_response.status_code
@app.route('/materials/')
@@ -93,7 +93,7 @@ def get_materials():
headers = {'api-key': api_key}
logging.info("Rendering materials of account")
materials_response = requests.get(f'{materials_url}', headers=headers)
return materials_response.text
return materials_response.text, materials_response.status_code
@app.route('/sharedInventory/')
@@ -103,7 +103,7 @@ def get_shared_inventory():
headers = {'api-key': api_key}
logging.info("Rendering shared inventory of account")
shared_inventory_response = requests.get(f'{shared_inventory_url}', headers=headers)
return shared_inventory_response.text
return shared_inventory_response.text, shared_inventory_response.status_code
@app.route('/submissionTemplates/')
@@ -111,14 +111,14 @@ def get_submission_templates():
logging.info("Rendering submission templates")
parameters_query = request.query_string.decode()
submission_templates_response = requests.get(f'{submission_templates_url}?{parameters_query}')
return submission_templates_response.text
return submission_templates_response.text, submission_templates_response.status_code
@app.route('/itemRates/')
def get_item_rates():
logging.info("Rendering item rates")
item_rates_response = requests.get(f'{itemRates_url}')
return item_rates_response.text
return item_rates_response.text, item_rates_response.status_code
@app.route('/openings/', methods=['POST'])
@@ -128,7 +128,7 @@ def create_opening():
headers = {'api-key': api_key, 'Content-Type': 'application/json'}
logging.info("Creating opening")
openings_response = requests.post(f'{openings_url}', body, headers=headers)
return openings_response.text
return openings_response.text, openings_response.status_code
@app.route('/openings/', methods=['GET'])
@@ -138,7 +138,7 @@ def get_openings():
headers = {'api-key': api_key}
logging.info("Loading openings")
bank_response = requests.get(f'{openings_url}?{parameters_query}', headers=headers)
return bank_response.text
return bank_response.text, bank_response.status_code
@app.route('/openings/<opening_id>', methods=['DELETE'])
@@ -147,7 +147,7 @@ def delete_opening(opening_id):
headers = {'api-key': api_key}
logging.info(f"Deleting opening {opening_id}")
bank_response = requests.delete(f'{openings_url}/{opening_id}', headers=headers)
return bank_response.text
return bank_response.text, bank_response.status_code
@app.route('/inventory/<character_name>/')
@@ -157,7 +157,7 @@ def get_character_inventory(character_name):
headers = {'api-key': api_key}
logging.info("rendering inventory of individual character.")
inventory_response = requests.get(f'{inventory_url}/{character_name}', headers=headers)
return inventory_response.text
return inventory_response.text, inventory_response.status_code
if __name__ == "__main__":

View File

@@ -1,11 +1,11 @@
{
"name": "drr-ui",
"version": "0.0.2",
"version": "0.0.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.0.2",
"version": "0.0.5",
"dependencies": {
"@reduxjs/toolkit": "^2.0.1",
"@testing-library/jest-dom": "^5.17.0",

View File

@@ -1,6 +1,6 @@
{
"name": "gw2-tools-ui",
"version": "0.0.2",
"version": "0.0.5",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^2.0.1",

View File

@@ -24,13 +24,13 @@ export function Bank() {
const removedItems =
<>
{displayAdded ? <span className={styles.spanNewLine}>Removed items</span> : ''}
{displayRemoved ? <span className={styles.spanNewLine}>Removed items</span> : ''}
{bank.removedSlots.map((item) => <InventoryItem item={item}/>)}
</>
const addedItems =
<>
{displayRemoved ? <span className={styles.spanNewLine}>Added Items</span> : ''}
{displayAdded ? <span className={styles.spanNewLine}>Added Items</span> : ''}
{bank.addedSlots.map((item) => <InventoryItem item={item}/>)}
</>
@@ -42,19 +42,23 @@ export function Bank() {
async function reloadBank() {
setBankLoading(true)
const bankSlots = await fetchBank();
if(!config.locked) {
const bankState = {
slots: bankSlots,
addedSlots: [],
removedSlots: []
try {
const bankSlots = await fetchBank();
if(!config.locked) {
const bankState = {
slots: bankSlots,
addedSlots: [],
removedSlots: []
}
dispatch(setBank(bankState))
} else {
const [slotsToAdd, slotsToRemove, slotsToUpdate] = calculateBankDifferences(bank, bankSlots, config.mocking);
dispatch(setRemovedBankSlots(slotsToRemove))
dispatch(setAddedBankSlots(slotsToAdd))
dispatch(updateChangedBankSlots(slotsToUpdate))
}
dispatch(setBank(bankState))
} else {
const [slotsToAdd, slotsToRemove, slotsToUpdate] = calculateBankDifferences(bank, bankSlots, config.mocking);
dispatch(setRemovedBankSlots(slotsToRemove))
dispatch(setAddedBankSlots(slotsToAdd))
dispatch(updateChangedBankSlots(slotsToUpdate))
} catch (e) {
console.log(e)
}
setBankLoading(false)
}

View File

@@ -82,8 +82,12 @@ export const CharacterInventory = ({character}) => {
async function updateCharacter() {
setCharacterLoading(true)
await reloadCharacterInventory();
await reloadWallet();
try {
await reloadCharacterInventory();
await reloadWallet();
} catch (e) {
console.log(e)
}
setCharacterLoading(false)
}

View File

@@ -123,11 +123,15 @@ export function ItemDifference() {
async function fetchInformation() {
dispatch(setLoading(true))
await updateWallet()
await updateBank()
await updateMaterials()
await updatedSharedInventory()
await updateInventoryCharacterSpecific()
try {
await updateWallet()
await updateBank()
await updateMaterials()
await updatedSharedInventory()
await updateInventoryCharacterSpecific()
} catch (e) {
console.log(e)
}
dispatch(setLoading(false))
}

View File

@@ -48,21 +48,26 @@ export function Materials() {
async function reloadMaterials() {
setMaterialsLoading(true)
const materialSlots = await fetchMaterials();
if(!config.locked) {
const materialsState = {
slots: materialSlots,
addedSlots: [],
removedSlots: []
}
dispatch(setMaterials(materialsState))
} else {
const [slotsToAdd, slotsToRemove, slotsToUpdate] = calculateMaterialsDifference(materials, materialSlots, config.mocking);
try {
const materialSlots = await fetchMaterials();
if(!config.locked) {
const materialsState = {
slots: materialSlots,
addedSlots: [],
removedSlots: []
}
dispatch(setMaterials(materialsState))
} else {
const [slotsToAdd, slotsToRemove, slotsToUpdate] = calculateMaterialsDifference(materials, materialSlots, config.mocking);
dispatch(setRemovedMaterialSlots(slotsToRemove))
dispatch(setAddedMaterialSlots(slotsToAdd))
dispatch(updateChangedMaterialSlots(slotsToUpdate))
dispatch(setRemovedMaterialSlots(slotsToRemove))
dispatch(setAddedMaterialSlots(slotsToAdd))
dispatch(updateChangedMaterialSlots(slotsToUpdate))
}
} catch (e) {
console.log(e)
}
setMaterialsLoading(false)
}

View File

@@ -107,12 +107,16 @@ export function OpeningSubmission() {
async function submitOpening() {
dispatch(setLoading(true))
const submissionBody = {}
submissionBody.items = getChanges();
submissionBody.description = openingDescription;
await fetcher("openings", {apiKey: apiKey, method: "POST", body: JSON.stringify(submissionBody), headers: {"Content-Type": "application/json"}})
setOpeningDescription("")
toast('Opening has been submitted.')
try {
const submissionBody = {}
submissionBody.items = getChanges();
submissionBody.description = openingDescription;
await fetcher("openings", {apiKey: apiKey, method: "POST", body: JSON.stringify(submissionBody), headers: {"Content-Type": "application/json"}})
setOpeningDescription("")
toast('Opening has been submitted.')
} catch (e) {
console.log(e)
}
dispatch(setLoading(false))
}

View File

@@ -72,9 +72,13 @@ export function OpeningOverview() {
}
async function loadOpenings() {
setOpeningsLoading(true)
const openings = await fetchOpenings();
dispatch(setOpenings(openings))
try {
setOpeningsLoading(true)
const openings = await fetchOpenings();
dispatch(setOpenings(openings))
} catch (e) {
console.log(e)
}
setOpeningsLoading(false)
}

View File

@@ -144,6 +144,7 @@ export function calculateBankDifferences(existingBank, incomingBankSlots, mockin
count: 0,
changed: -slot.count
})
slotsToUpdate[slot.id] = -slot.count
}
})
return [slotsToAdd, slotsToRemove, slotsToUpdate];
@@ -187,6 +188,7 @@ export function calculateSharedInventoryDifferences(existingSharedInventory, inc
count: 0,
changed: -slot.count
})
slotsToUpdate[slot.id] = -slot.count
}
})
return [slotsToAdd, slotsToRemove, slotsToUpdate];
@@ -230,6 +232,7 @@ export function calculateMaterialsDifference(materials, materialSlots, mocking)
count: 0,
changed: -slot.count
})
slotsToUpdate[slot.id] = -slot.count
}
})
return [slotsToAdd, slotsToRemove, slotsToUpdate];