mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Add owner to select-plan page
This commit is contained in:
parent
fb1db7823b
commit
f4b69cad9b
@ -19,8 +19,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DummyPaymentProvider struct {
|
type DummyPaymentProvider struct{}
|
||||||
}
|
|
||||||
|
|
||||||
func NewDummyPaymentProvider() (*DummyPaymentProvider, error) {
|
func NewDummyPaymentProvider() (*DummyPaymentProvider, error) {
|
||||||
pp := &DummyPaymentProvider{}
|
pp := &DummyPaymentProvider{}
|
||||||
|
@ -102,7 +102,7 @@ class EntryPage extends React.Component {
|
|||||||
<Route exact path="/result/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
<Route exact path="/result/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
<Route exact path="/cas/:owner/:casApplicationName/logout" render={(props) => this.renderHomeIfLoggedIn(<CasLogout {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
<Route exact path="/cas/:owner/:casApplicationName/logout" render={(props) => this.renderHomeIfLoggedIn(<CasLogout {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
<Route exact path="/cas/:owner/:casApplicationName/login" render={(props) => {return (<LoginPage {...this.props} application={this.state.application} type={"cas"} mode={"signin"} onUpdateApplication={onUpdateApplication} {...props} />);}} />
|
<Route exact path="/cas/:owner/:casApplicationName/login" render={(props) => {return (<LoginPage {...this.props} application={this.state.application} type={"cas"} mode={"signin"} onUpdateApplication={onUpdateApplication} {...props} />);}} />
|
||||||
<Route exact path="/select-plan/:pricingName" render={(props) => this.renderHomeIfLoggedIn(<PricingPage {...this.props} pricing={this.state.pricing} onUpdatePricing={onUpdatePricing} {...props} />)} />
|
<Route exact path="/select-plan/:owner/:pricingName" render={(props) => this.renderHomeIfLoggedIn(<PricingPage {...this.props} pricing={this.state.pricing} onUpdatePricing={onUpdatePricing} {...props} />)} />
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -194,7 +194,7 @@ class PricingEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("pricing:Has trial"), i18next.t("pricing:Has trial - Tooltip"))} :
|
{Setting.getLabel(i18next.t("pricing:Has trial"), i18next.t("pricing:Has trial - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={1} >
|
<Col span={1} >
|
||||||
<Switch disabled={true} checked={this.state.pricing.hasTrial} onChange={checked => {
|
<Switch checked={this.state.pricing.hasTrial} onChange={checked => {
|
||||||
this.updatePricingField("hasTrial", checked);
|
this.updatePricingField("hasTrial", checked);
|
||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
@ -286,7 +286,7 @@ class PricingEditPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderPreview() {
|
renderPreview() {
|
||||||
const pricingUrl = `/select-plan/${this.state.pricing.name}`;
|
const pricingUrl = `/select-plan/${this.state.pricing.owner}/${this.state.pricing.name}`;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Col>
|
<Col>
|
||||||
|
@ -33,7 +33,7 @@ class PricingListPage extends BaseListPage {
|
|||||||
createdTime: moment().format(),
|
createdTime: moment().format(),
|
||||||
plans: [],
|
plans: [],
|
||||||
displayName: `New Pricing - ${randomName}`,
|
displayName: `New Pricing - ${randomName}`,
|
||||||
hasTrial: true,
|
hasTrial: false,
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
trialDuration: 14,
|
trialDuration: 14,
|
||||||
};
|
};
|
||||||
|
@ -27,6 +27,7 @@ class PricingPage extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
classes: props,
|
classes: props,
|
||||||
applications: null,
|
applications: null,
|
||||||
|
owner: props.owner ?? (props.match?.params?.owner ?? null),
|
||||||
pricingName: (props.pricingName ?? props.match?.params?.pricingName) ?? null,
|
pricingName: (props.pricingName ?? props.match?.params?.pricingName) ?? null,
|
||||||
pricing: props.pricing,
|
pricing: props.pricing,
|
||||||
plans: null,
|
plans: null,
|
||||||
@ -78,7 +79,7 @@ class PricingPage extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PricingBackend.getPricing("built-in", pricingName)
|
PricingBackend.getPricing(this.state.owner, pricingName)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
loading: false,
|
loading: false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user