Compare commits

...

2 Commits

Author SHA1 Message Date
Brieuc Dubois cc7862b0d4 Fix real-time sync for projectTagOption 2024-01-24 01:29:41 +01:00
Brieuc Dubois d5feb492e1 Fix Menu z-index 2024-01-24 01:08:58 +01:00
3 changed files with 8 additions and 10 deletions

View File

@ -34,6 +34,7 @@
<style lang="less"> <style lang="less">
.menu { .menu {
z-index: 100;
position: absolute; position: absolute;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -177,7 +177,7 @@ export default class ProjectTag {
parseOptionUpdate(json: any) { parseOptionUpdate(json: any) {
if (!json) return; if (!json) return;
const option = this._options.find((option) => option.id === json.id); const option = this._options.find((option) => option.id === json.option_id);
if (!option) return; if (!option) return;
option.parseUpdate(json); option.parseUpdate(json);

View File

@ -221,18 +221,15 @@ function applyProjectTag(data: any) {
} }
function applyProjectTagOption(data: any) { function applyProjectTagOption(data: any) {
const projectTag = ProjectTag.fromId(data.project_tag_id);
if (!projectTag) {
toastWarning('Failed to parse project tag option update: project tag not found');
return;
}
if (data.action === 'create') { if (data.action === 'create') {
projectTag.parseOption(data.data); const projectTag = ProjectTag.fromId(data.data.tag_id);
projectTag?.parseOption(data.data);
} else if (data.action === 'update') { } else if (data.action === 'update') {
projectTag.parseOptionUpdate(data.changes); const projectTag = ProjectTag.fromId(data.tag_id);
projectTag?.parseOptionUpdate(data.changes);
} else if (data.action === 'delete') { } else if (data.action === 'delete') {
projectTag.parseOptionDelete(data.id); const projectTag = ProjectTag.fromId(data.tag_id);
projectTag?.parseOptionDelete(data.option_id);
} else { } else {
toastWarning('Failed to parse project tag option update: unknown action'); toastWarning('Failed to parse project tag option update: unknown action');
return; return;