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

Da/mac fixes #76

Merged
merged 9 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yattie",
"version": "0.9.0",
"version": "0.9.1",
"engines": {
"npm": ">=8.0.0 <9.0.0",
"node": ">=16.0.0 <17.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ databaseUtility.initializeSession();
const startupConfig = databaseUtility.getConfig();
if (startupConfig.devMode) {
isDevelopment = true;
windowUtility.setDevMode({enabled: true});
windowUtility.setDevMode({ enabled: true });
}

// Scheme must be registered before the app is ready
Expand Down
2 changes: 1 addition & 1 deletion src/components/TestWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default {
},
computed: {
aiAssistEnabled() {
return this?.config?.aiAssist || false;
return this?.config?.ai?.enabled || false;
},
currentTheme() {
if (this.$vuetify.theme.dark) {
Expand Down
3 changes: 1 addition & 2 deletions src/components/dialogs/NoteDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
? "mdi-robot-off-outline"
: "mdi-robot-outline"
}}</v-icon>
<v-icon>mdi-robot-outline</v-icon>
</v-btn>
</template>
</v-tiptap>
Expand Down Expand Up @@ -281,7 +280,7 @@ export default {
},
computed: {
aiAssistEnabled() {
return this?.config?.aiAssist || false;
return this?.config?.ai?.enabled || false;
},
currentTheme() {
if (this.$vuetify.theme.dark) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/SummaryDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default {
},
computed: {
aiAssistEnabled() {
return this?.config?.aiAssist || false;
return this?.config?.ai?.enabled || false;
},
currentTheme() {
if (this.$vuetify.theme.dark) {
Expand Down
80 changes: 50 additions & 30 deletions src/components/jira/JiraAddIssue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -377,19 +377,6 @@
</v-card>
</v-sheet>
</v-dialog>
<v-snackbar v-model="snackBar.enabled" timeout="3000">
{{ snackBar.message }}
<template v-slot:action="{ attrs }">
<v-btn
color="primary"
text
v-bind="attrs"
@click="snackBar.enabled = false"
>
Close
</v-btn>
</template>
</v-snackbar>
</v-list-item>
</template>

Expand Down Expand Up @@ -442,14 +429,13 @@ export default {
newIssue: {
fields: {},
},
blankIssue: {
fields: {},
},
valid: true,
rules: [(v) => !!v || "This field is required"],
dateMenu: false,
issueConfirmDialog: false,
snackBar: {
enabled: false,
message: "",
},
fieldMappings: {
description: {
type: "text",
Expand Down Expand Up @@ -485,6 +471,9 @@ export default {
this.newIssue = {
fields: {},
};
this.blankIssue = {
fields: {},
};
},
async handleSave() {
const isValid = this.$refs.form.validate();
Expand All @@ -495,6 +484,36 @@ export default {
const issueType = {
id: this.issueTypeId,
};

for (const [key, value] of Object.entries(this.newIssue.fields)) {
let thisField = this.issueFields.filter((field) => field.key === key);
if (thisField.length > 0) {
if (
thisField[0]?.schema?.type === "number" &&
value.constructor === String &&
value.length > 0
) {
this.$set(this.newIssue.fields, key, parseFloat(value));
}
if (value === this.blankIssue.fields[key]) {
if (
!thisField[0]?.required &&
(["number", "string"].includes(thisField[0]?.schema?.type) ||
(thisField[0]?.schema?.type === "array" &&
thisField[0]?.schema?.items === "json"))
// This second set of parameters are to filter JIRA fields
// like "Sprints" which need the data pulled from the api.
// I have removed Sprints from incoming fields though, so
// this may not be necessary. But it may prevent issues
// with similar fields in the future.
) {
// Remove unrequired simple fields that haven't changed.
this.$delete(this.newIssue.fields, key);
}
}
}
}

this.$set(this.newIssue.fields, "project", project);
this.$set(this.newIssue.fields, "issuetype", issueType);
this.loading = true;
Expand All @@ -506,10 +525,10 @@ export default {
);
if (response?.error) {
this.loading = false;
this.snackBar.enabled = true;
this.snackBar.message = response.error.message
let message = response.error.message
? response.error.message
: this.$tc("message.api_error", 1);
this.$root.$emit("set-snackbar", message);
if (response.error?.checkAuth) {
this.$root.$emit("update-auth", []);
}
Expand Down Expand Up @@ -559,8 +578,8 @@ export default {
}
}
} else {
this.snackBar.enabled = true;
this.snackBar.message = this.$tc("message.please_fill_required", 1);
let message = this.$tc("message.please_fill_required", 1);
this.$root.$emit("set-snackbar", message);
}
},
async showDialog() {
Expand Down Expand Up @@ -600,10 +619,10 @@ export default {

this.loading = false;
if (response?.error) {
this.snackBar.enabled = true;
this.snackBar.message = response.error.message
let message = response.error.message
? response.error.message
: this.$tc("message.api_error", 1);
this.$root.$emit("set-snackbar", message);
if (response.error?.checkAuth) {
this.$root.$emit("update-auth", []);
}
Expand All @@ -616,15 +635,16 @@ export default {
this.projectId,
this.issueTypeId
);
this.newIssue = response.blankIssue;
this.blankIssue.fields = Object.assign({}, response.blankIssue.fields);
this.newIssue = Object.assign({}, response.blankIssue);
this.issueFields = response.fieldData;

this.loading = false;
if (response?.error) {
this.snackBar.enabled = true;
this.snackBar.message = response.error.message
let message = response.error.message
? response.error.message
: this.$tc("message.api_error", 1);
this.$root.$emit("set-snackbar", message);
if (response.error?.checkAuth) {
this.$root.$emit("update-auth", []);
}
Expand All @@ -640,10 +660,10 @@ export default {

this.userLoading = false;
if (response?.error) {
this.snackBar.enabled = true;
this.snackBar.message = response.error.message
let message = response.error.message
? response.error.message
: this.$tc("message.api_error", 1);
this.$root.$emit("set-snackbar", message);
if (response.error?.checkAuth) {
this.$root.$emit("update-auth", []);
}
Expand All @@ -659,10 +679,10 @@ export default {

this.issueLoading = false;
if (response?.error) {
this.snackBar.enabled = true;
this.snackBar.message = response.error.message
let message = response.error.message
? response.error.message
: this.$tc("message.api_error", 1);
this.$root.$emit("set-snackbar", message);
if (response.error?.checkAuth) {
this.$root.$emit("update-auth", []);
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/settings/AddonsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
solo
:rules="[rules.rightLength, rules.noAsterisk]"
:errorMessages="customErrors"
:disabled="!config.aiAssist"
:disabled="!config.ai.enabled"
@focus="emptyKeyOnFocus"
>
</v-text-field>
Expand All @@ -45,7 +45,7 @@
color="white"
class="text-capitalize"
:style="{ color: currentTheme.black }"
:disabled="!config.aiAssist"
:disabled="!config?.ai?.enabled"
@click="handleCancelOpenAIKey"
>
{{ $tc("caption.cancel", 1) }}
Expand All @@ -57,7 +57,7 @@
block
color="primary"
class="text-capitalize"
:disabled="!config.aiAssist"
:disabled="!config?.ai?.enabled"
@click="handleOpenAIKey"
>
{{ $tc("caption.save", 1) }}
Expand Down
19 changes: 12 additions & 7 deletions src/integrations/JiraIntegrationHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
})
.catch((error) => {
returnResponse.error = {
message: error.message,
message: JSON.stringify(error.response.data.errors),
};

if (
Expand Down Expand Up @@ -168,7 +168,7 @@ export default {
})
.catch((error) => {
returnResponse.error = {
message: error.message,
message: JSON.stringify(error.response.data.errors),
};

if (
Expand Down Expand Up @@ -226,7 +226,7 @@ export default {
})
.catch((error) => {
returnResponse.error = {
message: error.message,
message: JSON.stringify(error.response.data.errors),
};

if (
Expand Down Expand Up @@ -261,7 +261,7 @@ export default {
})
.catch((error) => {
returnResponse.error = {
message: error.message,
message: JSON.stringify(error.response.data.errors),
};

if (
Expand Down Expand Up @@ -303,9 +303,14 @@ export default {
item &&
item.key !== "issuetype" &&
item.key !== "project" &&
item.name !== "Sprint" &&
item.schema.type !== "any" &&
!["attachment", "issuelinks"].includes(item.schema.system)
) {
// We exclude fields we will add back in later (projects) and
// those that need to have options pulled from the API separately
// (Sprints). We may want to renable the latter at some point
// and handle it in a generic way.
returnResponse.fieldData.push(item);
if (item.key === "reporter") {
const reporter = {
Expand All @@ -328,7 +333,7 @@ export default {
})
.catch((error) => {
returnResponse.error = {
message: error.message,
message: JSON.stringify(error.response.data.errors),
};

if (
Expand Down Expand Up @@ -359,7 +364,7 @@ export default {
let returnResponse = {};
await axios.post(url, formData, options).catch((error) => {
returnResponse.error = {
message: error.message,
message: JSON.stringify(error.response.data.errors),
};

if (
Expand Down Expand Up @@ -403,7 +408,7 @@ export default {
})
.catch((error) => {
returnResponse.error = {
message: error.message,
message: JSON.stringify(error.response.data.errors),
};

if (
Expand Down
24 changes: 12 additions & 12 deletions src/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ const createMenu = (win) => {
},
],
},
//{
// label: i18n.t("menu.edit"),
// submenu: [
// { label: i18n.t("menu.undo"), accelerator: "Ctrl+Z" },
// { label: i18n.t("menu.redo"), accelerator: "Ctrl+Shift+Z" },
// { type: "separator" },
// { label: i18n.t("menu.cut"), accelerator: "Ctrl+X" },
// { label: i18n.t("menu.copy"), accelerator: "Ctrl+C" },
// { label: i18n.t("menu.paste"), accelerator: "Ctrl+V" },
// { label: i18n.t("menu.select_all"), accelerator: "Ctrl+A" },
// ],
//},
{
label: i18n.t("menu.edit"),
submenu: [
{ label: i18n.t("menu.undo"), accelerator: "CmdOrCtrl+Z", role: "undo" },
{ label: i18n.t("menu.redo"), accelerator: "CmdOrCtrl+Y", role: "redo" },
{ type: "separator" },
{ label: i18n.t("menu.cut"), accelerator: "CmdOrCtrl+X", role: "cut" },
{ label: i18n.t("menu.copy"), accelerator: "CmdOrCtrl+C", role: "copy" },
{ label: i18n.t("menu.paste"), accelerator: "CmdOrCtrl+V", role: "paste" },
{ label: i18n.t("menu.select_all"), accelerator: "CmdOrCtrl+A", role: "selectAll" },
],
},
{
label: "Help",
submenu: [
Expand Down
2 changes: 1 addition & 1 deletion src/views/AddEvidence.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default {
},
computed: {
aiAssistEnabled() {
return this?.config?.aiAssist || false;
return this?.config?.ai?.enabled || false;
},
fileSuffix() {
let splitName = [];
Expand Down
2 changes: 1 addition & 1 deletion src/views/EditEvidence.vue
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export default {
},
computed: {
aiAssistEnabled() {
return this?.config?.aiAssist || false;
return this?.config?.ai?.enabled || false;
},
fileSuffix() {
let splitName = [];
Expand Down