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

Add support for multiple affiliations #8

Merged
merged 27 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c6c49a7
Add basic UI for multiple affiliations
duartegalvao Dec 20, 2023
56dd248
Save affiliations
duartegalvao Jan 9, 2024
c2b8fdd
Add compatibility for abstracts and validate forms
duartegalvao Jan 9, 2024
0c82ceb
Fix saving affiliations and feed them to the form
duartegalvao Jan 10, 2024
a3eb45d
Handle conversion of abstracts to contributions
duartegalvao Jan 10, 2024
9f759d5
Update headers 🎇
duartegalvao Jan 11, 2024
bbe68fa
Tweak UI
duartegalvao Jan 11, 2024
27e19d7
Fix losing affiliations when form validation fails
duartegalvao Jan 11, 2024
51a8f0e
Preserve affiliation order
duartegalvao Jan 11, 2024
f3f5095
Pre-fill affiliations with the users' default
duartegalvao Jan 12, 2024
66e2ce6
Fix extended exports
duartegalvao Jan 12, 2024
b512c36
Include all affiliations in the exports
duartegalvao Jan 17, 2024
88201f2
Populate tables with the current affiliations
duartegalvao Jan 17, 2024
1a6cbfd
Add new and improved affiliations selector
duartegalvao Jan 23, 2024
d748450
Hide affiliation field in edit person
duartegalvao Jan 25, 2024
e02cff4
Fix lint errors
ThiefMaster Feb 8, 2024
ea05831
Remove url_map.json
ThiefMaster Feb 8, 2024
d8b1bfc
Improve code
duartegalvao Feb 15, 2024
8530de7
Use semicolon as affiliation separator
duartegalvao Feb 15, 2024
0960476
Make affiliations configurable per event
duartegalvao Feb 15, 2024
251379e
Adapt to signal rename
ThiefMaster Mar 13, 2024
9695588
Fix react component render returning undefined
ThiefMaster Mar 13, 2024
4ad6df1
Disallow disabling multiple affiliations
duartegalvao Mar 14, 2024
35106a1
Fix form instance check
ThiefMaster Mar 15, 2024
f38c085
Include migrations in built wheel
ThiefMaster Mar 15, 2024
2cc9129
Fix stylelint violations
ThiefMaster Mar 15, 2024
7e46fa1
Use recent stylelint version + config
ThiefMaster Mar 15, 2024
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
69 changes: 69 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* eslint-disable import/no-commonjs, import/unambiguous */
/* global module:false, __dirname:false */

const path = require('path');
const fs = require('fs');
const {execSync} = require('child_process');
const _ = require('lodash');
const resolve = require('resolve');
const yaml = require('js-yaml');

// Returns the path to the Indico source package/repo
const PATH_COMMAND = `python -c 'from flask.helpers import get_root_path; print(get_root_path("indico"))'`;

let indicoBaseDir = null;
const indicoPathFile = path.join(__dirname, '.indico_source');

// If there's an .indico_source file in the same dir, let's use it
if (fs.existsSync(indicoPathFile)) {
indicoBaseDir = fs
.readFileSync(indicoPathFile)
.toString()
.trim();
}

// Otherwise, let's use Python to figure it out
if (!indicoBaseDir) {
// Figure out where the Indico code base has been set up
indicoBaseDir = path.join(
execSync(PATH_COMMAND, {
encoding: 'utf8',
}).trim(),
'..'
);
}

let currentMap = [];
let defaultConfig = {};

try {
defaultConfig = yaml.safeLoad(fs.readFileSync(path.join(indicoBaseDir, '.eslintrc.yml')));
currentMap = defaultConfig.settings['import/resolver'].alias.map;
} catch (e) {
console.error(e);
}

const reactPath = resolve.sync('react', {basedir: indicoBaseDir});
const react = require(reactPath);
const babelConfigFile = path.join(indicoBaseDir, 'babel.config.js');

module.exports = _.merge(defaultConfig, {
settings: {
'react': {
version: react.version,
},
'import/resolver': {
alias: {
map: currentMap.map(([k, v]) => [k, path.resolve(indicoBaseDir, v)]),
},
node: {
paths: path.join(indicoBaseDir, 'node_modules'),
},
},
},
parserOptions: {
babelOptions: {
configFile: babelConfigFile
}
}
});
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ node_modules/
*.lock
url_map.json
.venv/
webpack-build-config.json
node_modules/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"eslint-config-indico/prettier-config"
85 changes: 85 additions & 0 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
extends:
- stylelint-prettier/recommended
- stylelint-config-recommended
- stylelint-config-recommended-scss
- stylelint-stylistic/config

ignoreFiles:
- indico/web/static/dist/**/*.css

rules:
# this rule is too noisy
no-descending-specificity: null

# complains about css rules after `@include` without an empty line
declaration-empty-line-before: null

# `:global()` has special meaning in css modules
selector-pseudo-class-no-unknown:
- true
- ignorePseudoClasses: [global]

selector-pseudo-element-colon-notation: double

font-family-no-missing-generic-family-keyword:
- true
- ignoreFontFamilies: [icomoon-ultimate]

at-rule-empty-line-before:
- always
- except:
- first-nested
ignore:
- blockless-after-same-name-blockless
- after-comment
- inside-block

color-hex-length: short
length-zero-no-unit: true

rule-empty-line-before:
- always
- except: [first-nested]
ignore: [after-comment]

value-keyword-case: lower

scss/at-import-partial-extension: never
scss/at-function-pattern: ^([a-z][a-z0-9]*)(-[a-z0-9]+)*$
scss/at-mixin-argumentless-call-parentheses: always
scss/at-mixin-pattern: ^_?([a-z][a-z0-9]*)(-[a-z0-9]+)*$
scss/at-rule-conditional-no-parentheses: true
scss/dollar-variable-pattern: ^([a-z][a-z0-9]*)(-[a-z0-9]+)*$
scss/percent-placeholder-pattern: ^([a-z][a-z0-9]*)(-[a-z0-9]+)*$
scss/double-slash-comment-whitespace-inside: always
scss/declaration-nested-properties: never
scss/dimension-no-non-numeric-values: true
scss/load-no-partial-leading-underscore: true
scss/media-feature-value-dollar-variable:
- always
- ignore: [keywords]
severity: warning
scss/no-duplicate-dollar-variables:
- true
- ignoreInside: [at-rule, nested-at-rule]
ignoreInsideAtRules: [if, else, function, each]
scss/no-duplicate-mixins: true

# we have "empty" comments in our license header
scss/comment-no-empty: null
# we make heavy use of globals like darken() and lighten()
scss/no-global-function-names: null
# heavily used
scss/at-extend-no-missing-placeholder: null
# prettier's formatting can violate this
scss/operator-no-newline-after: null
# single quotes are clearly superior
stylistic/string-quotes: single

# these rule conflict with stylelint-prettier formatting
stylistic/indentation: null
stylistic/selector-descendant-combinator-no-non-space: null
stylistic/declaration-colon-newline-after: null
stylistic/selector-combinator-space-before: null
stylistic/block-closing-brace-newline-after: null
stylistic/value-list-comma-newline-after: null
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
graft indico_jacow/migrations
graft indico_jacow/static
graft indico_jacow/templates

Expand Down
Loading
Loading