Skip to content

Commit

Permalink
feat(integration): add github label import ui/config
Browse files Browse the repository at this point in the history
- add config member for a flag to import labels as tags or not (`github.model.ts`)
- set default for that config member to false and add to UI form (`github.const.ts`)
- add const elements for that form to be filled in with translation elements/values (`t.const.ts`)
- first formulations of form elements in english and german (`en.json`, `de.json`)

part of the implementation regarding johannesjo#2866
  • Loading branch information
MiragonMx committed Aug 14, 2024
1 parent 89f0733 commit ef190dd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/app/features/issue/providers/github/github.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const DEFAULT_GITHUB_CFG: GithubCfg = {
isAutoAddToBacklog: false,
filterUsername: null,
filterIssuesAssignedToMe: false,
importLabelsAsTags: false,
};

// NOTE: we need a high limit because git has low usage limits :(
Expand Down Expand Up @@ -97,6 +98,14 @@ export const GITHUB_CONFIG_FORM: LimitedFormlyFieldConfig<GithubCfg>[] = [
label: T.F.GITHUB.FORM.IS_ASSIGNEE_FILTER,
},
},
{
key: 'importLabelsAsTags',
type: 'checkbox',
hideExpression: (model: any) => !model.isEnabled,
templateOptions: {
label: T.F.GITHUB.FORM.IS_IMPORT_LABELS_AS_TAGS,
},
},
];

export const GITHUB_CONFIG_FORM_SECTION: ConfigFormSection<GithubCfg> = {
Expand Down
1 change: 1 addition & 0 deletions src/app/features/issue/providers/github/github.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export interface GithubCfg extends BaseIssueProviderCfg {
repo: string | null;
token: string | null;
filterIssuesAssignedToMe: boolean;
importLabelsAsTags: boolean;
}
1 change: 1 addition & 0 deletions src/app/t.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ const T = {
TOKEN: 'F.GITHUB.FORM.TOKEN',
TOKEN_DESCRIPTION: 'F.GITHUB.FORM.TOKEN_DESCRIPTION',
IS_ASSIGNEE_FILTER: 'F.GITHUB.FORM.IS_ASSIGNEE_FILTER',
IS_IMPORT_LABELS_AS_TAGS: 'F.GITHUB.FORM.IS_IMPORT_LABELS_AS_TAGS',
},
FORM_SECTION: {
HELP: 'F.GITHUB.FORM_SECTION.HELP',
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
"REPO": "\"Benutzername / Repositoryname\" für das Git-Repository, das Sie verfolgen möchten",
"TOKEN": "Zugangstoken",
"TOKEN_DESCRIPTION": "Erforderlich für den Zugriff auf private Repositories",
"IS_ASSIGNEE_FILTER": "Filtert die mir zugewiesenen Issues"
"IS_ASSIGNEE_FILTER": "Filtert die mir zugewiesenen Issues",
"IS_IMPORT_LABELS_AS_TAGS": "GitHub Labels als tags in SuperProductivity importieren"
},
"FORM_SECTION": {
"HELP": "<p>Hier können Sie SuperProductivity so konfigurieren, dass offene GitHub-Issues für ein bestimmtes Repository im Aufgabenerstellungsbereich in der Tagesplanungsansicht aufgelistet werden. Sie werden als Vorschläge aufgeführt und enthalten einen Link zum Thema sowie weitere Informationen dazu.</p> <p>Außerdem können Sie alle offenen Issues automatisch zu Ihrem Aufgaben-Backlog hinzufügen und synchronisieren.</p>",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
"REPO": "\"username/repositoryName\" for the git repository you want to track",
"TOKEN": "Access Token",
"TOKEN_DESCRIPTION": "Required for private repository access",
"IS_ASSIGNEE_FILTER": "Filter Issues Assigned to Me"
"IS_ASSIGNEE_FILTER": "Filter Issues Assigned to Me",
"IS_IMPORT_LABELS_AS_TAGS": "Import GitHub labels as tags in SuperProductivity"
},
"FORM_SECTION": {
"HELP": "<p>Here you can configure SuperProductivity to list open GitHub issues for a specific repository in the task creation panel in the daily planning view. They will be listed as suggestions and will provide a link to the issue as well as more information about it.</p> <p>In addition you can automatically import all open issues.</p><p>To get by usage limits and to access you can provide a an access token. <a href='https://docs.github.com/en/free-pro-team@latest/developers/apps/scopes-for-oauth-apps'>More info about its scopes can be found here</a>.",
Expand Down

0 comments on commit ef190dd

Please sign in to comment.