Fix app name length issue in APPM Store

feature/appm-store/pbac
Jayasanka 5 years ago
parent e9cb3eae91
commit 2e690892d5

@ -117,7 +117,7 @@ class EditReleaseModal extends React.Component {
showModal = () => { showModal = () => {
const {release} = this.props; const {app, release} = this.props;
const {formConfig} = this.state; const {formConfig} = this.state;
const {specificElements} = formConfig; const {specificElements} = formConfig;
let metaData = []; let metaData = [];
@ -143,6 +143,14 @@ class EditReleaseModal extends React.Component {
} }
}); });
// if (specificElements.hasOwnProperty("packageName")) {
// this.props.form.setFields({
// packageName: {
// value: app.packageName
// }
// });
// }
if (specificElements.hasOwnProperty("version")) { if (specificElements.hasOwnProperty("version")) {
this.props.form.setFields({ this.props.form.setFields({
version: { version: {
@ -238,10 +246,10 @@ class EditReleaseModal extends React.Component {
if (specificElements.hasOwnProperty("url")) { if (specificElements.hasOwnProperty("url")) {
release.url = values.url; release.url = values.url;
} }
//
if (specificElements.hasOwnProperty("packageName")) { // if (specificElements.hasOwnProperty("packageName")) {
release.packageName = values.packageName; // release.packageName = values.packageName;
} // }
if (icons.length === 1) { if (icons.length === 1) {
data.append('icon', icons[0].originFileObj); data.append('icon', icons[0].originFileObj);
@ -362,18 +370,18 @@ class EditReleaseModal extends React.Component {
</Form.Item> </Form.Item>
)} )}
{formConfig.specificElements.hasOwnProperty("packageName") && ( {/*{formConfig.specificElements.hasOwnProperty("packageName") && (*/}
<Form.Item {...formItemLayout} label="Package Name"> {/* <Form.Item {...formItemLayout} label="Package Name">*/}
{getFieldDecorator('packageName', { {/* {getFieldDecorator('packageName', {*/}
rules: [{ {/* rules: [{*/}
required: true, {/* required: true,*/}
message: 'Please input the package name' {/* message: 'Please input the package name'*/}
}], {/* }],*/}
})( {/* })(*/}
<Input placeholder="Package Name"/> {/* <Input placeholder="Package Name"/>*/}
)} {/* )}*/}
</Form.Item> {/* </Form.Item>*/}
)} {/*)}*/}
{formConfig.specificElements.hasOwnProperty("url") && ( {formConfig.specificElements.hasOwnProperty("url") && (
<Form.Item {...formItemLayout} label="URL"> <Form.Item {...formItemLayout} label="URL">

@ -16,11 +16,12 @@
* under the License. * under the License.
*/ */
import {message, notification} from "antd"; import {notification} from "antd";
export const handleApiError = (error, message) => { export const handleApiError = (error, message) => {
if (error.hasOwnProperty("response") && error.response.status === 401) { if (error.hasOwnProperty("response") && error.response.status === 401) {
window.location.href = window.location.origin + '/publisher/login'; const redirectUrl = encodeURI(window.location.href);
window.location.href = window.location.origin + `/publisher/login?redirect=${redirectUrl}`;
} else { } else {
notification["error"]({ notification["error"]({
message: "There was a problem", message: "There was a problem",

@ -99,7 +99,12 @@ class NormalLoginForm extends React.Component {
axios.post(window.location.origin+ config.serverConfig.loginUri, request axios.post(window.location.origin+ config.serverConfig.loginUri, request
).then(res=>{ ).then(res=>{
if (res.status === 200) { if (res.status === 200) {
window.location = window.location.origin+"/publisher"; let redirectUrl = window.location.origin+"/publisher";
const searchParams = new URLSearchParams(window.location.search);
if(searchParams.has("redirect")){
redirectUrl = searchParams.get("redirect");
}
window.location = redirectUrl;
} }
}).catch(function (error) { }).catch(function (error) {
handleApiError(error, "Error occurred while trying to login."); handleApiError(error, "Error occurred while trying to login.");
@ -152,7 +157,7 @@ class NormalLoginForm extends React.Component {
)} )}
<br/> <br/>
<a className="login-form-forgot" href="">Forgot password</a> <a className="login-form-forgot" href="">Forgot password</a>
<Button block type="primary" htmlType="submit" className="login-form-button"> <Button loading={this.state.loading} block type="primary" htmlType="submit" className="login-form-button">
Log in Log in
</Button> </Button>
</Form.Item> </Form.Item>

@ -81,12 +81,12 @@ class Dashboard extends React.Component {
> >
<Menu.Item key="add-new-public-app"> <Menu.Item key="add-new-public-app">
<Link to="/publisher/add-new-app/public"> <Link to="/publisher/add-new-app/public">
Public APP Public App
</Link> </Link>
</Menu.Item> </Menu.Item>
<Menu.Item key="add-new-enterprise-app"> <Menu.Item key="add-new-enterprise-app">
<Link to="/publisher/add-new-app/enterprise"> <Link to="/publisher/add-new-app/enterprise">
Enterprise APP Enterprise App
</Link> </Link>
</Menu.Item> </Menu.Item>
<Menu.Item key="add-new-web-clip"> <Menu.Item key="add-new-web-clip">
@ -94,6 +94,11 @@ class Dashboard extends React.Component {
Web Clip Web Clip
</Link> </Link>
</Menu.Item> </Menu.Item>
<Menu.Item key="add-new-custom-app">
<Link to="/publisher/add-new-app/custom-app">
Custom App
</Link>
</Menu.Item>
</SubMenu> </SubMenu>
<SubMenu <SubMenu

@ -47,3 +47,10 @@
width: 100%; width: 100%;
border-radius: 28%; border-radius: 28%;
} }
.release .app-name{
white-space: nowrap;
overflow: hidden;
width: 100%;
text-overflow: ellipsis;
}

@ -49,7 +49,7 @@ class AppCard extends React.Component {
{/*<Avatar shape="square" size={128} src={release.iconPath} />*/} {/*<Avatar shape="square" size={128} src={release.iconPath} />*/}
</Col> </Col>
<Col span={24} style={{paddingTop:10}}> <Col span={24} style={{paddingTop:10}}>
<Text strong level={4}>{app.name}</Text><br/> <Text className="app-name" strong level={4}>{app.name}</Text><br/>
<Text type="secondary" level={4}>{app.subMethod.toLowerCase()}</Text><br/> <Text type="secondary" level={4}>{app.subMethod.toLowerCase()}</Text><br/>
<StarRatings <StarRatings
rating={app.rating} rating={app.rating}

@ -25,7 +25,7 @@ export const handleApiError = (error, message) => {
} else { } else {
notification["error"]({ notification["error"]({
message: "There was a problem", message: "There was a problem",
duration: 0, duration: 10,
description: message, description: message,
}); });
} }

Loading…
Cancel
Save