mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 19:07:36 -02:30
Add more linter rules and de-lint
This commit is contained in:
@@ -16,5 +16,4 @@ test
|
|||||||
!client/lib/components/**/*.js
|
!client/lib/components/**/*.js
|
||||||
!client/lib/models/**/*.js
|
!client/lib/models/**/*.js
|
||||||
!client/lib/services/**/*.js
|
!client/lib/services/**/*.js
|
||||||
|
|
||||||
!client/features/**/*.js
|
!client/features/**/*.js
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
root: true,
|
||||||
extends: [
|
extends: [
|
||||||
'airbnb-base'
|
'airbnb-base'
|
||||||
],
|
],
|
||||||
@@ -27,15 +28,22 @@ module.exports = {
|
|||||||
jsyaml: true
|
jsyaml: true
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
indent: [0, 4],
|
'arrow-parens': 'off',
|
||||||
'comma-dangle': 0,
|
'comma-dangle': 'off',
|
||||||
'space-before-function-paren': [2, 'always'],
|
indent: ['error', 4, {
|
||||||
'arrow-parens': 0,
|
SwitchCase: 1
|
||||||
'no-param-reassign': 0,
|
}],
|
||||||
'no-underscore-dangle': 0,
|
'max-len': ['error', {
|
||||||
'no-mixed-operators': 0,
|
code: 100,
|
||||||
'no-plusplus': 0,
|
ignoreStrings: true,
|
||||||
'no-continue': 0,
|
ignoreTemplateLiterals: true,
|
||||||
'object-curly-newline': 0
|
}],
|
||||||
|
'no-continue': 'off',
|
||||||
|
'no-mixed-operators': 'off',
|
||||||
|
'no-param-reassign': 'off',
|
||||||
|
'no-plusplus': 'off',
|
||||||
|
'no-underscore-dangle': 'off',
|
||||||
|
'object-curly-newline': 'off',
|
||||||
|
'space-before-function-paren': ['error', 'always']
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ const path = require('path');
|
|||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
|
|
||||||
const CLIENT_PATH = path.resolve(__dirname, '../client');
|
const CLIENT_PATH = path.resolve(__dirname, '../client');
|
||||||
const LIB_PATH = path.join(CLIENT_PATH, 'lib');
|
const LIB_PATH = path.join(CLIENT_PATH, 'lib');
|
||||||
@@ -20,6 +20,7 @@ const NODE_MODULES_PATH = path.join(UI_PATH, 'node_modules');
|
|||||||
const SERVICES_PATH = path.join(LIB_PATH, 'services');
|
const SERVICES_PATH = path.join(LIB_PATH, 'services');
|
||||||
const SOURCE_PATH = path.join(CLIENT_PATH, 'src');
|
const SOURCE_PATH = path.join(CLIENT_PATH, 'src');
|
||||||
const STATIC_PATH = path.join(UI_PATH, 'static');
|
const STATIC_PATH = path.join(UI_PATH, 'static');
|
||||||
|
const THEME_PATH = path.join(LIB_PATH, 'theme');
|
||||||
|
|
||||||
const APP_ENTRY = path.join(SOURCE_PATH, 'app.js');
|
const APP_ENTRY = path.join(SOURCE_PATH, 'app.js');
|
||||||
const VENDOR_ENTRY = path.join(SOURCE_PATH, 'vendor.js');
|
const VENDOR_ENTRY = path.join(SOURCE_PATH, 'vendor.js');
|
||||||
@@ -32,7 +33,7 @@ const CHUNKS = ['vendor', 'app'];
|
|||||||
const VENDOR = VENDOR_ENTRY;
|
const VENDOR = VENDOR_ENTRY;
|
||||||
const APP = [THEME_ENTRY, APP_ENTRY];
|
const APP = [THEME_ENTRY, APP_ENTRY];
|
||||||
|
|
||||||
let base = {
|
const base = {
|
||||||
entry: {
|
entry: {
|
||||||
vendor: VENDOR,
|
vendor: VENDOR,
|
||||||
app: APP
|
app: APP
|
||||||
@@ -42,7 +43,17 @@ let base = {
|
|||||||
publicPath: '',
|
publicPath: '',
|
||||||
filename: OUTPUT
|
filename: OUTPUT
|
||||||
},
|
},
|
||||||
stats: 'minimal',
|
stats: {
|
||||||
|
children: false,
|
||||||
|
modules: false,
|
||||||
|
chunks: false,
|
||||||
|
excludeAssets: name => {
|
||||||
|
const chunkNames = `(${CHUNKS.join('|')})`;
|
||||||
|
const outputPattern = new RegExp(`${chunkNames}\.[a-f0-9]+\.(js|css)$`, 'i');
|
||||||
|
|
||||||
|
return !outputPattern.test(name);
|
||||||
|
}
|
||||||
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
@@ -50,7 +61,13 @@ let base = {
|
|||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
options: {
|
options: {
|
||||||
presets: ['env']
|
presets: [
|
||||||
|
['env', {
|
||||||
|
targets: {
|
||||||
|
browsers: ['last 2 versions']
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -81,10 +98,6 @@ let base = {
|
|||||||
/node_modules\/d3\/d3\.min.js$/
|
/node_modules\/d3\/d3\.min.js$/
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
use: 'imports-loader?define=>false'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
test: /\.html$/,
|
test: /\.html$/,
|
||||||
use: ['ngtemplate-loader', 'html-loader'],
|
use: ['ngtemplate-loader', 'html-loader'],
|
||||||
@@ -169,11 +182,12 @@ let base = {
|
|||||||
filename: INDEX_OUTPUT,
|
filename: INDEX_OUTPUT,
|
||||||
inject: false,
|
inject: false,
|
||||||
chunks: CHUNKS,
|
chunks: CHUNKS,
|
||||||
chunksSortMode: (moduleA, moduleB) => {
|
chunksSortMode: (chunk) => {
|
||||||
moduleA.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
if (chunk.names[0] === 'polyfill' || chunk.names[0] === 'vendor') {
|
||||||
moduleB.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1)
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return moduleA.names[0] === 'vendor' ? -1 : 1
|
return 1;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
@@ -183,12 +197,13 @@ let base = {
|
|||||||
'~models': MODELS_PATH,
|
'~models': MODELS_PATH,
|
||||||
'~services': SERVICES_PATH,
|
'~services': SERVICES_PATH,
|
||||||
'~components': COMPONENTS_PATH,
|
'~components': COMPONENTS_PATH,
|
||||||
|
'~theme': THEME_PATH,
|
||||||
'~modules': NODE_MODULES_PATH,
|
'~modules': NODE_MODULES_PATH,
|
||||||
'~assets': ASSETS_PATH,
|
'~assets': ASSETS_PATH,
|
||||||
'd3$': '~modules/d3/d3.min.js',
|
d3$: '~modules/d3/d3.min.js',
|
||||||
'codemirror.jsonlint$': '~modules/codemirror/addon/lint/json-lint.js',
|
'codemirror.jsonlint$': '~modules/codemirror/addon/lint/json-lint.js',
|
||||||
'jquery-resize$': '~modules/javascript-detect-element-resize/jquery.resize.js',
|
'jquery-resize$': '~modules/javascript-detect-element-resize/jquery.resize.js',
|
||||||
'select2$': '~modules/select2/dist/js/select2.full.min.js',
|
select2$: '~modules/select2/dist/js/select2.full.min.js',
|
||||||
'js-yaml$': '~modules/js-yaml/dist/js-yaml.min.js',
|
'js-yaml$': '~modules/js-yaml/dist/js-yaml.min.js',
|
||||||
'lr-infinite-scroll$': '~modules/lr-infinite-scroll/lrInfiniteScroll.js',
|
'lr-infinite-scroll$': '~modules/lr-infinite-scroll/lrInfiniteScroll.js',
|
||||||
'angular-ui-router$': '~modules/angular-ui-router/release/angular-ui-router.js',
|
'angular-ui-router$': '~modules/angular-ui-router/release/angular-ui-router.js',
|
||||||
|
|||||||
@@ -2,27 +2,10 @@ const path = require('path');
|
|||||||
|
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
|
||||||
const ESLINTRC_PATH = path.resolve(__dirname, '..', '.eslintrc.js');
|
const base = require('./webpack.base');
|
||||||
const LINTED_PATHS = [
|
|
||||||
/.js$/
|
|
||||||
];
|
|
||||||
|
|
||||||
let base = require('./webpack.base');
|
const development = {
|
||||||
|
devtool: 'cheap-source-map'
|
||||||
let development = {
|
|
||||||
devtool: 'cheap-source-map',
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
enforce: 'pre',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: 'eslint-loader'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
development.module.rules = base.module.rules.concat(development.module.rules)
|
|
||||||
|
|
||||||
module.exports = _.merge(base, development);
|
module.exports = _.merge(base, development);
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ const webpack = require('webpack');
|
|||||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
let base = require('./webpack.base');
|
const base = require('./webpack.base');
|
||||||
|
|
||||||
const CLIENT_PATH = path.resolve(__dirname, '../client');
|
const CLIENT_PATH = path.resolve(__dirname, '../client');
|
||||||
const UI_PATH = path.resolve(__dirname, '..');
|
const UI_PATH = path.resolve(__dirname, '..');
|
||||||
const INSTALL_RUNNING_ENTRY = path.join(CLIENT_PATH, 'installing.template.ejs')
|
const INSTALL_RUNNING_ENTRY = path.join(CLIENT_PATH, 'installing.template.ejs');
|
||||||
const INSTALL_RUNNING_OUTPUT = path.join(UI_PATH, 'templates/ui/installing.html');
|
const INSTALL_RUNNING_OUTPUT = path.join(UI_PATH, 'templates/ui/installing.html');
|
||||||
const CHUNKS = ['vendor', 'app'];
|
const CHUNKS = ['vendor', 'app'];
|
||||||
|
|
||||||
let production = {
|
const production = {
|
||||||
plugins: [
|
plugins: [
|
||||||
new UglifyJSPlugin({
|
new UglifyJSPlugin({
|
||||||
compress: true,
|
compress: true,
|
||||||
@@ -25,16 +25,17 @@ let production = {
|
|||||||
filename: INSTALL_RUNNING_OUTPUT,
|
filename: INSTALL_RUNNING_OUTPUT,
|
||||||
inject: false,
|
inject: false,
|
||||||
chunks: CHUNKS,
|
chunks: CHUNKS,
|
||||||
chunksSortMode: (moduleA, moduleB) => {
|
chunksSortMode: (chunk) => {
|
||||||
moduleA.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1);
|
if (chunk.names[0] === 'polyfill' || chunk.names[0] === 'vendor') {
|
||||||
moduleB.files.sort((fileA, fileB) => fileA.includes('js') ? -1 : 1);
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return moduleA.names[0] === 'vendor' ? -1 : 1;
|
return 1;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
production.plugins = base.plugins.concat(production.plugins)
|
production.plugins = base.plugins.concat(production.plugins);
|
||||||
|
|
||||||
module.exports = _.merge(base, production);
|
module.exports = _.merge(base, production);
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ const webpack = require('webpack');
|
|||||||
|
|
||||||
const STATIC_URL = '/static/';
|
const STATIC_URL = '/static/';
|
||||||
|
|
||||||
let development = require('./webpack.development');
|
const development = require('./webpack.development');
|
||||||
|
|
||||||
let test = {
|
const test = {
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
$basePath: STATIC_URL
|
$basePath: STATIC_URL
|
||||||
@@ -15,7 +15,7 @@ let test = {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
test.plugins = development.plugins.concat(test.plugins)
|
test.plugins = development.plugins.concat(test.plugins);
|
||||||
|
|
||||||
module.exports = _.merge(development, test);
|
module.exports = _.merge(development, test);
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,19 @@ const TARGET_PORT = _.get(process.env, 'npm_package_config_django_port', 8043);
|
|||||||
const TARGET_HOST = _.get(process.env, 'npm_package_config_django_host', 'https://localhost');
|
const TARGET_HOST = _.get(process.env, 'npm_package_config_django_host', 'https://localhost');
|
||||||
const TARGET = `https://${TARGET_HOST}:${TARGET_PORT}`;
|
const TARGET = `https://${TARGET_HOST}:${TARGET_PORT}`;
|
||||||
|
|
||||||
let development = require('./webpack.development');
|
const development = require('./webpack.development');
|
||||||
|
|
||||||
let watch = {
|
const watch = {
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
enforce: 'pre',
|
||||||
|
exclude: /node_modules/,
|
||||||
|
loader: 'eslint-loader'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlWebpackHarddiskPlugin(),
|
new HtmlWebpackHarddiskPlugin(),
|
||||||
new webpack.HotModuleReplacementPlugin()
|
new webpack.HotModuleReplacementPlugin()
|
||||||
@@ -36,7 +46,8 @@ let watch = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
watch.plugins = development.plugins.concat(watch.plugins)
|
watch.module.rules = development.module.rules.concat(watch.module.rules);
|
||||||
|
watch.plugins = development.plugins.concat(watch.plugins);
|
||||||
|
|
||||||
module.exports = _.merge(development, watch);
|
module.exports = _.merge(development, watch);
|
||||||
|
|
||||||
|
|||||||
@@ -48,60 +48,59 @@ function LegacyCredentialsService () {
|
|||||||
url: '/permissions?{permission_search:queryset}',
|
url: '/permissions?{permission_search:queryset}',
|
||||||
resolve: {
|
resolve: {
|
||||||
ListDefinition: () => ({
|
ListDefinition: () => ({
|
||||||
name: 'permissions',
|
name: 'permissions',
|
||||||
disabled: 'organization === undefined',
|
disabled: 'organization === undefined',
|
||||||
ngClick: 'organization === undefined || $state.go(\'credentials.edit.permissions\')',
|
ngClick: 'organization === undefined || $state.go(\'credentials.edit.permissions\')',
|
||||||
awToolTip: '{{permissionsTooltip}}',
|
awToolTip: '{{permissionsTooltip}}',
|
||||||
dataTipWatch: 'permissionsTooltip',
|
dataTipWatch: 'permissionsTooltip',
|
||||||
awToolTipTabEnabledInEditMode: true,
|
awToolTipTabEnabledInEditMode: true,
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
basePath: 'api/v2/credentials/{{$stateParams.id}}/access_list/',
|
basePath: 'api/v2/credentials/{{$stateParams.id}}/access_list/',
|
||||||
search: {
|
search: {
|
||||||
order_by: 'username'
|
order_by: 'username'
|
||||||
},
|
},
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: N_('Permissions'),
|
title: N_('Permissions'),
|
||||||
iterator: 'permission',
|
iterator: 'permission',
|
||||||
index: false,
|
index: false,
|
||||||
open: false,
|
open: false,
|
||||||
actions: {
|
actions: {
|
||||||
add: {
|
add: {
|
||||||
ngClick: '$state.go(\'.add\')',
|
ngClick: '$state.go(\'.add\')',
|
||||||
label: 'Add',
|
label: 'Add',
|
||||||
awToolTip: N_('Add a permission'),
|
awToolTip: N_('Add a permission'),
|
||||||
actionClass: 'btn List-buttonSubmit',
|
actionClass: 'btn List-buttonSubmit',
|
||||||
buttonContent: `+ ${N_('ADD')}`,
|
buttonContent: `+ ${N_('ADD')}`,
|
||||||
ngShow: '(credential_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '(credential_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fields: {
|
fields: {
|
||||||
username: {
|
username: {
|
||||||
key: true,
|
key: true,
|
||||||
label: N_('User'),
|
label: N_('User'),
|
||||||
linkBase: 'users',
|
linkBase: 'users',
|
||||||
class: 'col-lg-3 col-md-3 col-sm-3 col-xs-4'
|
class: 'col-lg-3 col-md-3 col-sm-3 col-xs-4'
|
||||||
},
|
},
|
||||||
role: {
|
role: {
|
||||||
label: N_('Role'),
|
label: N_('Role'),
|
||||||
type: 'role',
|
type: 'role',
|
||||||
nosort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
},
|
},
|
||||||
team_roles: {
|
team_roles: {
|
||||||
label: N_('Team Roles'),
|
label: N_('Team Roles'),
|
||||||
type: 'team_roles',
|
type: 'team_roles',
|
||||||
nosort: true,
|
nosort: true,
|
||||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}),
|
|
||||||
Dataset: ['QuerySet', '$stateParams', (qs, $stateParams) => {
|
|
||||||
const id = $stateParams.credential_id;
|
|
||||||
const path = `api/v2/credentials/${id}/access_list/`;
|
|
||||||
|
|
||||||
return qs.search(path, $stateParams.permission_search);
|
|
||||||
}
|
}
|
||||||
]
|
}),
|
||||||
|
Dataset: ['QuerySet', '$stateParams', (qs, $stateParams) => {
|
||||||
|
const id = $stateParams.credential_id;
|
||||||
|
const path = `api/v2/credentials/${id}/access_list/`;
|
||||||
|
|
||||||
|
return qs.search(path, $stateParams.permission_search);
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
permission_search: {
|
permission_search: {
|
||||||
@@ -144,7 +143,14 @@ function LegacyCredentialsService () {
|
|||||||
'GetBasePath',
|
'GetBasePath',
|
||||||
'resourceData',
|
'resourceData',
|
||||||
(list, qs, $stateParams, GetBasePath, resourceData) => {
|
(list, qs, $stateParams, GetBasePath, resourceData) => {
|
||||||
const path = resourceData.data.organization ? `${GetBasePath('organizations')}${resourceData.data.organization}/users` : ((list.basePath) || GetBasePath(list.name));
|
let path;
|
||||||
|
|
||||||
|
if (resourceData.data.organization) {
|
||||||
|
path = `${GetBasePath('organizations')}${resourceData.data.organization}/users`;
|
||||||
|
} else {
|
||||||
|
path = list.basePath || GetBasePath(list.name);
|
||||||
|
}
|
||||||
|
|
||||||
return qs.search(path, $stateParams.user_search);
|
return qs.search(path, $stateParams.user_search);
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -156,17 +162,21 @@ function LegacyCredentialsService () {
|
|||||||
'resourceData',
|
'resourceData',
|
||||||
(list, qs, $stateParams, GetBasePath, resourceData) => {
|
(list, qs, $stateParams, GetBasePath, resourceData) => {
|
||||||
const path = GetBasePath(list.basePath) || GetBasePath(list.name);
|
const path = GetBasePath(list.basePath) || GetBasePath(list.name);
|
||||||
|
const org = resourceData.data.organization;
|
||||||
|
|
||||||
if (!resourceData.data.organization) {
|
if (!org) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$stateParams[`${list.iterator}_search`].organization = resourceData.data.organization;
|
$stateParams[`${list.iterator}_search`].organization = org;
|
||||||
return qs.search(path, $stateParams.team_search);
|
|
||||||
|
return qs.search(path, $stateParams.team_search);
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
resourceData: ['CredentialModel', '$stateParams', (Credential, $stateParams) => new Credential('get', $stateParams.credential_id)
|
resourceData: ['CredentialModel', '$stateParams', (Credential, $stateParams) =>
|
||||||
.then(credential => ({ data: credential.get() }))],
|
new Credential('get', $stateParams.credential_id)
|
||||||
|
.then(credential => ({ data: credential.get() }))
|
||||||
|
]
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
user_search: {
|
user_search: {
|
||||||
@@ -246,9 +256,9 @@ function LegacyCredentialsService () {
|
|||||||
ListDefinition: ['OrganizationList', list => list],
|
ListDefinition: ['OrganizationList', list => list],
|
||||||
Dataset: ['ListDefinition', 'QuerySet', '$stateParams', 'GetBasePath',
|
Dataset: ['ListDefinition', 'QuerySet', '$stateParams', 'GetBasePath',
|
||||||
(list, qs, $stateParams, GetBasePath) => qs.search(
|
(list, qs, $stateParams, GetBasePath) => qs.search(
|
||||||
GetBasePath('organizations'),
|
GetBasePath('organizations'),
|
||||||
$stateParams[`${list.iterator}_search`]
|
$stateParams[`${list.iterator}_search`]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
onExit ($state) {
|
onExit ($state) {
|
||||||
@@ -285,9 +295,9 @@ function LegacyCredentialsService () {
|
|||||||
ListDefinition: ['CredentialTypesList', list => list],
|
ListDefinition: ['CredentialTypesList', list => list],
|
||||||
Dataset: ['ListDefinition', 'QuerySet', '$stateParams', 'GetBasePath',
|
Dataset: ['ListDefinition', 'QuerySet', '$stateParams', 'GetBasePath',
|
||||||
(list, qs, $stateParams, GetBasePath) => qs.search(
|
(list, qs, $stateParams, GetBasePath) => qs.search(
|
||||||
GetBasePath('credential_types'),
|
GetBasePath('credential_types'),
|
||||||
$stateParams[`${list.iterator}_search`]
|
$stateParams[`${list.iterator}_search`]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
onExit ($state) {
|
onExit ($state) {
|
||||||
|
|||||||
@@ -112,14 +112,14 @@ function BaseInputController (strings) {
|
|||||||
scope.state._disabled = true;
|
scope.state._disabled = true;
|
||||||
scope.state._enableToggle = false;
|
scope.state._enableToggle = false;
|
||||||
} else if (scope.state._isBeingReplaced === false) {
|
} else if (scope.state._isBeingReplaced === false) {
|
||||||
scope.state._disabled = true;
|
scope.state._disabled = true;
|
||||||
scope.state._enableToggle = true;
|
scope.state._enableToggle = true;
|
||||||
scope.state._value = scope.state._preEditValue;
|
scope.state._value = scope.state._preEditValue;
|
||||||
} else {
|
} else {
|
||||||
scope.state._activeModel = '_value';
|
scope.state._activeModel = '_value';
|
||||||
scope.state._disabled = false;
|
scope.state._disabled = false;
|
||||||
scope.state._value = '';
|
scope.state._value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.check();
|
vm.check();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ function AtInputTextareaSecretController (baseInputController, eventService) {
|
|||||||
scope.state._buttonText = vm.strings.get('REPLACE');
|
scope.state._buttonText = vm.strings.get('REPLACE');
|
||||||
scope.state._placeholder = vm.strings.get('ENCRYPTED');
|
scope.state._placeholder = vm.strings.get('ENCRYPTED');
|
||||||
} else if (scope.state.format === 'ssh_private_key') {
|
} else if (scope.state.format === 'ssh_private_key') {
|
||||||
vm.listeners = vm.setFileListeners(textarea, input);
|
vm.listeners = vm.setFileListeners(textarea, input);
|
||||||
scope.state._displayHint = true;
|
scope.state._displayHint = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.check();
|
vm.check();
|
||||||
};
|
};
|
||||||
@@ -55,25 +55,25 @@ function AtInputTextareaSecretController (baseInputController, eventService) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
vm.setFileListeners = (textareaEl, inputEl) => eventService.addListeners([
|
vm.setFileListeners = (textareaEl, inputEl) => eventService.addListeners([
|
||||||
[textareaEl, 'dragenter', event => {
|
[textareaEl, 'dragenter', event => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
scope.$apply(() => { scope.drag = true; });
|
scope.$apply(() => { scope.drag = true; });
|
||||||
}],
|
}],
|
||||||
|
|
||||||
[inputEl, 'dragleave', event => {
|
[inputEl, 'dragleave', event => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
scope.$apply(() => { scope.drag = false; });
|
scope.$apply(() => { scope.drag = false; });
|
||||||
}],
|
}],
|
||||||
|
|
||||||
[inputEl, 'change', event => {
|
[inputEl, 'change', event => {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
|
|
||||||
reader.onload = () => vm.readFile(reader, event);
|
reader.onload = () => vm.readFile(reader, event);
|
||||||
reader.readAsText(inputEl.files[0]);
|
reader.readAsText(inputEl.files[0]);
|
||||||
}]
|
}]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
vm.readFile = (reader) => {
|
vm.readFile = (reader) => {
|
||||||
scope.$apply(() => {
|
scope.$apply(() => {
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ function AtSideNavItemController ($state, $scope, strings) {
|
|||||||
if ($scope.name === 'portal mode') {
|
if ($scope.name === 'portal mode') {
|
||||||
vm.isRoute = (current && current.indexOf('portalMode') === 0);
|
vm.isRoute = (current && current.indexOf('portalMode') === 0);
|
||||||
} else if (current && current.indexOf($scope.route) === 0) {
|
} else if (current && current.indexOf($scope.route) === 0) {
|
||||||
if (current.indexOf('jobs.schedules') === 0 && $scope.route === 'jobs') {
|
if (current.indexOf('jobs.schedules') === 0 && $scope.route === 'jobs') {
|
||||||
vm.isRoute = false;
|
|
||||||
} else {
|
|
||||||
vm.isRoute = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
vm.isRoute = false;
|
vm.isRoute = false;
|
||||||
|
} else {
|
||||||
|
vm.isRoute = true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
vm.isRoute = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
vm.go = () => {
|
vm.go = () => {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ function MeModel (method, resource, graft) {
|
|||||||
this.unset('results');
|
this.unset('results');
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ require('~modules/codemirror/theme/elegant.css');
|
|||||||
require('~modules/codemirror/addon/lint/lint.css');
|
require('~modules/codemirror/addon/lint/lint.css');
|
||||||
require('~modules/nvd3/build/nv.d3.css');
|
require('~modules/nvd3/build/nv.d3.css');
|
||||||
require('~modules/ng-toast/dist/ngToast.min.css');
|
require('~modules/ng-toast/dist/ngToast.min.css');
|
||||||
|
|
||||||
require('jquery');
|
require('jquery');
|
||||||
require('jquery-resize');
|
require('jquery-resize');
|
||||||
require('jquery-ui');
|
require('jquery-ui');
|
||||||
|
|||||||
@@ -58,7 +58,6 @@
|
|||||||
"html-loader": "^0.5.1",
|
"html-loader": "^0.5.1",
|
||||||
"html-webpack-harddisk-plugin": "^0.1.0",
|
"html-webpack-harddisk-plugin": "^0.1.0",
|
||||||
"html-webpack-plugin": "^2.30.1",
|
"html-webpack-plugin": "^2.30.1",
|
||||||
"imports-loader": "^0.7.1",
|
|
||||||
"jasmine-core": "^2.5.2",
|
"jasmine-core": "^2.5.2",
|
||||||
"jshint": "^2.9.4",
|
"jshint": "^2.9.4",
|
||||||
"jshint-loader": "^0.8.3",
|
"jshint-loader": "^0.8.3",
|
||||||
@@ -80,7 +79,6 @@
|
|||||||
"less-plugin-autoprefix": "^1.4.2",
|
"less-plugin-autoprefix": "^1.4.2",
|
||||||
"load-grunt-configs": "^1.0.0",
|
"load-grunt-configs": "^1.0.0",
|
||||||
"load-grunt-tasks": "^3.5.0",
|
"load-grunt-tasks": "^3.5.0",
|
||||||
"minimist": "^1.2.0",
|
|
||||||
"nightwatch": "^0.9.16",
|
"nightwatch": "^0.9.16",
|
||||||
"ngtemplate-loader": "^2.0.1",
|
"ngtemplate-loader": "^2.0.1",
|
||||||
"phantomjs-prebuilt": "^2.1.12",
|
"phantomjs-prebuilt": "^2.1.12",
|
||||||
@@ -106,6 +104,7 @@
|
|||||||
"angular-scheduler": "git+https://git@github.com/ansible/angular-scheduler#0.1.1",
|
"angular-scheduler": "git+https://git@github.com/ansible/angular-scheduler#0.1.1",
|
||||||
"angular-tz-extensions": "git+https://git@github.com/ansible/angular-tz-extensions#0.3.13",
|
"angular-tz-extensions": "git+https://git@github.com/ansible/angular-tz-extensions#0.3.13",
|
||||||
"angular-ui-router": "1.0.0-beta.3",
|
"angular-ui-router": "1.0.0-beta.3",
|
||||||
|
"babel-polyfill": "^6.26.0",
|
||||||
"bootstrap": "^3.3.7",
|
"bootstrap": "^3.3.7",
|
||||||
"bootstrap-datepicker": "^1.7.1",
|
"bootstrap-datepicker": "^1.7.1",
|
||||||
"codemirror": "^5.17.0",
|
"codemirror": "^5.17.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user