diff --git a/backend/api/serializers/character.py b/backend/api/serializers/character.py index a672d426..d89ba413 100644 --- a/backend/api/serializers/character.py +++ b/backend/api/serializers/character.py @@ -3,6 +3,7 @@ """ # stdlib from re import compile +from typing import Dict, List, Union # lib from rest_framework import serializers # local @@ -21,6 +22,7 @@ class CharacterCollectionSerializer(serializers.ModelSerializer): alias = serializers.CharField(allow_blank=True, required=False) proxy = serializers.SerializerMethodField() user_id = serializers.IntegerField(required=False) + bis_lists = serializers.SerializerMethodField() class Meta: model = Character @@ -33,6 +35,18 @@ def get_proxy(self, char: Character) -> bool: """ return char.user is None + def get_bis_lists(self, char: Character) -> List[Dict[str, Union[str, int]]]: + """ + Return summaries of bis lists + """ + return [ + { + 'id': bis.id, + 'name': bis.name if bis.name != '' else bis.job.display_name, + } + for bis in char.bis_lists.all() + ] + def validate_world(self, world: str) -> str: """ Handle the new format for world and DC that seems to be cropping up diff --git a/backend/api/tests/test_character.py b/backend/api/tests/test_character.py index f73fa334..170637ec 100644 --- a/backend/api/tests/test_character.py +++ b/backend/api/tests/test_character.py @@ -94,6 +94,7 @@ def test_create(self): data['user_id'] = self._get_user().id data['alias'] = '' data['proxy'] = False + data['bis_lists'] = [] obj_data = CharacterCollectionSerializer(char).data self.assertDictEqual(data, obj_data) diff --git a/backend/api/tests/test_team_proxy.py b/backend/api/tests/test_team_proxy.py index 571a0c78..fabe8959 100644 --- a/backend/api/tests/test_team_proxy.py +++ b/backend/api/tests/test_team_proxy.py @@ -547,6 +547,7 @@ def setUp(self): # Lastly, link the characters to the team self.tm = self.team.members.create(character=self.char, bis_list=self.tl_main_bis, lead=True) self.proxy_tm = self.team.members.create(character=self.proxy, bis_list=self.proxy_bis, lead=False) + self.proxy.refresh_from_db() # Map gear names to ids for ease self.gear_id_map = {g.name: g.id for g in Gear.objects.all()} @@ -575,7 +576,7 @@ def test_create(self): old_data = CharacterCollectionSerializer(instance=self.proxy).data # Remove changed keys - for key in ['proxy', 'user_id', 'id']: + for key in ['proxy', 'user_id', 'id', 'bis_lists']: new_data.pop(key) old_data.pop(key) diff --git a/backend/backend/settings_live.py b/backend/backend/settings_live.py index 5218af2f..1dee9569 100644 --- a/backend/backend/settings_live.py +++ b/backend/backend/settings_live.py @@ -184,7 +184,7 @@ def sampler(context): # If you wish to associate users to errors (assuming you are using # django.contrib.auth) you may enable sending PII data. send_default_pii=True, - release='savageaim@20231207', + release='savageaim@20231227', ) # Channels diff --git a/frontend/.env b/frontend/.env index 151f65db..5a645f10 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1 +1 @@ -VUE_APP_VERSION="20231207" +VUE_APP_VERSION="20231227" diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 94f167e6..02475f96 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -14,6 +14,7 @@ "bulma": "^0.9.3", "dayjs": "^1.10.7", "lodash.isequal": "^4.5.0", + "match-sorter": "^6.3.1", "microtip": "^0.2.2", "multi-range-slider-vue": "^1.1.4", "nouislider": "^15.7.0", @@ -24,6 +25,7 @@ "vue-notification": "^1.3.20", "vue-property-decorator": "^9.1.2", "vue-router": "^3.5.2", + "vue-shortkey": "^3.1.7", "vuex": "^3.6.2" }, "devDependencies": { @@ -167,6 +169,17 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/runtime": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.6.tgz", + "integrity": "sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@creativebulma/bulma-badge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@creativebulma/bulma-badge/-/bulma-badge-1.0.1.tgz", @@ -4422,6 +4435,11 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "node_modules/custom-event-polyfill": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz", + "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==" + }, "node_modules/cyclist": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.2.tgz", @@ -5065,6 +5083,11 @@ "integrity": "sha512-AUYh0XDTb2vrj0rj82jb3P9hHSyzQNdTPYWZIhPdCOui7/vpme7+HTE07BE5jwuqg/34TZ8ktlRz6GImJ4IXjA==", "dev": true }, + "node_modules/element-matches": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/element-matches/-/element-matches-0.1.2.tgz", + "integrity": "sha512-yWh1otcs3OKUWDvu/IxyI36ZI3WNaRZlI0uG/DK6fu0pap0VYZ0J5pEGTk1zakme+hT0OKHwhlHc0N5TJhY6yQ==" + }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -9268,6 +9291,15 @@ "node": ">=0.10.0" } }, + "node_modules/match-sorter": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/match-sorter/-/match-sorter-6.3.1.tgz", + "integrity": "sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw==", + "dependencies": { + "@babel/runtime": "^7.12.5", + "remove-accents": "0.4.2" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -12216,6 +12248,11 @@ "node": ">=8" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, "node_modules/regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -12267,6 +12304,11 @@ "node": ">= 0.10" } }, + "node_modules/remove-accents": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.2.tgz", + "integrity": "sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA==" + }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -15786,6 +15828,15 @@ "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz", "integrity": "sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ==" }, + "node_modules/vue-shortkey": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/vue-shortkey/-/vue-shortkey-3.1.7.tgz", + "integrity": "sha512-Wm/vPXXS+4Wl/LoYpD+cZc0J0HIoVlY8Ep0JLIqqswmAya3XUBtsqKbhzEf9sXo+3rZ5p1YsUyZfXas8XD7YjQ==", + "dependencies": { + "custom-event-polyfill": "^1.0.7", + "element-matches": "^0.1.2" + } + }, "node_modules/vue-style-loader": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index be45899a..a3dc941c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ "bulma": "^0.9.3", "dayjs": "^1.10.7", "lodash.isequal": "^4.5.0", + "match-sorter": "^6.3.1", "microtip": "^0.2.2", "multi-range-slider-vue": "^1.1.4", "nouislider": "^15.7.0", @@ -24,6 +25,7 @@ "vue-notification": "^1.3.20", "vue-property-decorator": "^9.1.2", "vue-router": "^3.5.2", + "vue-shortkey": "^3.1.7", "vuex": "^3.6.2" }, "devDependencies": { diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6b65b334..5f9d2506 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,8 +1,8 @@ diff --git a/frontend/src/components/modals/legend.vue b/frontend/src/components/modals/legend.vue deleted file mode 100644 index 3ff3225f..00000000 --- a/frontend/src/components/modals/legend.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/frontend/src/components/modals/switcher.vue b/frontend/src/components/modals/switcher.vue new file mode 100644 index 00000000..4e7fe97c --- /dev/null +++ b/frontend/src/components/modals/switcher.vue @@ -0,0 +1,166 @@ + + + + + diff --git a/frontend/src/components/nav.vue b/frontend/src/components/nav.vue index 22d545f4..cc4cc7af 100644 --- a/frontend/src/components/nav.vue +++ b/frontend/src/components/nav.vue @@ -27,15 +27,17 @@