Skip to content

Commit

Permalink
Merge pull request #106 from HanashiDev/next
Browse files Browse the repository at this point in the history
2.1.0
  • Loading branch information
Hanashi authored Oct 15, 2023
2 parents 2ae204f + 3a929ff commit 9fc71e1
Show file tree
Hide file tree
Showing 60 changed files with 1,929 additions and 1,543 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/*.js
vendor/**
52 changes: 24 additions & 28 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,33 @@ module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"]
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"]
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic",
"plugin:@typescript-eslint/stylistic-type-checked",
"prettier"
],
rules: {
"@typescript-eslint/ban-types": [
"error", {
types: {
"object": false
},
extendDefaults: true
}
],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-unsafe-return": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/restrict-template-expressions": 0,
"@typescript-eslint/no-unused-vars": [
"error", {
"argsIgnorePattern": "^_"
}
]
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/consistent-type-definitions": 0,
"@typescript-eslint/prefer-nullish-coalescing": 0,
"@typescript-eslint/no-unused-vars": [
"error", {
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/strict-boolean-expressions": [
"error", {
"allowNullableBoolean": true
}
],
}
};
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
files/js/**/*.js linguist-generated
24 changes: 12 additions & 12 deletions .github/diff.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"problemMatcher": [
{
"owner": "diff",
"pattern": [
{
"regexp": "--- a/(.*)",
"file": 1,
"message": 1
}
]
}
]
"problemMatcher": [
{
"owner": "diff",
"pattern": [
{
"regexp": "--- a/(.*)",
"file": 1,
"message": 1
}
]
}
]
}
26 changes: 13 additions & 13 deletions .github/php-syntax.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"problemMatcher": [
{
"owner": "php -l",
"pattern": [
{
"regexp": "^\\s*(PHP\\s+)?([a-zA-Z\\s]+):\\s+(.*)\\s+in\\s+(\\S+)\\s+on\\s+line\\s+(\\d+)$",
"file": 4,
"line": 5,
"message": 3
}
]
}
]
"problemMatcher": [
{
"owner": "php -l",
"pattern": [
{
"regexp": "^\\s*(PHP\\s+)?([a-zA-Z\\s]+):\\s+(.*)\\s+in\\s+(\\S+)\\s+on\\s+line\\s+(\\d+)$",
"file": 4,
"line": 5,
"message": 3
}
]
}
]
}
8 changes: 4 additions & 4 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Codestyle check
name: Code Style

on:
push:
Expand All @@ -9,11 +9,11 @@ jobs:
name: PHP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.0'
extensions: ctype, dom, exif, gd, gmp, hash, intl, json, libxml, mbstring, opcache, pcre, pdo, pdo_mysql, zlib
tools: cs2pr, phpcs, php-cs-fixer
- name: phpcs
Expand All @@ -24,7 +24,7 @@ jobs:
name: TS Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up node.js
uses: actions/setup-node@v3
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ jobs:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: echo "::add-matcher::.github/php-syntax.json"
- run: |
! find . -type f -name '*.php' -exec php -l '{}' \; 2>&1 |grep -v '^No syntax errors detected'
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v2.4.2
- uses: actions/checkout@v4

- uses: actions/setup-node@v3.5.0
- uses: actions/setup-node@v3
with:
node-version: 16

Expand All @@ -25,7 +25,7 @@ jobs:
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v1.1.0
uses: andstor/file-existence-action@v2.0.0
with:
files: "*.tar.gz"

Expand All @@ -35,7 +35,7 @@ jobs:
echo "Packaging FAILED" && exit 1
- name: Release
uses: softprops/[email protected].14
uses: softprops/[email protected].15
if: startsWith(github.ref, 'refs/tags/') && steps.check_files.outputs.files_exists == 'true'
with:
files: "*.tar.gz"
6 changes: 3 additions & 3 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
Expand All @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up node.js
uses: actions/setup-node@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions acpMenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<controller>wcf\acp\form\FaqCategoryAddForm</controller>
<parent>wcf.acp.menu.link.faq.categories.list</parent>
<permissions>admin.faq.canAddCategory</permissions>
<icon>fa-plus</icon>
<icon>plus</icon>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.faq.questions.list">
<controller>wcf\acp\page\FaqQuestionListPage</controller>
Expand All @@ -26,7 +26,7 @@
<controller>wcf\acp\form\FaqQuestionAddForm</controller>
<parent>wcf.acp.menu.link.faq.questions.list</parent>
<permissions>admin.faq.canAddQuestion</permissions>
<icon>fa-plus</icon>
<icon>plus</icon>
</acpmenuitem>
</import>
</data>
2 changes: 1 addition & 1 deletion acptemplates/faqQuestionAdd.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<nav class="contentHeaderNavigation">
<ul>
<li><a href="{link controller='FaqQuestionList'}{/link}" class="button"><span class="icon icon16 fa-list"></span> <span>{lang}wcf.acp.menu.link.faq.questions.list{/lang}</span></a></li>
<li><a href="{link controller='FaqQuestionList'}{/link}" class="button">{icon name='list' size=16} <span>{lang}wcf.acp.menu.link.faq.questions.list{/lang}</span></a></li>

{event name='contentHeaderNavigation'}
</ul>
Expand Down
32 changes: 32 additions & 0 deletions acptemplates/faqQuestionAddDialog.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div id="articleAddDialog" style="display: none">
<div class="section">
<dl>
<dt>{lang}wcf.acp.article.i18n{/lang}</dt>
<dd>
<label><input type="radio" name="isMultilingual" value="0" checked> {lang}wcf.acp.faq.i18n.none{/lang}</label>
<small>{lang}wcf.acp.article.i18n.none.description{/lang}</small>
<label><input type="radio" name="isMultilingual" value="1"> {lang}wcf.acp.faq.i18n.i18n{/lang}</label>
<small>{lang}wcf.acp.article.i18n.i18n.description{/lang}</small>
</dd>
</dl>

<div class="formSubmit">
<button type="button" class="button buttonPrimary">{lang}wcf.global.button.next{/lang}</button>
</div>
</div>
</div>
<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Acp/Ui/Article/Add'], function(Language, AcpUiArticleAdd) {
Language.addObject({
'wcf.acp.article.add': '{jslang}wcf.acp.menu.link.faq.questions.add{/jslang}'
});
AcpUiArticleAdd.init('{link controller='FaqQuestionAdd' encode=false}{literal}isMultilingual={$isMultilingual}{/literal}{/link}');
{if $showFaqAddDialog}
window.setTimeout(function() {
AcpUiArticleAdd.openDialog();
}, 10);
{/if}
});
</script>
9 changes: 5 additions & 4 deletions acptemplates/faqQuestionList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<nav class="contentHeaderNavigation">
<ul>
<li><a href="{link controller='FaqQuestionAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.menu.link.faq.questions.add{/lang}</span></a></li>
<li><a href="{link controller='FaqQuestionAdd'}{/link}" class="button">{icon name='plus' size=16} <span>{lang}wcf.acp.menu.link.faq.questions.add{/lang}</span></a></li>

{event name='contentHeaderNavigation'}
</ul>
Expand Down Expand Up @@ -89,9 +89,8 @@
<a href="{link controller='FaqQuestionEdit' object=$question}{/link}">{$question->getTitle()}</a>

<span class="statusDisplay sortableButtonContainer">
<span class="icon icon16 fa-arrows sortableNodeHandle"></span>
{objectAction action="toggle" isDisabled=$question->isDisabled}
<a href="{link controller='FaqQuestionEdit' object=$question}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
<a href="{link controller='FaqQuestionEdit' object=$question}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip">{icon name='pencil' size=16}</a>
{objectAction action="delete" objectTitle=$question->getTitle()}

{event name='itemButtons'}
Expand All @@ -115,7 +114,7 @@

<nav class="contentFooterNavigation">
<ul>
<li><a href="{link controller='FaqQuestionAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.menu.link.faq.questions.add{/lang}</span></a></li>
<li><a href="{link controller='FaqQuestionAdd'}{/link}" class="button">{icon name='plus' size=16} <span>{lang}wcf.acp.menu.link.faq.questions.add{/lang}</span></a></li>

{event name='contentFooterNavigation'}
</ul>
Expand All @@ -125,4 +124,6 @@
<p class="info">{lang}wcf.global.noItems{/lang}</p>
{/if}

{include file='faqQuestionAddDialog'}

{include file='footer'}
3 changes: 3 additions & 0 deletions files/acp/database/install_dev.tkirch.wsc.faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
TinyintDatabaseTableColumn::create('hasEmbeddedObjects')
->notNull()
->defaultValue(0),
TinyintDatabaseTableColumn::create('isMultilingual')
->notNull()
->defaultValue(0),
])
->foreignKeys([
DatabaseTableForeignKey::create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
return [
PartialDatabaseTable::create('wcf1_faq_questions')
->columns([
TinyintDatabaseTableColumn::create('hasEmbeddedObjects')
TinyintDatabaseTableColumn::create('isMultilingual')
->notNull()
->defaultValue(0),
]),
Expand Down
11 changes: 11 additions & 0 deletions files/acp/update_dev.tkirch.wsc.faq_2.0.0_step2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

use wcf\system\WCF;

$sql = "
UPDATE wcf1_faq_questions
SET isMultilingual = 1
WHERE answer LIKE ?
";
$statement = WCF::getDB()->prepare($sql);
$statement->execute(['wcf.faq.question.answer%']);
13 changes: 0 additions & 13 deletions files/js/3rdParty/redactor2/plugins/FaqQuestion.js

This file was deleted.

Loading

0 comments on commit 9fc71e1

Please sign in to comment.