-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ui: prevent same string docHelp override #5014
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
Changes from all commits
4a67aa7
79ca466
0b6d310
267f8e7
755e388
100e173
c4c6e3e
3d6ea62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,9 +24,11 @@ | |
| "url": "https://github.com/apache/cloudstack/issues" | ||
| }, | ||
| "scripts": { | ||
| "prebuild": "./prebuild.sh", | ||
| "start": "vue-cli-service lint --no-fix && vue-cli-service serve", | ||
| "serve": "vue-cli-service lint --no-fix && vue-cli-service serve", | ||
| "build": "vue-cli-service build", | ||
| "postbuild": "./postbuild.sh", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shwstppr could relative paths cause any issue? For ex. break in deb/rpm builds?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "lint": "vue-cli-service lint", | ||
| "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'", | ||
| "test:unit": "vue-cli-service test:unit" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
|
shwstppr marked this conversation as resolved.
|
||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| DIR=$(dirname $0) | ||
| configFile="$DIR/public/config.json" | ||
| tmpFile="$DIR/public/config.json.tmp" | ||
| echo "Post-build: removing all docHelp suffixes in ${configFile}" | ||
|
|
||
| node > ${tmpFile} <<EOF | ||
| // Read config | ||
| var data = require('${configFile}'); | ||
|
|
||
| // Clear docHelpMappings | ||
| data.docHelpMappings = {}; | ||
|
|
||
| // Output config | ||
| console.log(JSON.stringify(data, null, 2)); | ||
|
|
||
| EOF | ||
|
|
||
| mv ${tmpFile} ${configFile} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!/usr/bin/env bash | ||
|
shwstppr marked this conversation as resolved.
|
||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| DIR=$(dirname $0) | ||
| configFile="$DIR/public/config.json" | ||
| tmpFile="$DIR/public/config.json.tmp" | ||
| echo "Pre-build: list all docHelp suffixes in ${configFile}" | ||
| for m in $(grep "docHelp: '" -R ./src | sed "s/^.*: '//g" | sed "s/',//g" | sort | uniq); do | ||
| docHelpMappings+="${m}," | ||
| done; | ||
|
|
||
| node > ${tmpFile} <<EOF | ||
| // Read config | ||
| var data = require('${configFile}'); | ||
|
|
||
| // Add docHelpMappings | ||
| var suffixes = '${docHelpMappings}'; | ||
| suffixes = suffixes.split(','); | ||
| var mappings = {} | ||
| for (const suffix of suffixes) { | ||
| if (suffix) { | ||
| mappings[suffix] = suffix; | ||
| } | ||
| } | ||
| data.docHelpMappings = mappings; | ||
|
|
||
| // Output config | ||
| console.log(JSON.stringify(data, null, 2)); | ||
|
|
||
| EOF | ||
|
|
||
| mv ${tmpFile} ${configFile} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shwstppr could relative paths cause any issue? For ex. break in deb/rpm builds?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhtyd package.json file already have relative paths at line 33. Also, I'm not sure how to get absolute path in this case